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.

A376946 Smallest k such that 3^(4*3^n) - k is a safe prime.

This page as a plain text file.
%I A376946 #17 Nov 09 2024 11:54:53
%S A376946 22,202,6934,634,109678,445294,2323138
%N A376946 Smallest k such that 3^(4*3^n) - k is a safe prime.
%C A376946 a(7) > 46472.
%C A376946 a(7) > 2*10^7. - _Michael S. Branicky_, Nov 09 2024
%t A376946 Table[m = 3;
%t A376946  k = 0; Monitor[
%t A376946   Parallelize[
%t A376946    While[True,
%t A376946     If[And[PrimeQ[m^((m + 1)*m^n) - k],
%t A376946       PrimeQ[((m^((m + 1)*m^n) - k) - 1)/2]], Break[]]; k++]; k],
%t A376946   k], {n, 0, 5}]
%o A376946 (PARI) a(n) = {my(k=0); while (!(isprime(p=3^(4*3^n) - k) && isprime((p-1)/2)), k++); k;}
%o A376946 (Python)
%o A376946 from sympy import isprime, prevprime
%o A376946 def A(n):
%o A376946     m = 3**(4*3**n)
%o A376946     p = prevprime(m)
%o A376946     while not isprime((p-1)//2):
%o A376946         p = prevprime(p)
%o A376946     return m-p #
%Y A376946 Cf. A005385, A057821, A181356, A335313.
%K A376946 nonn,more
%O A376946 0,1
%A A376946 _J.W.L. (Jan) Eerland_, Oct 10 2024