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.

This page as a plain text file.
%I A371623 #19 Apr 24 2024 03:08:21
%S A371623 10529,12959,32561,129509,326159,1632509,2653109,2956301,3105269,
%T A371623 3126509,3250619,3260501,3578741,10002959,10530269,13296509,15263009,
%U A371623 15326099,15630299,18747593,18795743,19475873,19963259,25060319,25099631,25301609,26031959,26095031
%N A371623 Sophie Germain primes p whose corresponding safe prime is an anagram of p.
%C A371623 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).
%C A371623 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
%H A371623 Michael S. Branicky, <a href="/A371623/b371623.txt">Table of n, a(n) for n = 1..10000</a>
%e A371623 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.
%o A371623 (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
%o A371623 (Python)
%o A371623 from itertools import count, islice
%o A371623 from sympy import nextprime
%o A371623 def A371623_gen(startvalue=1): # generator of terms >= startvalue
%o A371623     p = max(startvalue-1,0)
%o A371623     while (p:=nextprime(p)):
%o A371623         if isprime(q:=p<<1|1) and sorted(str(p))==sorted(str(q)):
%o A371623             yield p
%o A371623 A371623_list = list(islice(A371623_gen(),10)) # _Chai Wah Wu_, Apr 22 2024
%Y A371623 Cf. A000040, A005384, A364142.
%K A371623 nonn,base
%O A371623 1,1
%A A371623 _Gonzalo Martínez_, Mar 29 2024