OFFSET
0,1
COMMENTS
a(n) > a(n-1) except for 68, 180, 1051, 6454, 6456, 6459, 40073, 40078, ..., . - Robert G. Wilson v, Feb 24 2023
LINKS
Giovanni Resta, Table of n, a(n) for n = 0..10000
EXAMPLE
Remainder 7 appears first as 25 mod pi(25) = 25 mod 9 = 7, so a(7) = 25.
MAPLE
with(numtheory); f:=proc(n) local i, j, k; for i from 2 to 10000 do if i mod pi(i) = n then RETURN(i); fi; od: RETURN(-1); end; # N. J. A. Sloane, Sep 01 2008
MATHEMATICA
a = Compile[{{n, _Integer}}, Block[{k = 2}, While[ Mod[k, PrimePi@ k] != n, k++]; k]]; Array[a, 59, 0] (* Robert G. Wilson v, Feb 24 2023 *)
PROG
(PARI) a(n)={my(q=0, k=2); forprime(p=3, oo, q++; while(k<p, if(k%q==n, return(k)); k++))} \\ Andrew Howroyd, Feb 23 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
Labos Elemer, Jul 31 2002
EXTENSIONS
a(0) from Robert G. Wilson v, Feb 23 2023
STATUS
approved