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!)
A058039 a(n) = a(n-1) + 2*a(floor(n/2)) if n > 0, otherwise 1. 3
1, 3, 9, 15, 33, 51, 81, 111, 177, 243, 345, 447, 609, 771, 993, 1215, 1569, 1923, 2409, 2895, 3585, 4275, 5169, 6063, 7281, 8499, 10041, 11583, 13569, 15555, 17985, 20415, 23553, 26691, 30537, 34383, 39201, 44019, 49809, 55599, 62769, 69939, 78489, 87039 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,2
LINKS
FORMULA
a(n) = 1 + 2 * Sum_{k=1..n} a(floor(k/2)). - Ilya Gutkovskiy, Aug 15 2021
MATHEMATICA
a[n_]:= a[n] = If[n==0, 1, a[n-1] + 2*a[Floor[n/2]]];
Table[a[n], {n, 0, 50}] (* G. C. Greubel, Feb 10 2021 *)
PROG
(PARI) a(n) = if (n==0, 1, a(n-1)+2*a(n\2)); \\ Michel Marcus, Feb 04 2021
(Python)
def a(n): return 1 if n == 0 else a(n-1) + 2*a(n//2)
print([a(n) for n in range(44)]) # Michael S. Branicky, Feb 04 2021
(Magma) [1] cat [n le 2 select 3^n else Self(n-1) + 2*Self(Floor(n/2)): n in [1..51]]; // G. C. Greubel, Feb 10 2021
CROSSREFS
Sequence in context: A061810 A048701 A031159 * A371349 A013581 A350536
KEYWORD
nonn
AUTHOR
Reinhard Zumkeller, Feb 16 2002
EXTENSIONS
Name corrected by and more terms from Michael S. Branicky, Feb 04 2021
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 June 27 20:20 EDT 2024. Contains 373753 sequences. (Running on oeis4.)