A229222 Smallest prime p such that p contains a digit larger than 1 and the sum of the n-th powers of the decimal digits of p is a prime number.
2, 23, 113, 23, 191, 223, 191, 41, 223, 113, 157, 191, 137, 113, 113, 43, 137, 191, 179, 337, 577, 223, 227, 113, 263, 113, 199, 229, 263, 199, 467, 89, 223, 179, 223, 113, 443, 683, 1279, 337, 661, 463, 827, 2281, 577, 223, 223, 661, 137, 229, 11399, 461, 577
Offset: 1
Examples
a(3) = 113 because 1^3+1^3+3^3 = 29 is prime.
Links
- Michel Lagneau, Table of n, a(n) for n = 1..500
Crossrefs
Cf. A020449.
Programs
-
Maple
with(numtheory) :lst:={11, 101, 101111, 10011101, 10101101, 10110011, 10111001, 11000111, 11100101, 11110111, 11111101 }:for n from 1 to 300 do :ii:=0:for k from 1 to 10^8 while(ii=0) do:x:=convert(k,base,10):n1:=nops(x):it:=0:jj:=0:s:= sum('x[i]^n', 'i'=1..n1):lst1:={k} intersect lst:if type(k,prime)=true and type(s,prime)=true and (lst1<>{k}) then ii:=1: printf(`%d, `,k):else fi:od:od:
-
Mathematica
Table[p = 2; While[d = IntegerDigits[p]; Union[d][[-1]] < 2 || ! PrimeQ[Total[d^n]], p = NextPrime[p]]; p, {n, 60}]
-
PARI
a(n)=forprime(p=2,,my(d=digits(p)); if(vecmax(d)>1 && isprime(sum(i=1,#d,d[i]^n)), return(p))) \\ Charles R Greathouse IV, Sep 19 2013
Comments