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.

Original entry on oeis.org

22, 202, 6934, 634, 109678, 445294, 2323138
Offset: 0

Views

Author

J.W.L. (Jan) Eerland, Oct 10 2024

Keywords

Comments

a(7) > 46472.
a(7) > 2*10^7. - Michael S. Branicky, Nov 09 2024

Crossrefs

Programs

  • Mathematica
    Table[m = 3;
     k = 0; Monitor[
      Parallelize[
       While[True,
        If[And[PrimeQ[m^((m + 1)*m^n) - k],
          PrimeQ[((m^((m + 1)*m^n) - k) - 1)/2]], Break[]]; k++]; k],
      k], {n, 0, 5}]
  • PARI
    a(n) = {my(k=0); while (!(isprime(p=3^(4*3^n) - k) && isprime((p-1)/2)), k++); k;}
    
  • Python
    from sympy import isprime, prevprime
    def A(n):
        m = 3**(4*3**n)
        p = prevprime(m)
        while not isprime((p-1)//2):
            p = prevprime(p)
        return m-p #