OFFSET
1,1
COMMENTS
The last term of this sequence is a(179) = 9859.
Subsequence of A046704. - R. J. Mathar, Oct 28 2009
Prime digit sums 5, 7, 11, 13, 17, 19, 23, 29, 31 occur 5, 8, 23, 19, 37, 37, 38, 9, 3 times, respectively. Sequence contains ten twin prime pairs. - Rick L. Shepherd, Feb 19 2013
LINKS
Nathaniel Johnston, Table of n, a(n) for n = 1..179 (full sequence)
EXAMPLE
1217 is in the list since 1217, 12+17=29, and 1+2+1+7=11 are all primes.
MAPLE
p:=1009: while p<10000 do d:=convert(p, base, 10): if(isprime(add(d[j], j=1..4)) and isprime(d[1]+d[3]+10*(d[2]+d[4])))then printf("%d, ", p): fi: p:=nextprime(p): od: # Nathaniel Johnston, Jun 03 2011
MATHEMATICA
apQ[n_]:=Module[{idn=IntegerDigits[n], a, b, c, d}, a=idn[[1]]; b=idn[[2]]; c= idn[[3]]; d=idn[[4]]; AllTrue[{10a+b+10c+d, Total[idn]}, PrimeQ]]; Select[ Prime[Range[PrimePi[1000]+1, PrimePi[9999]]], apQ] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Mar 14 2015 *)
PROG
(Python)
from sympy import isprime
def ok(n):
if n < 1000 or n > 9999 or not isprime(n): return False
return isprime(n//100 + n%100) and isprime(sum(map(int, str(n))))
afull = [k for k in range(1001, 10000, 2) if ok(k)]
print(afull[:42]) # Michael S. Branicky, Aug 20 2022
CROSSREFS
KEYWORD
base,easy,fini,full,nonn
AUTHOR
Ray G. Opao, Oct 26 2009
EXTENSIONS
Numbers in the range 1000 to 1200 inserted by R. J. Mathar, Oct 28 2009
Many terms corrected by Nathaniel Johnston, Jun 03 2011
STATUS
approved