OFFSET
1,1
COMMENTS
Let d(1)d(2)...d(q) denote the decimal expansion of a prime number. Replace each digit d(i) in decimal expansion of n with Sum_{j=1..q, j<>i} d(j) such that the result is a prime number.
The corresponding primes are 11, 31, 71, 13, 73, 17, 37, 97, 79, 983, 947, 929, 233, 1297, 839, 1499, ...
EXAMPLE
983 is in the sequence because 983 becomes 111217 which is also prime, where 11=8+3, 12=9+3 and 17=9+8.
MAPLE
with(numtheory):T:=array(1..10):
for n from 1 to 1000 do:
p:=ithprime(n):k:=0:s:=0:j:=0:
x:=convert(p, base, 10):n1:=nops(x):
s1:=sum('x[i]', 'i'=1..n1):
for m from n1 by -1 to 1 do:
k:=k+1:T[k]:=s1-x[m]:
od:
n2:=sum('length(T[j])', 'j'=1..n1):s2:=0:
for u from 1 to n1 do:
s2:=s2+ T[u]*10^(n2-length(T[u])):n2:=n2-length(T[u]):
od:
if type(s2, prime)=true
then
printf(`%d, `, p):
else
fi:
od:
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Michel Lagneau, Apr 08 2014
STATUS
approved