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!)
A052034 Primes such that the sum of the squares of their digits is also a prime. 17
11, 23, 41, 61, 83, 101, 113, 131, 137, 173, 179, 191, 197, 199, 223, 229, 311, 313, 317, 331, 337, 353, 373, 379, 397, 401, 409, 443, 449, 461, 463, 467, 601, 641, 643, 647, 661, 683, 719, 733, 739, 773, 797, 829, 863, 883, 911, 919, 937, 971, 977, 991, 997, 1013 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
Primes p such that the sum of the squared digits of p is a prime q. For the values of q see A109181.
REFERENCES
Clifford A. Pickover, A Passion for Mathematics, John Wiley & Sons, Inc., 2005, p. 89.
Charles W. Trigg, Journal of Recreational Mathematics, Vol. 20(2), 1988.
LINKS
Mike Mudge, Morph code, Hands On Numbers Count, Personal Computer World, May 1997, p. 290.
EXAMPLE
p = 23 is in the sequence because q = 2^2 + 3^2 = 13 is a prime.
9431 -> 9^2 + 4^2 + 3^2 + 1^2 = 107 (which is prime).
MAPLE
a:=proc(n) local nn, L: nn:=convert(n, base, 10): L:=nops(nn): if isprime(n)= true and isprime(add(nn[j]^2, j=1..L))=true then n else end if end proc: seq(a(n), n=1..1000); # Emeric Deutsch, Jan 08 2008
MATHEMATICA
Select[Prime[Range[250]], PrimeQ[Total[IntegerDigits[#]^2]]&] (* Harvey P. Dale, Dec 19 2010 *)
PROG
(Python)
from sympy import isprime, primerange
def ok(p): return isprime(sum(int(d)**2 for d in str(p)))
def aupto(limit): return [p for p in primerange(1, limit+1) if ok(p)]
print(aupto(1013)) # Michael S. Branicky, Nov 23 2021
CROSSREFS
Sequence in context: A094376 A086524 A060915 * A077041 A190797 A068842
KEYWORD
nonn,base
AUTHOR
Patrick De Geest, Dec 15 1999
EXTENSIONS
Edited by N. J. A. Sloane, Dec 15 2007 and again on Dec 05 2008 at the suggestion of Zak Seidov
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 April 24 22:17 EDT 2024. Contains 371964 sequences. (Running on oeis4.)