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.

A065962 a(1) = 1, a(n) = a(n - 1) + pi(a(n - 1)) + 1.

Original entry on oeis.org

1, 2, 4, 7, 12, 18, 26, 36, 48, 64, 83, 107, 136, 169, 209, 256, 311, 376, 451, 539, 639, 755, 889, 1044, 1220, 1420, 1644, 1904, 2196, 2524, 2894, 3313, 3780, 4307, 4898, 5553, 6286, 7104, 8015, 9025, 10147, 11393, 12769, 14293, 15971, 17832
Offset: 1

Views

Author

Labos Elemer, Dec 08 2001

Keywords

Comments

Labos came up with this sequence when trying to write a Mathematica program for A006508. The entire loop "While[ k - PrimePi[ k ] - 1, k++ ]" is meaningless; all the function g[n] really does is add up n + pi(n) + 1 and then NestList makes the recurrence happen. - Alonso del Arte, Oct 25 2011

Examples

			a(4) = 7 because a(3) = 4 and 4 + pi(4) + 1 = 4 + 2 + 1 = 7.
a(5) = 12 because a(4) = 7 and 7 + pi(7) + 1 = 7 + 4 + 1 = 12.
		

Crossrefs

Cf. A000720.

Programs

  • Mathematica
    g[ n_Integer ] := (k = n + PrimePi[ n ] + 1; While[ k - PrimePi[ k ] - 1, k++ ]; k); NestList[ g, 1, 50 ]
    NestList[#+PrimePi[#]+1&,1,50] (* Harvey P. Dale, Feb 13 2016 *)