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.

This page as a plain text file.
%I A065962 #13 Aug 18 2025 00:09:41
%S A065962 1,2,4,7,12,18,26,36,48,64,83,107,136,169,209,256,311,376,451,539,639,
%T A065962 755,889,1044,1220,1420,1644,1904,2196,2524,2894,3313,3780,4307,4898,
%U A065962 5553,6286,7104,8015,9025,10147,11393,12769,14293,15971,17832
%N A065962 a(1) = 1, a(n) = a(n - 1) + pi(a(n - 1)) + 1.
%C A065962 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
%e A065962 a(4) = 7 because a(3) = 4 and 4 + pi(4) + 1 = 4 + 2 + 1 = 7.
%e A065962 a(5) = 12 because a(4) = 7 and 7 + pi(7) + 1 = 7 + 4 + 1 = 12.
%t A065962 g[ n_Integer ] := (k = n + PrimePi[ n ] + 1; While[ k - PrimePi[ k ] - 1, k++ ]; k); NestList[ g, 1, 50 ]
%t A065962 NestList[#+PrimePi[#]+1&,1,50] (* _Harvey P. Dale_, Feb 13 2016 *)
%Y A065962 Cf. A000720.
%K A065962 nonn,easy
%O A065962 1,2
%A A065962 _Labos Elemer_, Dec 08 2001