OFFSET
1,1
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..55
EXAMPLE
a(6) = 142 because 1^42+14^2 = 197, which is prime.
MATHEMATICA
lst = {}; Do[ If[ Min@ IntegerDigits@n > 0, a=0; p=10; While[(w = Floor[n/p]) > 0, a += w^ Mod[n, p]; p*=10]; If[PrimeQ[a], Print[{n, a}]; AppendTo[lst, n]]], {n, 11, 9999}]; lst
PROG
(Python)
from sympy import isprime
from itertools import count, islice, product
def agen():
for d in count(2):
for p in product("123456789", repeat=d):
s = "".join(p)
if isprime(sum(int(s[:i])**int(s[i:]) for i in range(1, d))):
yield int(s)
print(list(islice(agen(), 44))) # Michael S. Branicky, Jun 27 2022
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Ray G. Opao, Jan 18 2006
EXTENSIONS
More terms from Giovanni Resta, Jan 19 2006
More terms from Robert G. Wilson v, Apr 27 2006
a(47) and beyond from Michael S. Branicky, Jun 27 2022
STATUS
approved