The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A022560 a(0)=0, a(2*n) = 2*a(n) + 2*a(n-1) + n^2 + n, a(2*n+1) = 4*a(n) + (n+1)^2. 4
 0, 1, 4, 8, 16, 25, 36, 48, 68, 89, 112, 136, 164, 193, 224, 256, 304, 353, 404, 456, 512, 569, 628, 688, 756, 825, 896, 968, 1044, 1121, 1200, 1280, 1392, 1505, 1620, 1736, 1856, 1977, 2100, 2224, 2356, 2489, 2624, 2760, 2900, 3041 (list; graph; refs; listen; history; text; internal format)
 OFFSET 0,3 LINKS G. C. Greubel, Table of n, a(n) for n = 0..5000 R. Stephan, Some divide-and-conquer sequences ... R. Stephan, Table of generating functions FORMULA Let a(i, n) = 2^(i-1)*floor(1/2 + n/2^i); sequence is a(n) = Sum_{i=1} a(i, n)*(n - a(i, n)). Second differences give A006519. Also a(1)=0 and a(n) = floor(n^2/4) + a(floor(n/2)) + a(ceiling(n/2)). G.f.: 1/(1-x)^2 * (x/(1-x) + Sum_{k>=1} 2^(k-1)*x^2^k/(1-x^2^k)). - Ralf Stephan, Apr 17 2003 a(0)=0, a(2n) = 2*a(n) + 2*a(n-1) + n^2 + n, a(2n+1) = 4a(n)+(n+1)^2. - Ralf Stephan, Sep 13 2003 MATHEMATICA a[n_]:= If[n==0, 0, If[Mod[n, 2]==0, 2*a[n/2] + 2*a[n/2-1] +(n/2)^2 +(n/2), 4*a[(n-1)/2] +((n+1)/2)^2]]; Table[a[n], {n, 0, 50}] (* G. C. Greubel, Feb 26 2018 *) PROG (PARI) a(n) = if (n==0, 0, if (n % 2, my(nn = (n-1)/2); 4*a(nn)+(nn+1)^2, my(nn = n/2); 2*a(nn)+2*a(nn-1)+nn^2+nn)) \\ Michel Marcus, Jun 27 2013 (Sage) def a(n):     if (n==0): return 0     elif (n%2==0): return 2*a(n/2) + 2*a(n/2 -1) +(n/2)^2 +(n/2)     else: return 4*a((n-1)/2) +((n+1)/2)^2 [a(n) for n in (0..50)] # G. C. Greubel, Jun 13 2019 CROSSREFS First differences are in A006520. Cf. A070263. Sequence in context: A330992 A246067 A161226 * A290190 A193452 A003451 Adjacent sequences:  A022557 A022558 A022559 * A022561 A022562 A022563 KEYWORD nonn AUTHOR Andre Kundgen (kundgen(AT)math.uiuc.edu) EXTENSIONS More terms from Ralf Stephan, Sep 13 2003 STATUS approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

Last modified April 11 09:54 EDT 2021. Contains 342886 sequences. (Running on oeis4.)