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.

A376579 Least prime p such that p*n+1 is prime, or -1 if no such prime exists.

This page as a plain text file.
%I A376579 #8 Oct 23 2024 01:26:55
%S A376579 2,2,2,3,2,2,-1,2,2,3,2,3,-1,2,2,7,-1,2,-1,2,2,3,2,3,-1,2,-1,7,2,2,-1,
%T A376579 3,2,3,2,2,-1,5,2,7,2,3,-1,2,-1,3,-1,2,-1,2,2,3,2,2,-1,2,-1,19,-1,3,
%U A376579 -1,5,2,3,2,3,-1,2,2,3,-1,13,-1,2,2,3,-1,2,-1,3,2,19
%N A376579 Least prime p such that p*n+1 is prime, or -1 if no such prime exists.
%e A376579 a(1) = 2 because 2 is the smallest prime p such that 1*p+1 is prime.
%o A376579 (PARI) a(n) = if (n%2, if (isprime(2*n+1), 2, -1), my(p=2); while(!isprime(p*n+1), p = nextprime(p+1)); p); \\ _Michel Marcus_, Sep 29 2024
%Y A376579 Cf. A034693, A051686.
%K A376579 sign
%O A376579 1,1
%A A376579 _Jean-Marc Rebert_, Sep 29 2024