login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A076161
Numbers n such that n + sum of squares of digits of n (A258881) is a prime.
4
1, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 31, 34, 57, 73, 74, 75, 78, 91, 94, 97, 100, 101, 102, 103, 105, 107, 108, 109, 121, 122, 123, 126, 127, 128, 140, 142, 146, 148, 160, 161, 165, 166, 168, 182, 183, 188, 213, 216, 217, 234, 251, 275, 277, 297, 301
OFFSET
1,2
LINKS
EXAMPLE
12 is a term because 12+(1^2+2^2) = 17 is a prime.
MAPLE
filter:= proc(n) local t; isprime(n+add(t^2, t=convert(n, base, 10))) end proc:
select(filter, [$1..1000]); # Robert Israel, Jan 30 2021
PROG
(Python)
from sympy import isprime
def ssd(n): return sum(int(d)**2 for d in str(n))
def ok(n): return isprime(n + ssd(n))
def aupto(limit): return [m for m in range(1, limit+1) if ok(m)]
print(aupto(301)) # Michael S. Branicky, Jan 30 2021
(PARI) isok(n) = isprime(n + norml2(digits(n))); \\ Michel Marcus, Jan 31 2021
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Zak Seidov, Nov 01 2002
STATUS
approved