login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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))):
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)))
A239237_list = list(islice(A239237_gen(), 20)) # Chai Wah Wu, Apr 02 2023
CROSSREFS
Cf. A239236.
Subsequence of A011540.
Sequence in context: A250107 A038693 A217318 * A018990 A280882 A335802
KEYWORD
nonn,base
AUTHOR
Derek Orr, Mar 13 2014
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified September 17 04:31 EDT 2024. Contains 375985 sequences. (Running on oeis4.)