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.

A176179 Primes such that the sum of digits, the sum of the squares of digits and the sum of 3rd powers of their digits is also a prime.

This page as a plain text file.
%I A176179 #15 Nov 23 2021 15:58:43
%S A176179 11,101,113,131,199,223,311,337,353,373,449,461,463,641,643,661,733,
%T A176179 829,883,919,991,1013,1031,1103,1301,1439,1451,1471,1493,1499,1697,
%U A176179 1741,1949,2089,2111,2203,2333,2441,2557,3011,3037,3307,3323,3347,3491,3583,3637,3659,3673,3853,4049,4111,4139,4241,4337,4373,4391,4409
%N A176179 Primes such that the sum of digits, the sum of the squares of digits and the sum of 3rd powers of their digits is also a prime.
%C A176179 See A091365 for the exceptions for the case where the sum of the digits of p is not prime, but the sum of the cubes of the digits of p is prime.
%D A176179 Charles W. Trigg, Journal of Recreational Mathematics, Vol. 20(2), 1988.
%H A176179 Michael S. Branicky, <a href="/A176179/b176179.txt">Table of n, a(n) for n = 1..10000</a>
%H A176179 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 A176179 For the prime number n =5693 we obtain :
%e A176179 5 + 6 + 9 + 3 = 23 ;
%e A176179 5^2 + 6^2 + 9^2 + 3^2 = 151 ;
%e A176179 5^3 + 6^3 + 9^3 + 3^3 = 1097.
%p A176179 with(numtheory):for n from 2 to 10000 do:l:=evalf(floor(ilog10(n))+1):n0:=n:s1:=0:s2:=0:s3:=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:od:if type(n,prime)=true and type(s1,prime)=true and type(s2,prime)=true and type(s3,prime)=true then print(n):else fi:od:
%t A176179 okQ[n_]:=Module[{idn=IntegerDigits[n]}, And@@PrimeQ[Total/@{idn,idn^2,idn^3}]]; Select[Prime[Range[600]],okQ]  (* _Harvey P. Dale_, Jan 18 2011 *)
%o A176179 (Python)
%o A176179 from sympy import isprime, primerange
%o A176179 def ok(p):
%o A176179     return all(isprime(sum(int(d)**k for d in str(p))) for k in [1, 2, 3])
%o A176179 def aupto(limit): return [p for p in primerange(1, limit+1) if ok(p)]
%o A176179 print(aupto(4409)) # _Michael S. Branicky_, Nov 23 2021
%Y A176179 Cf. A109181, A046704, A052034, A091366.
%K A176179 nonn,base
%O A176179 1,1
%A A176179 _Michel Lagneau_, Apr 10 2010
%E A176179 Corrected and extended by _Harvey P. Dale_, Jan 18 2011