OFFSET
1,1
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 1..10000
EXAMPLE
43 is a member of this sequence because 43 is prime and 4^4 + 3^3 = 256 + 27 = 283 is also prime.
263 is a member of this sequence because 263 is prime and 2^2 + 6^6 + 3^3 = 4 + 46656 + 27 = 46687 is also prime.
PROG
(Python)
from sympy import isprime, primerange
def Pow(n):
s = 0
for i in str(n):
k = int(i)
if k:
s += k**k
return s
{print(pn, end=', ') for pn in primerange(1, 2000) if isprime(Pow(pn))}
## Simplified by Derek Orr, Apr 05 2015
(PARI) sdiz(n) = {digs = digits(n); sum(i=1, #digs, if (digs[i], digs[i]^digs[i], 0)); }
lista(nn) = {forprime(n=1, nn, if (isprime(sdiz(n)), print1(n, ", "))); } \\ Michel Marcus, Nov 21 2013
(PARI)
has(n)=ispseudoprime(vecsum([x^x|x<-digits(n), x]))
select(has, primes(1000)) \\ Charles R Greathouse IV, Nov 21 2013
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Derek Orr, Nov 19 2013
STATUS
approved