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!)
A076161 Numbers n such that n + sum of squares of digits of n (A258881) is a prime. 4

%I #21 Feb 01 2021 18:14:29

%S 1,10,11,12,13,14,15,16,17,18,19,31,34,57,73,74,75,78,91,94,97,100,

%T 101,102,103,105,107,108,109,121,122,123,126,127,128,140,142,146,148,

%U 160,161,165,166,168,182,183,188,213,216,217,234,251,275,277,297,301

%N Numbers n such that n + sum of squares of digits of n (A258881) is a prime.

%H Robert Israel, <a href="/A076161/b076161.txt">Table of n, a(n) for n = 1..10000</a>

%e 12 is a term because 12+(1^2+2^2) = 17 is a prime.

%p filter:= proc(n) local t; isprime(n+add(t^2,t=convert(n,base,10))) end proc:

%p select(filter, [$1..1000]); # _Robert Israel_, Jan 30 2021

%o (Python)

%o from sympy import isprime

%o def ssd(n): return sum(int(d)**2 for d in str(n))

%o def ok(n): return isprime(n + ssd(n))

%o def aupto(limit): return [m for m in range(1, limit+1) if ok(m)]

%o print(aupto(301)) # _Michael S. Branicky_, Jan 30 2021

%o (PARI) isok(n) = isprime(n + norml2(digits(n))); \\ _Michel Marcus_, Jan 31 2021

%Y Cf. A258881, A259391, A259567.

%K nonn,base

%O 1,2

%A _Zak Seidov_, Nov 01 2002

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 19 12:14 EDT 2024. Contains 371792 sequences. (Running on oeis4.)