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!)
A048528 Primes expressible in two ways as the sum of an integer and its digit sum. 2

%I #23 Apr 28 2023 08:17:51

%S 101,103,107,109,113,307,311,313,317,509,521,709,719,911,919,1009,

%T 1013,1213,1217,1409,1607,1609,1613,1619,1621,1811,1823,2017,2027,

%U 2111,2113,2309,2311,2521,2711,2713,2719,2917,2927,3011,3209,3217,3221,3407,3413,3613,3617,3623

%N Primes expressible in two ways as the sum of an integer and its digit sum.

%H Delbert L. Johnson, <a href="/A048528/b048528.txt">Table of n, a(n) for n = 1..20000</a>

%e 313 = 296 + (2+9+6) and 313 = 305 + (3+0+5).

%t Transpose[Select[Tally[Select[#+Total[IntegerDigits[#]]&/@ Range[ 5000], PrimeQ]],#[[2]]==2&]][[1]] (* _Harvey P. Dale_, May 09 2013 *)

%o (Python)

%o from collections import Counter

%o from sympy import isprime

%o def a_list(upto):

%o return [i for i, j in Counter([i+sum(map(int, str(i))) for i in range(upto)]).items() if j>1 and isprime(i)]

%o print(a_list(4000)) # _Nicholas Stefan Georgescu_, Mar 02 2023

%Y Cf. A047791, A048521.

%K nonn,base,nice

%O 1,1

%A _Patrick De Geest_, May 15 1999

%E Corrected and extended by _Harvey P. Dale_, May 09 2013

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 September 16 15:05 EDT 2024. Contains 375976 sequences. (Running on oeis4.)