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.

A371623 Sophie Germain primes p whose corresponding safe prime is an anagram of p.

Original entry on oeis.org

10529, 12959, 32561, 129509, 326159, 1632509, 2653109, 2956301, 3105269, 3126509, 3250619, 3260501, 3578741, 10002959, 10530269, 13296509, 15263009, 15326099, 15630299, 18747593, 18795743, 19475873, 19963259, 25060319, 25099631, 25301609, 26031959, 26095031
Offset: 1

Views

Author

Gonzalo Martínez, Mar 29 2024

Keywords

Comments

Subsequence of A005384, where p and 2p+1 are both primes and 2p+1 is a permutation of the digits of p. The smallest integer with the property is 10529, which is the 198th Sophie Germain prime, which in turn corresponds to A000040(1287).
Terms cannot begin with decimal digits 5-9, else 2*p+1 has more digits and cannot be an anagram. - Michael S. Branicky, Apr 23 2024

Examples

			12959 is a term since it is a prime number such that 2*12959 + 1 = 25919 is also prime, where 25919 is a permutation of the digits of 12959.
		

Crossrefs

Programs

  • PARI
    forprime(p=2, 10^7, if(ispseudoprime(2*p+1) && (vecsort(digits(p)) ==  vecsort(digits(2*p+1))), print1(p, ", "))) \\ Michel Marcus, Mar 30 2024
    
  • Python
    from itertools import count, islice
    from sympy import nextprime
    def A371623_gen(startvalue=1): # generator of terms >= startvalue
        p = max(startvalue-1,0)
        while (p:=nextprime(p)):
            if isprime(q:=p<<1|1) and sorted(str(p))==sorted(str(q)):
                yield p
    A371623_list = list(islice(A371623_gen(),10)) # Chai Wah Wu, Apr 22 2024