OFFSET
1,1
COMMENTS
n such that prime(n) is in A108662. - Robert Israel, Aug 05 2019
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
5 is in the sequence because the 5th prime is 11, and 1^2 + 1^2 = 2 prime;
9 is in the sequence because the 9th prime is 23, and 2^2 + 3^2 = 13 prime;
139 is in the sequence because the 139th prime is 797, and 7^2 + 9^2 + 7^2 =179 prime.
MAPLE
with(numtheory): nn:= 150: T:=array(1..nn):k:=1:for n from 1 to 731 do:p:=ithprime(n):l:=evalf(floor(ilog10(p))+1):n0:=p:s:=0:for m from 1 to l do:q:=n0:u:=irem(q, 10):v:=iquo(q, 10):n0:=v :s:=s+u^2:od:if type(s, prime)=true then T[k]:=n:k:=k+1: else fi:od:print(T):
# Simpler:
filter:= proc(n) isprime(add(t^2, t=convert(ithprime(n), base, 10))) end proc:
select(filter, [$1..1000]); # Robert Israel, Aug 05 2019
MATHEMATICA
Select[Range[200], PrimeQ[Total[IntegerDigits[Prime[#]]^2]]&] (* Harvey P. Dale, Jan 10 2021 *)
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Michel Lagneau, May 03 2010
STATUS
approved