OFFSET
1,1
LINKS
Robert Israel, Table of n, a(n) for n = 1..1000
EXAMPLE
a(1)=9, since 9 is a square, pi(9)=4 and 9+4=13 is a prime.
MAPLE
select(t -> isprime(t + numtheory:-pi(t)), [seq(i^2, i=1..1000)]); # Robert Israel, Mar 21 2017
MATHEMATICA
Select[Range[1000]^2, PrimeQ[# + PrimePi[#]] &] (* Indranil Ghosh, Mar 21 2017 *)
PROG
(PARI)
v=vector(1000);
for(n=1, 1000, v[n] = n^2);
for(n=1, 1000, if(isprime(v[n] + primepi(v[n])), print1(v[n], ", "))) \\ Indranil Ghosh, Mar 21 2017
(Python)
from sympy import primepi, isprime
N = (x**2 for x in range(1, 1001))
print([n for n in N if isprime(n + primepi(n))]) # Indranil Ghosh, Mar 21 2017
CROSSREFS
KEYWORD
nonn
AUTHOR
David Garber, Nov 13 2002
STATUS
approved