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.

A266239 a(n) is the smallest k such that the following are four primes: prime(n)*k-1, prime(n)*k+1, prime(n)*k^2-1, prime(n)*k^2+1. Or -1 if no such k exists.

Original entry on oeis.org

3, 2, 6, 66, 300, 24, 3744, 27000, 6, 1080, 960, 90, 30, 366, 9204, 8154, 1170, 840, 330, 6090, 84, 27720, 324, 90, 186, 4740, 2856, 6, 24270, 936, 5220, 1560, 6, 1500, 510, 120, 930, 3270, 30, 8520, 29700, 1200, 23310, 1056, 3540, 90, 3420, 2370, 9654, 83040, 2610, 9270, 2610
Offset: 1

Views

Author

Alex Ratushnyak, Dec 25 2015

Keywords

Comments

Conjecture: a(n)>1.

Examples

			a(1)=3 because the following are four primes: 2*3-1, 2*3+1, 2*9-1, 2*9+1.
		

Crossrefs

Programs

  • PARI
    a(n) = {k = 1; p = prime(n); while (! (isprime(p*k-1) && isprime(p*k+1) && isprime(p*k^2-1) && isprime(p*k^2+1)), k++);k;} \\ Michel Marcus, Dec 27 2015
  • Python
    from sympy import isprime
    TOP=10**9
    for p in range(2, 333):
        if isprime(p):
            failed = True
            for x in range(1, TOP):
                if isprime(p*x+1) and isprime(p*x-1) and isprime(p*x*x-1) and isprime(p*x*x+1):
                    print(x, end=', ')
                    failed = False
                    break
            if failed: print(-1, end=', ')