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.

Showing 1-8 of 8 results.

A181356 Smallest k such that 2^(2^n) - k is a safe prime.

Original entry on oeis.org

5, 29, 269, 209, 1469, 15449, 36113, 38117, 1093337, 1942289, 10895177, 43644929, 364486013, 718982153, 2356107437
Offset: 2

Views

Author

Ken Takusagawa, Jan 27 2011

Keywords

Comments

These numbers are useful as Diffie-Hellman moduli.

Examples

			a(2)=5 because 2^(2^2) - 5 = 11 is the largest safe prime less than 16.
		

Crossrefs

Programs

  • PARI
    a(n) = {k = 1; pow2 = 2^(2^n); while (! (isprime(pow2 - k) && isprime((pow2 - k - 1)/2)), k +=2;); k;} \\ Michel Marcus, Aug 16 2013

Extensions

a(14) from Ken Takusagawa, May 31 2011
a(15) from Gary Barnes, Oct 26 2011
a(16) from Mark Andreas, Jan 23 2023

A140331 Smallest k such that 3^(3^n) - k is prime.

Original entry on oeis.org

1, 4, 2, 26, 10, 466, 506, 128, 13342, 5974, 8410, 6470
Offset: 0

Views

Author

Jonathan Vos Post, May 26 2008

Keywords

Comments

This is to 3 as A058220 is to 2.

Examples

			a(4) = 10 because 3^(3^4) - 10 = 443426488243037769948249630619149892793 is prime.
		

Crossrefs

Cf. A055777 (3^(3^n)), A058220.

Programs

  • PARI
    a(n) = x = 3^(3^n); x - precprime(x); \\ Michel Marcus, Jan 28 2015

Formula

a(n) = A064722(A055777(n)). - Michel Marcus, Jan 28 2015

Extensions

a(5)-a(8) from Cino Hilliard, Jun 02 2008
a(9)-a(10) from Donovan Johnson, Sep 13 2008
a(0) prepended and a(11) from Michael S. Branicky, Aug 23 2024

A364452 Smallest k such that 4^(4^n) - k is prime.

Original entry on oeis.org

1, 5, 5, 159, 569, 1557, 2439, 25353, 24317, 164073
Offset: 0

Views

Author

J.W.L. (Jan) Eerland, Jul 25 2023

Keywords

Comments

This is to 4 as A058220 is to 2 and A140331 is to 3.
a(8) > 22174.

Examples

			a(2) = 5 because 4^(4^2) - 5 = 4294967291 is prime.
		

Crossrefs

Programs

  • Mathematica
    lst={};Do[Do[p=4^(4^n)-k;If[PrimeQ[p],AppendTo[lst,k];Break[]],{k,2,11!}],{n,7}];lst
    Table[k=1;Monitor[Parallelize[While[True,If[PrimeQ[4^(4^n)-k],Break[]];k++];k],k],{n,1,7}]
    y[n_] := Module[{x = 4^(4^n)}, x - NextPrime[x, -1]]; Array[y, 7]
  • PARI
    a(n) = my(x = 4^(4^n)); x - precprime(x);

Formula

a(n) = A064722(A137840(n)).
a(n) = A058220(2*n+1). - Michael S. Branicky, Aug 23 2024

Extensions

a(8) using search and a(9) using A058220 from Michael S. Branicky, Aug 23 2024
a(0) = 1 prepended by Michael S. Branicky, Apr 20 2025

A364453 Smallest k such that 5^(5^n) - k is prime.

Original entry on oeis.org

2, 4, 64, 124, 228, 10978, 73738, 66346
Offset: 0

Views

Author

J.W.L. (Jan) Eerland, Jul 25 2023

Keywords

Comments

This is to 5 as A058220 is to 2 and A140331 is to 3.
a(7) > 5487.

Examples

			a(2) = 64 because 5^(5^2) - 64 = 298023223876953061 is prime.
		

Crossrefs

Programs

  • Mathematica
    lst={};Do[Do[p=5^(5^n)-k;If[PrimeQ[p],AppendTo[lst,k];Break[]],{k,2,11!}],{n,7}];lst
    Table[k=1;Monitor[Parallelize[While[True,If[PrimeQ[5^(5^n)-k],Break[]];k++];k],k],{n,1,7}]
    y[n_] := Module[{x = 5^(5^n)}, x - NextPrime[x, -1]]; Array[y, 7]
  • PARI
    a(n) = my(x = 5^(5^n)); x - precprime(x);

Formula

a(n) = A064722(A137841(n)).

Extensions

a(0) prepended and a(7) from Michael S. Branicky, Aug 24 2024

A364454 Smallest k such that 6^(6^n) - k is prime.

Original entry on oeis.org

1, 7, 35, 587, 629, 1819, 106843
Offset: 0

Views

Author

J.W.L. (Jan) Eerland, Jul 25 2023

Keywords

Comments

This is to 6 as A058220 is to 2 and A140331 is to 3.

Examples

			a(2) = 35 because 6^(6^2) - 35 = 10314424798490535546171949021 is prime.
		

Crossrefs

Programs

  • Mathematica
    lst={};Do[Do[p=6^(6^n)-k;If[PrimeQ[p],AppendTo[lst,k];Break[]],{k,2,11!}],{n,7}];lst
    Table[k=1;Monitor[Parallelize[While[True,If[PrimeQ[6^(6^n)-k],Break[]];k++];k],k],{n,1,7}]
    y[n_] := Module[{x = 6^(6^n)}, x - NextPrime[x, -1]]; Array[y, 7]
  • PARI
    a(n) = my(x = 6^(6^n)); x - precprime(x);

Extensions

a(6) from Michael S. Branicky, Aug 23 2024
a(0)=1 prepended by Alois P. Heinz, Aug 23 2024

A360080 Smallest k such that 2^(2^n) + k is a safe prime.

Original entry on oeis.org

1, 7, 7, 7, 91, 3103, 12451, 230191, 286867, 1657867, 10029811, 29761351, 22410151, 98402791, 167137543
Offset: 1

Views

Author

Mark Andreas, Jan 25 2023

Keywords

Comments

a(n) == 3 (mod 4) for n > 1. - Chai Wah Wu, Jan 27 2023

Examples

			a(3) = 7 because 2^(2^3) + 7 = 263 is the smallest safe prime greater than 256.
		

Crossrefs

Programs

  • PARI
    a(n) = {my(k=1); pow2 = 2^(2^n);   while (!(isprime(pow2 + k) && isprime((pow2 + k - 1)/2)), k+=2); k;} \\
    
  • Python
    from sympy import isprime, nextprime
    def A360080(n):
        if n <= 1: return 1
        m = 1<<(1<Chai Wah Wu, Jan 27 2023

Formula

a(n) = A350696(2^n).

A058221 Next-to-smallest k such that 2^(2^n) - k is prime.

Original entry on oeis.org

2, 5, 15, 17, 17, 83, 173, 357, 629, 179, 2543, 8067, 5619, 29027, 38783, 99267
Offset: 1

Views

Author

Warren D. Smith, Nov 30 2000

Keywords

Crossrefs

Cf. A058220.

Programs

  • PARI
    a(n) = my(N = 2^(2^n)); N - precprime(precprime(N)-1) \\ Michel Marcus, Jun 29 2013

Extensions

a(15) from Jinyuan Wang, Jun 06 2020
a(16) from Michael S. Branicky, Apr 23 2023

A382666 Smallest k such that 7^(7^n) - k is prime.

Original entry on oeis.org

2, 2, 6, 512, 3918, 48966
Offset: 0

Views

Author

J.W.L. (Jan) Eerland, Apr 08 2025

Keywords

Comments

This is to 7 as A058220 is to 2, A140331 is to 3 and A364454 is to 6.
a(6) > 10000. - Michael S. Branicky, Apr 15 2025

Examples

			a(2) = 6 because 7^(7^2) - 6 = 256923577521058878088611477224235621321601 is prime.
		

Crossrefs

Programs

  • Mathematica
    lst={};Do[Do[p=7^(7^n)-k;If[PrimeQ[p],AppendTo[lst,k];Break[]],{k,2,11!}],{n,7}];lst
    Table[k=1;Monitor[Parallelize[While[True,If[PrimeQ[7^(7^n)-k],Break[]];k++];k],k],{n,0,7}]
    y[n_] := Module[{x = 7^(7^n)}, x - NextPrime[x, -1]]; Array[y, 7]
  • PARI
    a(n) = my(x = 7^(7^n)); x - precprime(x-1);
    
  • Python
    from sympy import prevprime
    def a(n):
        base = 7**(7**n)
        return base - prevprime(base)
    # Jakub Buczak, May 04 2025

Extensions

a(5) from Michael S. Branicky, Apr 14 2025
Showing 1-8 of 8 results.