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).

Original entry on oeis.org

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, 29, 15, 31, 1, 11, 9, 25, 7, 33, 19, 43, 5, 33, 23, 59, 13, 55, 29, 61, 3, 25, 19, 51, 13, 59, 33, 73, 7, 43, 29, 73, 15, 61, 31, 63, 1, 13
Offset: 0

Views

Author

Roger L. Bagula, Mar 15 2006

Keywords

Comments

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
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

Crossrefs

Programs

  • Magma
    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))) >;
    [a(n): n in [0..70]]; // G. C. Greubel, Jul 07 2019
    
  • Maple
    A116528 := proc(n)
       option remember;
       if n <= 1 then
          n;
       elif type(n,'even') then
          procname(n/2) ;
       else
          2* procname((n-1)/2)+procname((n+1)/2) ;
       end if;
    end proc:
    seq(A116528(n),n=0..70) ; # R. J. Mathar, Nov 16 2011
  • Mathematica
    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}]
  • 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
    
  • Sage
    def a(n):
        if (n<2): return n
        elif (mod(n,2)==0): return a(n/2)
        else: return 2*a((n-1)/2) + a((n+1)/2)
    [a(n) for n in (0..70)] # G. C. Greubel, Jul 07 2019

Formula

G.f.: x * Product_{k>=0} (1 + x^(2^k) + 2*x^(2^(k+1))). - Ilya Gutkovskiy, Jul 07 2019

Extensions

Edited by G. C. Greubel, Oct 30 2016