OFFSET
1,1
COMMENTS
The number must contain a 0 in its decimal representation. If not, the number is divisible by n.
LINKS
Giovanni Resta, Table of n, a(n) for n = 1..10000
EXAMPLE
20^2 + 20^0 = 401 is prime so 20 is a member of this sequence.
308^3 + 308^0 + 308^8 = 80985213602898040129 is prime so 308 is a member of this sequence.
MAPLE
q:= n-> isprime(add(n^i, i=convert(n, base, 10))):
select(q, [$1..6000])[]; # Alois P. Heinz, Apr 02 2023
MATHEMATICA
Select[Range[5000], PrimeQ@ Total[#^IntegerDigits[#]] &] (* Giovanni Resta, Mar 13 2014 *)
PROG
(Python)
import sympy
from sympy import isprime
def PowOpp(x):
..if str(x).find('0') > -1:
....num = 0
....for i in str(x):
......num += x**int(i)
....if isprime(num):
......return True
x = 1
while x < 10**4:
..if PowOpp(x):
....print(x)
..x += 1
(Python)
from itertools import count, islice
from sympy import isprime
def A239237_gen(startvalue=1): # generator of terms >= startvalue
return filter(lambda n:'0' in (s:=str(n)) and isprime(sum(s.count(d)*n**int(d) for d in set(s))), count(max(1, startvalue)))
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Derek Orr, Mar 13 2014
STATUS
approved