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.

A054251 a(0) = 1; a(n) = Sum_{0 <= k < n and gcd(k, n) != 1} a(k).

Original entry on oeis.org

1, 0, 1, 1, 2, 1, 5, 1, 9, 7, 19, 1, 45, 1, 83, 79, 165, 1, 417, 1, 827, 639, 1575, 1, 3875, 927, 7025, 5069, 14689, 1, 35461, 1, 64199, 47175, 128399, 52727, 309767, 1, 566565, 409567, 1186863, 1, 2835257, 1, 5202425, 4888729, 10357675, 1, 26066615
Offset: 0

Views

Author

Keywords

Crossrefs

Cf. A045545.

Programs

  • Mathematica
    a[0]:= 1; a[n_]:= a[n] =Sum[If[GCD[k, n]!=1, a[k], 0], {k,0,n-1}];
    Table[a[n], {n, 0, 50}] (* G. C. Greubel, Jul 31 2019 *)
  • PARI
    a(n) = if(n==0, 1, sum(j=0,n-1, if(gcd(j,n)!=1, a(j), 0)));
    vector(50, n, n--; a(n)) \\ G. C. Greubel, Jul 31 2019