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.

A122698 a(1)=a(2)=1 then a(n) = Sum_{d|n, 1

Original entry on oeis.org

1, 1, 0, 1, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 42, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Offset: 1

Views

Author

Benoit Cloitre, Sep 22 2006

Keywords

Crossrefs

Cf. A000108.

Programs

  • Mathematica
    a[1] = a[2] = 1; a[n_] := a[n] = DivisorSum[n, a[#] * a[n/#] &, 1 < # < n &]; Array[a, 100]
    (* or *)
    a[n_] := Module[{e = IntegerExponent[n, 2]}, If[n == 2^e, CatalanNumber[e-1], 0]]; a[1] = 1; a[n_?OddQ] = 0; Array[a, 100] (* Amiram Eldar, Sep 05 2023 *)
  • PARI
    a(n)=if(n<3,1,sumdiv(n,d,if((d-1)*(d-n),a(d)*a(n/d),0)))
    
  • PARI
    a(n)={my(e=valuation(n,2)); if(n==1<Andrew Howroyd, Aug 05 2018

Formula

a(1) = 1, for k>=0 a(2^(k+1)) = A000108(k) and if n>1 is not a power of 2 a(n) = 0.

Extensions

Keyword:mult added by Andrew Howroyd, Aug 05 2018