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.

A357280 Smallest m such that m^k-2 and m^k+2 are prime for k=1..n.

Original entry on oeis.org

5, 9, 102795, 559838181, 27336417022509
Offset: 1

Views

Author

Kellen Shenton, Sep 24 2022

Keywords

Examples

			a(3) = 102795 because:
for k = 1; 102795^1-2 = 102793 and 102795^1+2 = 102797, both of which are prime, and
for k = 2; 102795^2-2 = 10566812023 and 102795^2+2 = 10566812027, both of which are prime, and
for k = 3; 102795^3-2 = 1086215442109873 and 102795^3+2 = 1086215442109877, both of which are prime, and
102795 is the smallest number with this property.
		

Crossrefs

Programs

  • PARI
    isok(m,n) = for (k=1, n, if(!isprime(m^k-2) || !isprime(m^k+2), return(0));); return(1);
    a(n) = my(m=1); while(!isok(m, n), m++); m; \\ Michel Marcus, Nov 14 2022
Showing 1-1 of 1 results.