login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 


A294078
a(n) is the smallest even number k such that k*prime(n) - 1 or k*prime(n) + 1 is prime.
0
2, 2, 2, 2, 2, 4, 4, 2, 2, 2, 2, 2, 2, 4, 6, 2, 6, 6, 4, 4, 4, 2, 2, 2, 2, 6, 6, 6, 6, 2, 4, 2, 4, 2, 8, 6, 2, 4, 10, 2, 2, 6, 2, 4, 4, 2, 2, 8, 4, 2, 2, 2, 6, 2, 6, 4, 6, 2, 4, 2, 6, 2, 2, 6, 6, 6, 2, 2, 6, 8, 10, 2, 2, 4, 2, 4, 6, 6, 8, 4
OFFSET
1,1
COMMENTS
For n <= 10^9 the largest term is 186.
First occurrence of 2k, k=1,2,3,...: 1, 6, 15, 35, 39, 117, 1134, 199, 152, 362, ..., . - Robert G. Wilson v, Feb 08 2018
EXAMPLE
For n = 6, prime(6) = 13. The smallest even number k such that k * 13 + 1 is a prime number is k = 4, because 4 * 13 + 1 = 53 (not k = 2). So 4 is the sixth term.
MATHEMATICA
f[n_] := Block[{k = 2, p = Prime@ n}, While[ !PrimeQ[k*p -1] && !PrimeQ[k*p +1], k += 2]; k]; Array[f, 100] (* Robert G. Wilson v, Feb 08 2018 *)
PROG
(PARI) {
forprime(p=2, 100,
k=2;
while(!isprime(k*p-1)&&!isprime(k*p+1), k+=2);
print1(k", ");
)
}
CROSSREFS
Cf. A000040, A071407 (with "and" rather than "or").
Sequence in context: A319819 A319820 A319799 * A064133 A295101 A160675
KEYWORD
nonn
AUTHOR
Dimitris Valianatos, Feb 07 2018
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified September 21 19:09 EDT 2024. Contains 376087 sequences. (Running on oeis4.)