login
Least n-digit prime in base 12 that is a member of twin prime pair and also either a Sophie Germain prime or a safe prime.
0

%I #15 Aug 04 2024 03:00:49

%S 3,29,179,1931,20771,248867,2986349,35833079,429983039,5159780471,

%T 61917366011,743008372451,8916100451231,106993205386139,

%U 1283918464561721,15407021574604589,184884258895077527,2218611106740456359,26623333280885245319,319479999370622955167,3833759992447475131451

%N Least n-digit prime in base 12 that is a member of twin prime pair and also either a Sophie Germain prime or a safe prime.

%C Let X be 10 and E be 11 in base 12. In base 12, all primes greater than 3 end in the digits 1,5,7,E. All twin primes (p,q) with p>3 end in the digits (5,7) or (E,1). All Sophie Germain primes of type 1 end in the digit 5 or E. A Cunningham chain of type 1 starts with a 5-prime or E-prime and all subsequent primes are E-primes. The sequence in base 12 is "3", "25", "12E", "114E", "1002E", "10002E", "1000265", "1000089E", "10000093E", "100000009E", "1000000104E", "10000000102E", "100000000187E", "1000000000410E", "100000000007535", "100000000000X665", "1000000000001E95E", "10000000000000E25E", "100000000000000099E", "1000000000000001447E", "10000000000000000544E", "100000000000000002797E", "1000000000000000000872E", "10000000000000000006806E".

%e 29 is 25 in base 12 and is the first two digit prime that is twin prime (31 = 27 is its companion) and Sophie Germain prime, since 2*29+1 = 59 = 4E is prime.

%p istwin := proc(p::prime) isprime(p-2) or isprime(p+2) end: issophie := proc(p::prime) isprime(2*p+1) or isprime((p-1)/2) end: L:=[]: for w to 1 do for n from 1 to 24 do p:=nextprime(12^(n-1)); while not (istwin(p) and issophie(p)) do p:=nextprime(p) od; L:=[op(L),p]; od; od; L;

%t a[n_] := Module[{p = NextPrime[12^(n-1)]}, While[!Or @@ PrimeQ[p + {-2, 2}] || !Or @@ PrimeQ[{(p-1)/2, 2*p+1}], p = NextPrime[p]]; p]; Array[a, 25] (* _Amiram Eldar_, Aug 04 2024 *)

%Y Cf. A001359, A006512, A005384, A005385, A118479.

%K easy,nonn,base

%O 1,1

%A _Walter Kehowski_, May 17 2006

%E Name corrected and a(18)-a(21) added by _Amiram Eldar_, Aug 04 2024