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.

A324288 a(n) = A002487(1+A005187(n)).

Original entry on oeis.org

1, 1, 1, 3, 1, 4, 5, 2, 1, 5, 7, 3, 7, 2, 5, 8, 1, 6, 9, 4, 10, 3, 8, 13, 9, 2, 7, 12, 8, 11, 10, 7, 1, 7, 11, 5, 13, 4, 11, 18, 13, 3, 11, 19, 13, 18, 17, 12, 11, 2, 9, 16, 12, 17, 18, 13, 11, 14, 13, 10, 18, 11, 4, 13, 1, 8, 13, 6, 16, 5, 14, 23, 17, 4, 15, 26, 18, 25, 24, 17, 16, 3, 14, 25, 19, 27, 29, 21, 18, 23, 22, 17, 31, 19, 7, 23, 13, 2
Offset: 0

Views

Author

Antti Karttunen, Feb 20 2019

Keywords

Crossrefs

Programs

  • PARI
    A002487(n) = { my(s=sign(n), a=1, b=0); n = abs(n); while(n>0, if(bitand(n, 1), b+=a, a+=b); n>>=1); (s*b); }; \\ Modified from the one given in A002487, sign not actually needed here.
    A005187(n) = { my(s=n); while(n>>=1, s+=n); s; };
    A324288(n) = A002487(1+A005187(n));
    
  • Python
    from functools import reduce
    def A324288(n): return sum(reduce(lambda x,y:(x[0],x[0]+x[1]) if int(y) else (x[0]+x[1],x[1]),bin(1+(n<<1)-n.bit_count())[-1:2:-1],(1,0))) if n else 1 # Chai Wah Wu, May 05 2023

Formula

a(n) = A002487(1+A005187(n)).