cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A176196 Primes such that the sum of k-th powers of digits, for each of k = 1, 2, 3, and 4, is also a prime.

This page as a plain text file.
%I A176196 #15 Nov 23 2021 15:59:03
%S A176196 11,101,113,131,223,311,353,461,641,661,883,1013,1031,1103,1301,1439,
%T A176196 1451,1471,1493,1697,1741,2111,2203,3011,3347,3491,3659,4139,4337,
%U A176196 4373,4391,4733,4931,5303,5639,5693,6197,6359,6719,6791,6917,6971,7411,7433
%N A176196 Primes such that the sum of k-th powers of digits, for each of k = 1, 2, 3, and 4, is also a prime.
%C A176196 For k = 1, 2, and 3 see A176179
%D A176196 Charles W. Trigg, Journal of Recreational Mathematics, Vol. 20(2), 1988.
%H A176196 Harvey P. Dale, <a href="/A176196/b176196.txt">Table of n, a(n) for n = 1..1000</a>
%H A176196 Mike Mudge, <a href="https://archive.org/details/PersonalComputerWorldMagazine/PCW%20199705%20May%20Created%20From%20PCW%20Cover%20CD/page/n121/mode/1up?view=theater">Morph code</a>, Hands On Numbers Count, Personal Computer World, May 1997, p. 290.
%e A176196 For the prime number n=14549 we obtain :
%e A176196 1 + 4 + 5 + 4 + 9 = 23 ;
%e A176196 1^2 +4^2 + 5^2 +4^2 + 9^2 = 139 ;
%e A176196 1^3 +4^3 + 5^3 +4^3 + 9^3 = 983 ;
%e A176196 1^4 +4^4 + 5^4 +4^4 + 9^4 = 7699 ;
%p A176196 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:
%t A176196 Select[Prime[Range[1000]],And@@PrimeQ[Total/@Table[IntegerDigits[#]^n,{n,4}]]&] (* _Harvey P. Dale_, Jun 16 2013 *)
%o A176196 (Python)
%o A176196 from sympy import isprime, primerange
%o A176196 def ok(p):
%o A176196     return all(isprime(sum(int(d)**k for d in str(p))) for k in range(1, 5))
%o A176196 def aupto(limit): return [p for p in primerange(1, limit+1) if ok(p)]
%o A176196 print(aupto(7443)) # _Michael S. Branicky_, Nov 23 2021
%Y A176196 Cf. A176179, A109181, A046704, A052034, A091366.
%K A176196 nonn,base
%O A176196 1,1
%A A176196 _Michel Lagneau_, Apr 11 2010