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-2 of 2 results.

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).

A360081 Smallest k such that 2^(3*2^n) + k is a safe prime.

Original entry on oeis.org

3, 19, 31, 691, 907, 2887, 15943, 69283, 216127, 1108831, 8344423, 10976347, 166965391, 385465771, 26580643
Offset: 0

Views

Author

Mark Andreas, Jan 25 2023

Keywords

Comments

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

Examples

			a(1) = 19 because 2^(3*2^1)+19 = 2^6+19 = 83 is the smallest safe prime greater than 64.
		

Crossrefs

Programs

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

Formula

a(n) = A350696(3*2^n).
Showing 1-2 of 2 results.