A206743 G.f.: 1/(1 - x/(1 - x^2/(1 - x^5/(1 - x^12/(1 - x^29/(1 - x^70/(1 -...- x^Pell(n)/(1 -...)))))))), a continued fraction.
1, 1, 1, 2, 3, 5, 8, 13, 22, 36, 60, 99, 164, 272, 450, 746, 1235, 2046, 3389, 5613, 9299, 15402, 25514, 42262, 70005, 115962, 192084, 318182, 527053, 873043, 1446161, 2395504, 3968060, 6572925, 10887788, 18035177, 29874537, 49485965, 81971484, 135782448
Offset: 0
Keywords
Examples
G.f.: A(x) = 1 + x + x^2 + 2*x^3 + 3*x^4 + 5*x^5 + 8*x^6 + 13*x^7 +...
Links
- Kenny Lau, Table of n, a(n) for n = 0..1000
Programs
-
Maple
A206743 := proc(r) local gs,n,gs2,el,a ; gs := [2,r] ; for n from 3 do gs2 := [] ; for el in gs do gs2 := [op(gs2),el+1,r*el] ; end do: gs := gs2 ; a := 0 ; for el in gs do if type(el,'realcons') then a := a+1 : end if; end do: print(n,a) ; end do: end proc: # R. J. Mathar, Jun 16 2016
-
Mathematica
z = 18; t = Join[{{0}}, Expand[NestList[DeleteDuplicates[Flatten[Map[{# + 1, x*#} &, #], 1]] &, {1}, z]]]; u = Table[t[[k]] /. x -> 2 I, {k, 1, z}]; Table[Count[Map[IntegerQ, u[[k]]], True], {k, 1, z}] (* Clark Kimberling, Jun 12 2016 *)
-
PARI
{Pell(n)=polcoeff(x/(1-2*x-x^2+x*O(x^n)),n)} {a(n)=local(CF=1+x*O(x^n),M=ceil(log(2*n+1)/log(2.4))); for(k=0, M, CF=1/(1-x^Pell(M-k+1)*CF)); polcoeff(CF, n, x)} for(n=0,55,print1(a(n),", "))
-
Python
N = 1000 pell = [0,1] c = 2 while c < N: pell.append(c) c = pell[-1]*2 + pell[-2] pell.reverse() gf = [0]*(N+1) for p in pell: gf = [-x for x in gf] gf[0] += 1 quotient = [0]*(N+1) remainder = [0]*(N+1) remainder[p] = 1 for n in range(N+1): q = remainder[n]//gf[0] for i in range(n,N+1): remainder[i] -= q*gf[i-n] quotient[n] = q gf = quotient for i in range(N+1): print(i,gf[i]) # Kenny Lau, Aug 01 2017
Formula
a(n) ~ c * d^n, where d = 1.6564594309887754808836889708489581749625897572527517021957723319642053908... and c = 0.3844078703275069072126260832303344589497793302955451672191630264983... - Vaclav Kotesovec, Aug 25 2017
Comments