|
|
A239237
|
|
Numbers n such that n^d_1 + n^d_2 + ... n^d_k is prime where d_i is the i-th digit in the decimal representation of n.
|
|
3
|
|
|
10, 20, 203, 230, 308, 309, 330, 350, 503, 603, 650, 960, 1068, 1110, 1206, 1350, 1404, 1480, 1730, 1802, 1860, 1910, 2032, 2038, 2044, 2054, 2250, 2320, 2502, 3044, 3082, 3402, 3970, 4032, 4046, 4072, 4120, 4340, 4450, 4540, 4650, 4908, 5204, 5310, 5402
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
COMMENTS
|
The number must contain a 0 in its decimal representation. If not, the number is divisible by n.
|
|
LINKS
|
|
|
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))):
|
|
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
|
|
|
STATUS
|
approved
|
|
|
|