cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A372629 Prime numbers whose sum of digits is a palindrome.

This page as a plain text file.
%I A372629 #29 Jun 01 2025 16:19:46
%S A372629 2,3,5,7,11,13,17,23,29,31,41,43,47,53,61,71,83,101,103,107,113,131,
%T A372629 137,151,173,191,211,223,227,233,241,251,263,281,311,313,317,331,353,
%U A372629 401,421,431,443,461,499,503,521,601,641,701,769,787,821,859,877,911,967,1013,1019,1021,1031,1033,1051
%N A372629 Prime numbers whose sum of digits is a palindrome.
%H A372629 Paolo Xausa, <a href="/A372629/b372629.txt">Table of n, a(n) for n = 1..10000</a> (terms 1..999 from James S. DeArmon)
%H A372629 James S. DeArmon, <a href="/A372629/a372629.txt">Common LISP code for A372629</a>
%e A372629 2411 is a term (prime, and digits sum to 8, a palindrome);
%e A372629 9931 is a term (prime, and digits sum to 22, a palindrome);
%e A372629 10099997 is a term (prime, and digits sum to 44).
%t A372629 Select[Prime[Range[200]], PalindromeQ[DigitSum[#]] &] (* _Paolo Xausa_, Feb 27 2025 *)
%o A372629 (Python)
%o A372629 import sympy
%o A372629 def sum_of_digits(n):
%o A372629     return sum(int(digit) for digit in str(n))
%o A372629 def is_palindrome(n):
%o A372629     return str(n) == str(n)[::-1]
%o A372629 # Find prime numbers between 1 and 10000 whose sum of digits is a palindrome
%o A372629 prime_palindrome_numbers = []
%o A372629 for num in range(1,10000):
%o A372629     if sympy.isprime(num):
%o A372629         digit_sum = sum_of_digits(num)
%o A372629         if is_palindrome(digit_sum):
%o A372629             prime_palindrome_numbers.append(num)
%o A372629 print(prime_palindrome_numbers)
%o A372629 (Common Lisp) ; See Links section.
%Y A372629 Cf. A002385, A007500, A033620.
%K A372629 nonn,base,less
%O A372629 1,1
%A A372629 _James S. DeArmon_, May 07 2024