OFFSET
1,1
COMMENTS
We select primes such that their sum-of-digits is some prime(j) and such that in addition the sum-of-digits of their index is prime(j-1).
Line 160 of the UBASIC program can be altered for <, >, or = relationships
Subset of A046704 - R. J. Mathar, Apr 17 2009
FORMULA
EXAMPLE
"SOD" = "sum of digits": a(5) = 113, the prime whose index is 30. SOD(30) = 3 and SOD(113) = 5. Since 3 < 5 and 5 is nextprime to 3, adjoin 113 to the sequence.
PROG
(UBASIC) 10 'use of str, mid, len, val 20 'in 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 and I=nxtprm(J) then stop 170 I=0:J=0 180 goto 40
CROSSREFS
KEYWORD
easy,nonn,base
AUTHOR
Enoch Haga, Mar 18 2006
EXTENSIONS
Edited by R. J. Mathar, Apr 17 2009
STATUS
approved