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.

A215488 a(0)=1, a(n) = a(n-1) + a(2*n AND n), where AND is the bitwise AND operator.

Original entry on oeis.org

1, 2, 3, 6, 7, 8, 15, 30, 31, 32, 33, 36, 67, 98, 165, 330, 331, 332, 333, 336, 337, 338, 345, 360, 691, 1022, 1353, 1686, 2377, 3068, 5445, 10890, 10891, 10892, 10893, 10896, 10897, 10898, 10905, 10920, 10921, 10922, 10923, 10926, 10957, 10988, 11055, 11220, 22111, 33002
Offset: 0

Views

Author

Alex Ratushnyak, Aug 13 2012

Keywords

Crossrefs

Cf. A213370.

Programs

  • Maple
    f:= proc(n) option remember;
    procname(n-1) + procname(Bits:-And(2*n,n))
    end proc:
    f(0):= 1:
    seq(f(i),i=0..100); # Robert Israel, Dec 29 2016
  • Mathematica
    A215488[n_] := A215488[n] = If[n == 0, 1, A215488[n-1] + A215488[BitAnd[2*n, n]]];
    Array[A215488, 50, 0] (* Paolo Xausa, Aug 06 2025 *)
  • Python
    a = [1]*1000
    for n in range(1,777):
        print(a[n-1], end=', ')
        a[n]= a[n-1] + a[2*n & n]