%I #14 Dec 19 2015 14:27:49
%S 2,7,14,36,72,188,410,1021,2392,5818,13862,33678,80784,195440,470916,
%T 1137710,2744212,6627675,15994430,38619812,93222780,225072548,
%U 543339722,1311772784,3166816034,7645450834,18457558444,44560677618,107578520352,259717999680,627013566050,1513745792655,3654502889812
%N G.f.: Sum_{n>=1} Pell(n+1) * x^n / (1 - x^n), where Pell(n) = A000129(n).
%H Vaclav Kotesovec, <a href="/A256272/b256272.txt">Table of n, a(n) for n = 1..1000</a>
%F G.f.: Sum_{n>=1} x^n * (2 + x^n) / (1 - 2*x^n - x^(2*n)).
%F G.f.: Sum_{n>=1} x^n * Sum_{d|n} (2 + x^d)^(n/d).
%F a(2*n^2) == 1 (mod 2), with a(n) == 0 (mod 2) elsewhere.
%F a(n) ~ (1+sqrt(2))^(n+1) / (2*sqrt(2)). - _Vaclav Kotesovec_, Jun 02 2015
%e G.f.: A(x) = 2*x + 7*x^2 + 14*x^3 + 36*x^4 + 72*x^5 + 188*x^6 +...
%e where by definition
%e A(x) = 2*x/(1-x) + 5*x^2/(1-x^2) + 12*x^3/(1-x^3) + 29*x^4/(1-x^4) + 70*x^5/(1-x^5) + 169*x^6/(1-x^6) + 408*x^7/(1-x^7) + 985*x^8/(1-x^8) + 2378*x^9/(1-x^9) + 5741*x^10/(1-x^10) +...+ Pell(n+1)*x^n/(1-x^n) +...
%e The g.f. is also given by the series identity:
%e A(x) = x*(2+x)/(1-2*x-x^2) + x^2*(2+x^2)/(1-2*x^2-x^4) + x^3*(2+x^3)/(1-2*x^3-x^6) + x^4*(2+x^4)/(1-2*x^4-x^8) + x^5*(2+x^5)/(1-2*x^5-x^10) + x^6*(2+x^6)/(1-2*x^6-x^12) + x^7*(2+x^7)/(1-2*x^7-x^14) +...+ x^n*(1+x^n)/(1-x^n-x^(2*n)) +...
%e And also we have the series:
%e A(x) = x*(2 + x) + x^2*((2+x)^2 + (2+x^2)) + x^3*((2+x)^3 + (2+x^3))
%e + x^4*((2+x)^4 + (2+x^2)^2 + (2+x^4)) + x^5*((2+x)^5 + (2+x^5))
%e + x^6*((2+x)^6 + (2+x^2)^3 + (2+x^3)^2 + (2+x^6))
%e + x^7*((2+x)^7 + (2+x^7))
%e + x^8*((2+x)^8 + (2+x^2)^4 + (2+x^4)^2 + (2+x^8))
%e + x^9*((2+x)^9 + (2+x^3)^3 + (2+x^9))
%e + x^10*((2+x)^10 + (2+x^2)^5 + (2+x^5)^2 + (2+x^10))
%e + x^11*((2+x)^11 + (2+x^11))
%e + x^12*((2+x)^12 + (2+x^2)^6 + (2+x^3)^4 + (2+x^4)^3 + (2+x^6)^2 + (2+x^12))
%e +...+ x^n * Sum_{d|n} (2 + x^d)^(n/d) +...
%e or, more explicitly,
%e A(x) = x*(2 + x) + x^2*(6 + 4*x + 2*x^2)
%e + x^3*(10 + 12*x + 6*x^2 + 2*x^3)
%e + x^4*(22 + 32*x + 28*x^2 + 8*x^3 + 3*x^4)
%e + x^5*(34 + 80*x + 80*x^2 + 40*x^3 + 10*x^4 + 2*x^5)
%e + x^6*(78 + 192*x + 252*x^2 + 164*x^3 + 66*x^4 + 12*x^5 + 4*x^6)
%e + x^7*(130 + 448*x + 672*x^2 + 560*x^3 + 280*x^4 + 84*x^5 + 14*x^6 + 2*x^7)
%e + x^8*(278 + 1024*x + 1824*x^2 + 1792*x^3 + 1148*x^4 + 448*x^5 + 120*x^6 + 16*x^7 + 4*x^8)
%e + x^9*(522 + 2304*x + 4608*x^2 + 5388*x^3 + 4032*x^4 + 2016*x^5 + 678*x^6 + 144*x^7 + 18*x^8 + 3*x^9) +...
%t a[n_] := SeriesCoefficient[Sum[(x^k*(2+x^k))/(1-2*x^k-x^(2*k)), {k, 1, n}], {x, 0, n}]; Array[a, 40] (* _Jean-François Alcover_, Dec 19 2015 *)
%o (PARI) {Pell(n)=polcoeff(x/(1-2*x-x^2 +x*O(x^n)),n)}
%o {a(n)=polcoeff(sum(m=1, n, Pell(m+1)*x^m/(1-x^m +x*O(x^n))), n)}
%o for(n=1, 40, print1(a(n), ", "))
%o (PARI) {a(n)=polcoeff(sum(m=1, n, x^m*(2+x^m)/(1-2*x^m-x^(2*m) +x*O(x^n)) ), n)}
%o for(n=1, 40, print1(a(n), ", "))
%o (PARI) {a(n)=local(A=x+x^2); A=sum(m=1, n, x^m*sumdiv(m, d, (2 + x^(m/d) +x*O(x^n))^d) ); polcoeff(A, n)}
%o for(n=1, 40, print1(a(n), ", "))
%Y Cf. A256281, A245282, A000129.
%K nonn
%O 1,1
%A _Paul D. Hanna_, Jun 01 2015