# Number of canonical move sequences for nxnxn Rubik's cube in q-w metric

Quarter turn metric is more difficult to handle than h-w metric, because the 180 degree turn has to be counted as two moves, which gives some issues with an recursive approach. I did not believe it was possible to get a simple formula here. I was very surprised, that the result was a simple generating function for the number of canonical sequences in q-w-metric. It is

gfq[n_,x_]:=3/(6-4(x+1)^(2(n-1)))-1/2

and looks very similar to the generating function in h-w metric which is

gfh[n_,x_]:= 3/(6-4(3x+1)^(n-1))-1/2

For n=3 we have for example

Series[gfq[3,x],{x,0,10}] 1+12 x+114 x^2+1068 x^3+10011 x^4+93840 x^5+879624 x^6+8245296 x^7+77288598 x^8+724477008 x^9+6791000856 x^10+O[x]^11

From the generating function it is possible to get an explicit formula for the number of canonical move sequences with length k, but I yet have to work this out, because the double zeros of the denominator make things a bit more complicated.

The inverse of the smallest zero of the denominator is the asymptotic branching factor, which is

1/(-1+(3/2)^(1/(2 (-1+n))))

## Comment viewing options

### Non recursive formula

Hmm, there are no double zeros at all, so the derivation of the non recursive formula was straightforward. We have with

bq[n_,j_]:=1/((3/2)^(1/(2n))*E^(I*j*PI)/n)-1)

that

countQW[n_,k_]:=Sum[(1+bq[n,j])/(4n) bq[n,j]^k,{j,0,2n-1}]

gives the number of q-w canonical sequences for the (n+1)x(n+1)x(n+1) cube. A very good approximation is

countQWApprox[n_,k_]:=( 1+bq[n,0] )/(4n) bq[n,0]^k

because Abs[bq[n,j]]<< Abs[bq[n,0]] for 1<=j<2n

Using this terminology, for the number of h-w canonical sequences we have

bh[n_,j_]:=3/((3/2)^(1/n) E^(2*I*j*PI/n)-1)
countHW[n_,k_]:=Sum[(3+bh[n,j])/(6n) bh[n,j]^k,{j,0,n-1}]
countHWApprox[n_,k_]:=( 3+bh[n,0] )/(6n) bh[n,0]^k

### This is amazing! Can you plea

This is amazing! Can you please post the count table using this non recursive formula similar to what you did for HTM? What is QTM God's number according to this formula?
{"ft_lang_label":"__label__en","ft_lang_prob":0.8931788,"math_prob":0.9953075,"size":1258,"snap":"2023-40-2023-50","text_gpt3_token_len":377,"char_repetition_ratio":0.086124405,"word_repetition_ratio":0.010416667,"special_character_ratio":0.34101748,"punctuation_ratio":0.07553957,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.99974805,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2023-12-07T14:39:52Z\",\"WARC-Record-ID\":\"<urn:uuid:b93840e3-0d0d-4ee0-aed4-73b1eb89e052>\",\"Content-Length\":\"15759\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:07c6b91b-716a-4a91-b48f-332ecb51db25>\",\"WARC-Concurrent-To\":\"<urn:uuid:0fba150d-1c2b-4d29-b517-80cd5b11c3e7>\",\"WARC-IP-Address\":\"69.165.220.244\",\"WARC-Target-URI\":\"http://forum.cubeman.org/?q=node/view/301\",\"WARC-Payload-Digest\":\"sha1:I4TJXXSYLR7HYJLLYLDIYMW5I6BTSZAY\",\"WARC-Block-Digest\":\"sha1:FF66MXF3ZORFAFKISDCQWF6AHXWLGOUT\",\"WARC-Identified-Payload-Type\":\"application/xhtml+xml\",\"warc_filename\":\"/cc_download/warc_2023/CC-MAIN-2023-50/CC-MAIN-2023-50_segments_1700679100674.56_warc_CC-MAIN-20231207121942-20231207151942-00378.warc.gz\"}"}