cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A058039 a(n) = a(n-1) + 2*a(floor(n/2)) if n > 0, otherwise 1.

This page as a plain text file.
%I A058039 #23 Aug 15 2021 21:53:09
%S A058039 1,3,9,15,33,51,81,111,177,243,345,447,609,771,993,1215,1569,1923,
%T A058039 2409,2895,3585,4275,5169,6063,7281,8499,10041,11583,13569,15555,
%U A058039 17985,20415,23553,26691,30537,34383,39201,44019,49809,55599,62769,69939,78489,87039
%N A058039 a(n) = a(n-1) + 2*a(floor(n/2)) if n > 0, otherwise 1.
%H A058039 G. C. Greubel, <a href="/A058039/b058039.txt">Table of n, a(n) for n = 0..1000</a>
%F A058039 a(n) = 1 + 2 * Sum_{k=1..n} a(floor(k/2)). - _Ilya Gutkovskiy_, Aug 15 2021
%t A058039 a[n_]:= a[n] = If[n==0, 1, a[n-1] + 2*a[Floor[n/2]]];
%t A058039 Table[a[n], {n, 0, 50}] (* _G. C. Greubel_, Feb 10 2021 *)
%o A058039 (PARI) a(n) = if (n==0, 1, a(n-1)+2*a(n\2)); \\ _Michel Marcus_, Feb 04 2021
%o A058039 (Python)
%o A058039 def a(n): return 1 if n == 0 else a(n-1) + 2*a(n//2)
%o A058039 print([a(n) for n in range(44)]) # _Michael S. Branicky_, Feb 04 2021
%o A058039 (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
%Y A058039 Cf. A000123, A002061, A067868, A347027.
%K A058039 nonn
%O A058039 0,2
%A A058039 _Reinhard Zumkeller_, Feb 16 2002
%E A058039 Name corrected by and more terms from _Michael S. Branicky_, Feb 04 2021