OFFSET
1,1
COMMENTS
For k = 1, 2, and 3 see A176179
REFERENCES
Charles W. Trigg, Journal of Recreational Mathematics, Vol. 20(2), 1988.
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..1000
Mike Mudge, Morph code, Hands On Numbers Count, Personal Computer World, May 1997, p. 290.
EXAMPLE
For the prime number n=14549 we obtain :
1 + 4 + 5 + 4 + 9 = 23 ;
1^2 +4^2 + 5^2 +4^2 + 9^2 = 139 ;
1^3 +4^3 + 5^3 +4^3 + 9^3 = 983 ;
1^4 +4^4 + 5^4 +4^4 + 9^4 = 7699 ;
MAPLE
with(numtheory):for n from 2 to 20000 do:l:=evalf(floor(ilog10(n))+1):n0:=n:s1:=0:s2:=0:s3:=0:s4:=0:for m from 1 to l do:q:=n0:u:=irem(q, 10):v:=iquo(q, 10):n0:=v :s1:=s1+u:s2:=s2+u^2:s3:=s3+u^3:s4:=s4+u^4:od:if type(n, prime)=true and type(s1, prime)=true and type(s2, prime)=true and type(s3, prime)=true and type(s4, prime)=true then print(n):else fi:od:
MATHEMATICA
Select[Prime[Range[1000]], And@@PrimeQ[Total/@Table[IntegerDigits[#]^n, {n, 4}]]&] (* Harvey P. Dale, Jun 16 2013 *)
PROG
(Python)
from sympy import isprime, primerange
def ok(p):
return all(isprime(sum(int(d)**k for d in str(p))) for k in range(1, 5))
def aupto(limit): return [p for p in primerange(1, limit+1) if ok(p)]
print(aupto(7443)) # Michael S. Branicky, Nov 23 2021
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Michel Lagneau, Apr 11 2010
STATUS
approved