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

A382246 Smallest number k such that k^n - 6 is prime.

Original entry on oeis.org

8, 3, 2, 5, 5, 5, 19, 85, 7, 5, 19, 275, 23, 43, 53, 455, 65, 23, 23, 175, 7, 65, 47, 295, 7, 143, 49, 115, 23, 355, 185, 305, 7, 55, 319, 85, 113, 25, 329, 505, 25, 187, 205, 25, 295, 437, 17, 2285, 7, 583, 35, 1375, 5, 7, 35, 895, 235, 277, 197, 695, 203, 145, 43, 35, 437, 215
Offset: 1

Views

Author

Jakub Buczak, Mar 19 2025

Keywords

Comments

No term k in the sequence can be divisible by 2 or 3. Except for the special case a(1)-a(3), where the result of k^n - 6 is either the prime number 2 or 3.
If n is a multiple of 4, the only valid terms of k are those ending in a 5.
Empirical analysis suggests that the terms are typically prime or semiprime.

Examples

			a(1) = 8, because 8^1 - 6 = 2, which is prime.
a(4) = 5, because 5^4 - 6 = 619, which is prime.
		

Crossrefs

Cf. A028879 (a(2)), A239414 (a(6)) for the first term.

Programs

  • PARI
    a(n) = my(k=1); while (!isprime(k^n-6), k++); k; \\ Michel Marcus, Mar 19 2025
  • Python
    from sympy import isprime
    def a(n):
        k = 1
        while (n>1 and k not in [2,3] and (k%2==0 or k%3==0)) or not isprime(k**n-6):
            k += 1
        return k
    
Showing 1-1 of 1 results.