OFFSET
1,1
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
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..10000
EXAMPLE
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.
PROG
(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
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Gonzalo MartÃnez, Mar 29 2024
STATUS
approved