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.

A190138 Final number of terms obtained with Euler's recurrence formula when computing the sum of divisors of n.

Original entry on oeis.org

1, 2, 3, 5, 9, 15, 27, 46, 80, 138, 238, 413, 713, 1235, 2136, 3695, 6393, 11057, 19130, 33091, 57246, 99032, 171315, 296365, 512682, 886902, 1534266, 2654154, 4591475, 7942870, 13740526, 23769981, 41120131, 71134474, 123056829, 212878289, 368262059, 637063333
Offset: 1

Views

Author

Michel Marcus, Dec 19 2012

Keywords

Comments

It appears that a(n) is the number of compositions of n whose parts are pentagonal numbers. See Neville link. - Michel Marcus, Jul 28 2017

Examples

			For n=5, start with row 5 of A195310: [4, 3, 0]. Then replace 4 by row 4: [3, 2], replace 3 by row 3: [2, 1]. The row is now [3, 2, 2, 1, 0].
Repeat process until all terms are 0: [4, 3, 0], [3, 2, 2, 1, 0], [2, 1, 1, 0, 1, 0, 0, 0], [1, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0].
The final array has 9 items, hence a(5) = 9.
		

Crossrefs

Programs

  • Mathematica
    rows = 30;
    gpenta[n_] := If[EvenQ[n], n(3n/2+1)/4, (n+1)(3n+1)/8];
    T[n_, k_] := n - gpenta[k];
    Do[row[n] = DeleteCases[Table[T[n, k], {k, n}], _?Negative], {n, rows}];
    a[n_] := a[n] = row[n] //. j_?Positive :> Sequence @@ row[j] // Length;
    Table[Print["a(", n, ") = ", a[n]]; a[n], {n, rows}] (* Jean-François Alcover, Sep 22 2018 *)
  • PARI
    A001318(n) = { return((3*n^2 + 2*n + (n%2) * (2*n + 1)) / 8);}
    A195310(n) = {if (n == 0, return ([0])); nb = 1; vec = vector(0); nn = n; while (nn >=0, nn = n - A001318(nb); if (nn >=0, vec = concat(vec, nn)); nb++;); return(vec);}
    A190138(m) = { vval = vector(m); for (n=1, m, vec = A195310(n); svec = 0; for (k=1, length(vec), if (vec[k] == 0, svec += 1, svec += vval[vec[k]]);); vval[n] = svec;); for (n=1, m, print1(vval[n], ", "););}