%I #34 Nov 14 2024 14:16:50
%S 0,1,4,27,1354,401429925999155061
%N Pillai sequence: a(n) is the smallest term in A007924 requiring n primes.
%C a(5) computed independently in 2007 by _R. J. Mathar_ and Luca & Thangadurai, both using Thomas Nicely's tables.
%C On Cramer's conjecture, the number of primes required is O(log* n), where log* is the iterated logarithm, so the rate of growth of a(n) is tetrational in n. - _Charles R Greathouse IV_, Aug 28 2010
%C The next term likely has hundreds of millions of digits. - _Charles R Greathouse IV_, Jun 29 2015
%D S. S. Pillai, "An arithmetical function concerning primes", Annamalai University Journal (1930), pp. 159-167.
%H Florian Luca and Ravindranathan Thangadurai, <a href="https://doi.org/10.5802/jtnb.695">On an arithmetic function considered by Pillai</a>, Journal de théorie des nombres de Bordeaux 21:3 (2009), pp. 695-701.
%H M. T. Marcos, <a href="http://primepuzzles.net/puzzles/puzz_141.htm">Smarandache Prime Base representation, prime puzzle 141</a>.
%H Thomas R. Nicely, <a href="https://faculty.lynchburg.edu/~nicely/gaps/gaplist.html">First occurrence prime gaps</a> [For local copy see A000101]
%H S. S. Pillai, <a href="https://krishikosh.egranth.ac.in/items/89748c10-dd02-4d5d-8668-fe1e7f4499e4">On an Arithmetic Function concerning Primes</a>, Journal Of The Annamalai University, Vol-1 (1932), pp. 159-167 (pages 204-212 in pdf).
%F a(n) = 2*p(m) - p(m-1) with minimal m = pi(a(n)) so that p(m) = a(n-1) + p(m-1), where p(n) is A008578(n).
%e The greatest prime <= 27 is 23; the greatest prime <= 27-23 is 3; 27-23-3 = 1, so the Pillai representation of 27 is 23+3+1, which uses more terms than all preceding numbers.
%o (PARI) A072491(n)=if(n<4,n>0,1+A072491(n-precprime(n)))
%o print1(r=0);for(n=1,1e7,if(A072491(n)>r,r=a(n);print1(", "n)))
%o \\ _Charles R Greathouse IV_, Feb 04 2013
%Y Cf. A007924.
%K nonn,hard,changed
%O 0,3
%A Copied from www.primepuzzles.net by _Frank Ellermann_, Dec 19 2001
%E Edited by _Charles R Greathouse IV_, Oct 28 2009
%E Entry rewritten by _Charles R Greathouse IV_, Aug 28 2010