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!)
A372629 Prime numbers whose sum of digits is a palindrome. 1
2, 3, 5, 7, 11, 13, 17, 23, 29, 31, 41, 43, 47, 53, 61, 71, 83, 101, 103, 107, 113, 131, 137, 151, 173, 191, 211, 223, 227, 233, 241, 251, 263, 281, 311, 313, 317, 331, 353, 401, 421, 431, 443, 461, 499, 503, 521, 601, 641, 701, 769, 787, 821, 859, 877, 911, 967, 1013, 1019, 1021, 1031, 1033, 1051 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
LINKS
EXAMPLE
2411 is a term (prime, and digits sum to 8, a palindrome);
9931 is a term (prime, and digits sum to 22, a palindrome);
10099997 is a term (prime, and digits sum to 44).
PROG
(Python)
import sympy
def sum_of_digits(n):
return sum(int(digit) for digit in str(n))
def is_palindrome(n):
return str(n) == str(n)[::-1]
# Find prime numbers between 1 and 10000 whose sum of digits is a palindrome
prime_palindrome_numbers = []
for num in range(1, 10000):
if sympy.isprime(num):
digit_sum = sum_of_digits(num)
if is_palindrome(digit_sum):
prime_palindrome_numbers.append(num)
print(prime_palindrome_numbers)
(Common LISP -- see link)
CROSSREFS
Sequence in context: A194954 A344384 A299956 * A368732 A192503 A040067
KEYWORD
nonn,base,less
AUTHOR
James S. DeArmon, May 07 2024
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 August 30 16:34 EDT 2024. Contains 375545 sequences. (Running on oeis4.)