OFFSET
1,1
COMMENTS
"SOD" = "sum of digits".
This sequence is a subset of A033548, the difference being that this sequence requires prime SODs.
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..1000
FORMULA
Find primes whose indices, when SODs are computed, are both prime and SOD(i) = SOD(p)
EXAMPLE
a(3) = 1039, the 175th prime. Both the SOD of the index and the prime are prime and equal: 13 = 13.
MATHEMATICA
sodQ[{n_, p_}]:=Module[{sodn=Total[IntegerDigits[n]], sodp=Total[IntegerDigits[p]]}, AllTrue[ {sodn, sodp}, PrimeQ] && sodn == sodp]; Select[With[{nn=1500}, Table[{n, Prime[n]}, {n, nn}]], sodQ][[;; , 2]] (* Harvey P. Dale, Apr 20 2024 *)
PROG
(UBASIC)
20 'SOD prime index and SOD prime
30 Y=1
40 Y=nxtprm(Y)
50 C=C+1:print C; Y; "-";
60 D=str(C):Z=str(Y)
70 E=len(D):F=len(Z)
80 for Q=2 to E
90 A=mid(D, Q, 1):G=val(A)
100 I=I+G:print I;
110 next Q
120 for R=2 to F
130 B=mid(Z, R, 1):H=val(B)
140 J=J+H:print J;
150 next R
160 if I=prmdiv(I) and J=prmdiv(J) and I=J then stop
170 I=0:J=0
180 goto 40
CROSSREFS
KEYWORD
easy,nonn,base
AUTHOR
Enoch Haga, Mar 19 2006
STATUS
approved