User:DroneBetter/H-trees g.f.'s

From LifeWiki
Jump to navigation Jump to search

herein are my attempts at remediating the note

We have not found generating functions or explicit formulas for any of these sequences.

from the paper of recurrences for growth sequences in cellular automata (including H-trees)

I have had a few scattered and disorganised attempts at this in the past, that led to frustration

what they have left us

v1(k) = { (0,1,3,5)[k] . . . . . . . . . . . . .k < 4(3*⌊log2(k)⌋+1)*2⌊log2(k)⌋-2+1 . . . . .k = 2⌊log2(k)⌋3*2⌊log2(k)⌋-1+3 . . . . . . . . . . . .k = 2⌊log2(k)⌋+12*v1(k-2⌊log2(k)⌋)+v1(k-2⌊log2(k)⌋+1)-1 . k = 2⌊log2(k)⌋+1-12*v1(k-2⌊log2(k)⌋)+v1(k-2⌊log2(k)⌋+1) . . else
v1=lru_cache(λ k: (0,1,3,5)[k] if k<4 else (3*k.bit_length()-2<<k.bit_length()-3)+1 if not k&k-1 else 3*(2**(k.bit_length()-2)+1) if not k-1&k-2 else 2*v1(k-2**(k.bit_length()-1))+v1(k-2**(k.bit_length()-1)+1)-(not k&k+1))

let V1,1(x)=x+3*x2+5*x3 and thereafter V1,n(x)=(1+(1+x)*x2n)*V1,n-1(x)+((3*n+1)*2n-2*(1+x2n-1)+(3*2n-1-2)*x)*x2n, then gf(v1) = V1,∞

V1=λ n: polynomial(0,1,3,5) if n==1 else ((3*n+1)*2**(n-2)*(1+x**(2**n-1))+(3*2**(n-1)-2)*x)*x**2**n+(1+(1+2*x)*x**(2**n-1))*V1(n-1)
v2(k) = { k . . . . . . . . . . . . . . . . . . k < 23*2⌊log2(k)⌋-1 . . . . . . . . . . . . .k = 2⌊log2(k)⌋v2(k-2⌊log2(k)⌋)+2*v1(k-2⌊log2(k)⌋+1)-2 . k = 2⌊log2(k)⌋+1-1v2(k-2⌊log2(k)⌋)+2*v1(k-2⌊log2(k)⌋+1) . . else
v2=λ k: k if k<2 else v2(i:=k-2**(k.bit_length()-1))+2*(v1(i+1)-(not k&k+1)) if k&k-1 else (3<<k.bit_length()-1)-1
v(k) = { k . . . . . . . . .k < 26*2⌊log2(k)⌋-4 . . . k = 2⌊log2(k)⌋4*v2(k-2⌊log2(k)⌋) . else
v=λ k: k if k<2 else 4*v2(k-2**(k.bit_length()-1)) if k&k-1 else (6<<k.bit_length()-1)-4
the paper in question: