login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
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
Hsien-Kuei Hwang, Svante Janson, and Tsung-Hsi Tsai, Identities and periodic oscillations of divide-and-conquer recurrences splitting at half, arXiv:2210.10968 [cs.DS], 2022, pp. 39-40, 44, 51, 60.
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: A246067 A161226 A369566 * A290190 A193452 A003451
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 | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 24 05:40 EDT 2024. Contains 371918 sequences. (Running on oeis4.)