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.

A297216 a(0)=1; a(1)=1; for n >= 2, a(n) = a(n-A000120(n)) + a(n-1-A023416(n)).

Original entry on oeis.org

1, 1, 2, 3, 4, 6, 8, 12, 16, 20, 28, 36, 48, 64, 84, 120, 156, 184, 240, 312, 396, 480, 624, 792, 1020, 1248, 1584, 2040, 2496, 3288, 4080, 5664, 7248, 8160, 10536, 12912, 16200, 18696, 23448, 29112, 36360, 42144, 52560, 65472, 78504, 94704, 118032, 147264, 183504, 212736
Offset: 0

Views

Author

Ctibor O. Zizka, Dec 27 2017

Keywords

Comments

for n >= 6, a(n) = k(n) * (a(0) + 3*a(1)).

Examples

			n=7, A000120(7)=3, A023416(7)=0. a(7) = a(4)+a(6) = a(3)+a(1)+a(4)+a(4) = 3*(a(3)+a(1)) = 3*(a(1)+a(2)+a(1)) = 3*(a(0)+3*a(1)). a(7)=12; k(7)=3.
		

Crossrefs

Programs

  • Maple
    A297216 := proc(n)
        option remember ;
        if n <=1 then
            1;
        else
            procname(n-wt(n))+procname(n-1-A023416(n)) ;
        end if;
    end proc:
    seq(A297216(n),n=0..30) ; # R. J. Mathar, Jun 19 2021
  • Mathematica
    a[0] = a[1] = 1; a[n_] := a[n] = a[n - DigitCount[n, 2, 1]] + a[n - 1 - DigitCount[n, 2, 0]]; Array[a, 50, 0] (* Amiram Eldar, Aug 01 2023 *)
  • PARI
    a(n) = if (n<=1, 1, a(n-hammingweight(n)) + a(n-1-(#binary(n)-hammingweight(n)))); \\ Michel Marcus, Dec 27 2017

Extensions

More terms from Michel Marcus, Dec 27 2017
Offset corrected by R. J. Mathar, Jun 19 2021