login
Least prime p of a quartet of 4 distinct primes {p, p+2, q, q+2} such that each digit of q is the same as the corresponding digit of p except that each 6 in p corresponds to a 9 in q and vice versa.
0

%I #16 May 17 2022 01:52:00

%S 1061,1667,14561,16691,17657,19961,36341,55631,56207,60167,60917,

%T 61151,62981,64151,67577,68711,68897,69737,76367,76961,79691,90617,

%U 92681,96737,98867,100361,106451,115601,136397,136991,139367,139661,146057,155861,156677,165047,167267,167861,186647

%N Least prime p of a quartet of 4 distinct primes {p, p+2, q, q+2} such that each digit of q is the same as the corresponding digit of p except that each 6 in p corresponds to a 9 in q and vice versa.

%e 16691 and 16693 are twin primes, as are 19961 and 19963, so 16691 is a term.

%o (PARI) f(d) = my(ok=0); for (i=1, #d, if (d[i]==6, ok=1; d[i]=9, if (d[i]==9, d[i]=6))); if (ok, fromdigits(d));

%o isok(p) = {if (isprime(p) && isprime(p+2), my(q=f(digits(p))); isprime(q) && isprime(q+2););} \\ _Michel Marcus_, May 16 2022

%Y Subsequence of A001359.

%K base,nonn

%O 1,1

%A _Pierre CAMI_, Sep 23 2006

%E Corrected and extended by _Michel Marcus_, May 16 2022