login
A127419
Recurrence: a(n) = a(n-1) + floor( (sqrt(8 * a(n-1) - 7) - 1)/2 ) for n>=2 with a(0)=1, a(1)=2.
2
1, 2, 3, 4, 6, 8, 11, 15, 19, 24, 30, 37, 45, 53, 62, 72, 83, 95, 108, 122, 137, 153, 169, 186, 204, 223, 243, 264, 286, 309, 333, 358, 384, 411, 439, 468, 498, 529, 561, 593, 626, 660, 695, 731, 768, 806, 845, 885, 926, 968, 1011, 1055, 1100, 1146, 1193, 1241
OFFSET
0,2
LINKS
FORMULA
G.f.: A(x) = (1-x+x^3)/(1-x)^3 - x^3/(1-x)^2 * Sum_{k>=0} x^(2^k + k-1).
a(n) satisfies: floor((sqrt(8*a(n) - 7) - 1)/2) = A103354(n) for n>=1, where A103354 = floor(x), where x is the solution to x = 2^(n-x).
EXAMPLE
floor( (sqrt(8 * a(n) - 7) - 1)/2 ) = A103354(n) for n>=0:
[0,1,1,2,2,3,4,4,5,6,7,8,8,9,10,11,12,13,14,15,16,16,17,...];
i.e. the nonnegative integers with powers of 2 repeated.
G.f.: A(x) = 1 + 2*x + 3*x^2 + 4*x^3 + 6*x^4 + 8*x^5 + 11*x^6 + ...
G.f.: A(x) = (1-x+x^3)/(1-x)^3 - x^3/(1-x)^2 * B(x) where B(x) = 1 + x^2 + x^5 + x^10 + x^19 + x^36 + x^69 +...+ x^(2^n+n-1) +...
MATHEMATICA
Join[{1}, NestList[#+Floor[(Sqrt[8#-7]-1)/2]&, 2, 60]] (* Harvey P. Dale, May 26 2023 *)
PROG
(PARI) /* Using G.f.: */
{a(n)=local(x=X+X*O(X^n)); polcoeff((1-x+x^3)/(1-x)^3 - x^3/(1-x)^2*(sum(k=0, #binary(n), x^(2^k+k-1))), n, X)}
(PARI) /* Using Recurrence: */
{a(n)=if(n==0, 1, if(n==1, 2, a(n-1)+(sqrtint(8*a(n-1)-7)-1)\2))}
CROSSREFS
Cf. A103354.
Sequence in context: A303663 A117995 A033834 * A262160 A132217 A265254
KEYWORD
nonn
AUTHOR
Paul D. Hanna, Jan 13 2007
STATUS
approved