OFFSET
1,1
EXAMPLE
1583 is in the sequence because :
1 + 5^2 + 8^3 + 3^4 = 619 and 1^4 + 5^3 + 8^2 + 3^1 = 193 are prime numbers.
MAPLE
with(numtheory):for n from 1 to 1000 do:l:=length(n):n0:=n:s1:=0:s2:=0:for
m from 1 to l do:q:=n0:u:=irem(q, 10):v:=iquo(q, 10):n0:=v :s1:=s1+u^(l-m+1):s2:=s2+u^m:od:
if type(s1, prime)=true and type(s2, prime)=true then printf(`%d, `, n):else fi:od:
MATHEMATICA
okQ[n_] := Module[{d=IntegerDigits[n], r}, r=Length[d]; PrimeQ[Total[d^Range[r]]] && PrimeQ[Total[d^Range[r, 1, -1]]]]; Select[Range[1000], okQ]
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Michel Lagneau, Dec 21 2010
STATUS
approved
