OFFSET
1,1
LINKS
K. D. Bajpai, Table of n, a(n) for n = 1..10000
EXAMPLE
97 is a prime whose first digit is 9, which is 3^2, so 97 is a term.
MAPLE
KD := proc() local a, b, d, e; a:= ithprime(n); b:=length(a); d:=a/(10^(b-1)); e:=floor(d); if evalf(sqrt(e))=floor(evalf(sqrt(e))) then RETURN (a):fi; end:seq(KD(), n=1..200);
MATHEMATICA
Select[Prime[Range[200]], MemberQ[{1, 4, 9}, First[IntegerDigits[#]]]&] (* Harvey P. Dale, Sep 02 2023 *)
PROG
(Python)
from sympy import primerange
from itertools import count, islice
def agen(): yield from (p for e in count(1) for k in [1, 4, 9] for p in primerange(k*10**e, (k+1)*10**e))
print(list(islice(agen(), 54))) # Michael S. Branicky, Jun 25 2022
CROSSREFS
KEYWORD
nonn,base
AUTHOR
K. D. Bajpai, Aug 24 2013
STATUS
approved