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.

A116528 a(0)=0, a(1)=1, and for n>=2, a(2*n) = a(n), a(2*n+1) = 2*a(n) + a(n+1).

This page as a plain text file.
%I A116528 #40 Feb 16 2025 08:33:00
%S A116528 0,1,1,3,1,5,3,7,1,7,5,13,3,13,7,15,1,9,7,19,5,23,13,29,3,19,13,33,7,
%T A116528 29,15,31,1,11,9,25,7,33,19,43,5,33,23,59,13,55,29,61,3,25,19,51,13,
%U A116528 59,33,73,7,43,29,73,15,61,31,63,1,13
%N A116528 a(0)=0, a(1)=1, and for n>=2, a(2*n) = a(n), a(2*n+1) = 2*a(n) + a(n+1).
%C A116528 Equals row 2 of the array in A178239, an infinite set of sequences of the form a(n) = a(2n), a(2n+1) = r*a(n) + a(n+1). - _Gary W. Adamson_, May 23 2010
%C A116528 Given an infinite lower triangular matrix M with (1, 1, 2, 0, 0, 0, ...) in every column, shifted down twice for columns k>1; lim_{n->infinity} M^n = A116528, the left-shifted vector considered as a sequence with offset 1. - _Gary W. Adamson_, May 05 2010
%H A116528 G. C. Greubel, <a href="/A116528/b116528.txt">Table of n, a(n) for n = 0..2500</a>
%H A116528 H. Harborth, <a href="http://dx.doi.org/10.1090/S0002-9939-1977-0429714-1">Number of Odd Binomial Coefficients</a>, Proc. Amer. Math. Soc. 62, 19-22, 1977.
%H A116528 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/Stolarsky-HarborthConstant.html">Stolarsky-Harborth Constant</a>
%F A116528 G.f.: x * Product_{k>=0} (1 + x^(2^k) + 2*x^(2^(k+1))). - _Ilya Gutkovskiy_, Jul 07 2019
%p A116528 A116528 := proc(n)
%p A116528    option remember;
%p A116528    if n <= 1 then
%p A116528       n;
%p A116528    elif type(n,'even') then
%p A116528       procname(n/2) ;
%p A116528    else
%p A116528       2* procname((n-1)/2)+procname((n+1)/2) ;
%p A116528    end if;
%p A116528 end proc:
%p A116528 seq(A116528(n),n=0..70) ; # _R. J. Mathar_, Nov 16 2011
%t A116528 b[0]:= 0; b[1]:= 1; b[n_?EvenQ]:= b[n] = b[n/2]; b[n_?OddQ]:= b[n] = 2*b[(n-1)/2] + b[(n+1)/2]; a = Table[b[n], {n, 1, 70}]
%o A116528 (PARI) a(n) = if(n<2, n, if(n%2==0, a(n/2), 2*a((n-1)/2) + a((n+1)/2))); \\ _G. C. Greubel_, Jul 07 2019
%o A116528 (Magma)
%o A116528 a:=func< n | n lt 2 select n else ((n mod 2) eq 0) select Self(Round((n+1)/2)) else (2*Self(Round(n/2)) + Self(Round((n+2)/2))) >;
%o A116528 [a(n): n in [0..70]]; // _G. C. Greubel_, Jul 07 2019
%o A116528 (Sage)
%o A116528 def a(n):
%o A116528     if (n<2): return n
%o A116528     elif (mod(n,2)==0): return a(n/2)
%o A116528     else: return 2*a((n-1)/2) + a((n+1)/2)
%o A116528 [a(n) for n in (0..70)] # _G. C. Greubel_, Jul 07 2019
%Y A116528 Cf. A006046, A116529, A116552, A116553, A116554, A116555.
%K A116528 nonn,easy
%O A116528 0,4
%A A116528 _Roger L. Bagula_, Mar 15 2006
%E A116528 Edited by _G. C. Greubel_, Oct 30 2016