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.

Showing 1-1 of 1 results.

A372141 Primes p that are palindromic in some prime base q, where q < p.

Original entry on oeis.org

3, 5, 7, 13, 17, 23, 31, 41, 67, 71, 73, 83, 107, 109, 127, 151, 157, 173, 199, 233, 257, 271, 277, 307, 313, 353, 379, 409, 419, 421, 431, 443, 457, 499, 521, 523, 571, 587, 599, 601, 631, 643, 647, 653, 691, 701, 709, 719, 733, 743, 757, 787, 797, 809, 823, 829, 857, 863, 887
Offset: 1

Views

Author

Tadayoshi Kamegai, Apr 20 2024

Keywords

Comments

If we remove either constraint of q < p or q being prime, then the sequence would be all prime numbers (A000040).
By definition it is a superset of A016041, and is a proper superset by construction (e.g., 13 is in the sequence).
Some terms have multiple bases that yield palindromic representations, the first being 31 (which is palindromic in both base 2 and base 5). The smallest prime p such that there exist n distinct primes less than p that give palindromic representations of p is A372142(n).

Examples

			11 is not in this sequence as its representation in base 2 is 1011, in base 3 is 102, in base 5 is 21, in base 7 is 14, none of which are palindromic.
1483 is in this sequence as its representation in base 37 is 131, which is palindromic.
		

Crossrefs

Programs

  • Mathematica
    a={}; For[i=1, i<=155, i++, flag=0; For[j=1, Prime[j] < Prime[i] && flag==0, j++, If[PalindromeQ[IntegerDigits[Prime[i], Prime[j]]], flag=1; AppendTo[a, Prime[i]]]]]; a (* Stefano Spezia, Apr 22 2024 *)
  • Python
    from sympy import sieve
    from sympy.ntheory import digits
    from itertools import islice
    def ispal(v): return v == v[::-1]
    def agen(): yield from (p for p in sieve if any(ispal(digits(p, q)[1:]) for q in sieve.primerange(1, p)))
    print(list(islice(agen(), 60))) # Michael S. Branicky, Apr 20 2024
Showing 1-1 of 1 results.