Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #13 Nov 14 2024 08:23:28
%S 5,437,13709,40169,574133
%N Smallest k such that 4^(5*4^n) - k is a safe prime.
%C a(5) > 2*10^7. - _Michael S. Branicky_, Nov 09 2024
%t Table[m = 4;
%t k = 0; Monitor[
%t Parallelize[
%t While[True,
%t If[And[PrimeQ[m^((m + 1)*m^n) - k],
%t PrimeQ[((m^((m + 1)*m^n) - k) - 1)/2]], Break[]]; k++]; k],k], {n, 0, 5}]
%o (PARI) a(n) = {my(k=0); while (!(isprime(p=4^(5*4^n) - k) && isprime((p-1)/2)), k++); k;}
%o (Python)
%o from sympy import isprime, prevprime
%o def A(n):
%o m = 4**(5*4**n)
%o p = prevprime(m)
%o while not isprime((p-1)//2):
%o p = prevprime(p)
%o return m-p #
%Y Cf. A005385, A057821, A181356, A335313, A376946.
%K nonn,more
%O 0,1
%A _J.W.L. (Jan) Eerland_, Nov 05 2024