login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 56th year, we are closing in on 350,000 sequences, and we’ve crossed 9,700 citations (which often say “discovered thanks to the OEIS”).

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A065962 a(1) = 1, a(n) = a(n - 1) + pi(a(n - 1)) + 1. 0

%I

%S 1,2,4,7,12,18,26,36,48,64,83,107,136,169,209,256,311,376,451,539,639,

%T 755,889,1044,1220,1420,1644,1904,2196,2524,2894,3313,3780,4307,4898,

%U 5553,6286,7104,8015,9025,10147,11393,12769,14293,15971,17832

%N a(1) = 1, a(n) = a(n - 1) + pi(a(n - 1)) + 1.

%C 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 a(4) = 7 because a(3) = 4 and 4 + pi(4) + 1 = 4 + 2 + 1 = 7.

%e a(5) = 12 because a(4) = 7 and 7 + pi(7) + 1 = 7 + 4 + 1 = 12.

%t g[ n_Integer ] := (k = n + PrimePi[ n ] + 1; While[ k - PrimePi[ k ] - 1, k++ ]; k); NestList[ g, 1, 50 ]

%t NestList[#+PrimePi[#]+1&,1,50] (* _Harvey P. Dale_, Feb 13 2016 *)

%Y Cf. A000720

%K nonn,easy

%O 1,2

%A _Labos Elemer_, Dec 08 2001

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified December 9 05:30 EST 2021. Contains 349627 sequences. (Running on oeis4.)