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.

This page as a plain text file.
%I A266239 #11 Nov 13 2024 16:41:08
%S A266239 3,2,6,66,300,24,3744,27000,6,1080,960,90,30,366,9204,8154,1170,840,
%T A266239 330,6090,84,27720,324,90,186,4740,2856,6,24270,936,5220,1560,6,1500,
%U A266239 510,120,930,3270,30,8520,29700,1200,23310,1056,3540,90,3420,2370,9654,83040,2610,9270,2610
%N 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.
%C A266239 Conjecture: a(n)>1.
%e A266239 a(1)=3 because the following are four primes: 2*3-1, 2*3+1, 2*9-1, 2*9+1.
%o A266239 (Python)
%o A266239 from sympy import isprime
%o A266239 TOP=10**9
%o A266239 for p in range(2, 333):
%o A266239     if isprime(p):
%o A266239         failed = True
%o A266239         for x in range(1, TOP):
%o A266239             if isprime(p*x+1) and isprime(p*x-1) and isprime(p*x*x-1) and isprime(p*x*x+1):
%o A266239                 print(x, end=', ')
%o A266239                 failed = False
%o A266239                 break
%o A266239         if failed: print(-1, end=', ')
%o A266239 (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
%Y A266239 Cf. A000040, A035096.
%K A266239 nonn
%O A266239 1,1
%A A266239 _Alex Ratushnyak_, Dec 25 2015