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.

A381532 Smallest integer k>0 such that prime(n) + k*prime(n+1) is prime.

Original entry on oeis.org

1, 2, 2, 2, 2, 2, 6, 6, 4, 8, 4, 6, 2, 2, 10, 10, 2, 6, 12, 6, 4, 6, 4, 2, 14, 2, 2, 6, 6, 2, 2, 6, 6, 6, 20, 6, 4, 8, 4, 16, 2, 2, 2, 2, 8, 10, 4, 2, 6, 6, 6, 14, 2, 4, 10, 6, 2, 6, 2, 6, 18, 2, 2, 2, 2, 12, 10, 2, 6, 6, 4, 2, 22, 4, 6, 10, 12, 6, 8, 8, 12, 2
Offset: 1

Views

Author

Jean-Marc Rebert, Mar 07 2025

Keywords

Examples

			a(1)= 1, because 2 and 3 are consecutive primes and 2 + 1*3 = 5 is prime, and no lesser number has this property.
 p + k*q, where p and q are consecutive primes
 2 + 1* 3 =   5 is prime;
 3 + 2* 5 =  13 is prime;
 5 + 2* 7 =  19 is prime;
 7 + 2*11 =  29 is prime;
		

Crossrefs

Cf. A129919 (resulting primes), A175914 (primes for which k=2), A368691 (primes for which k=4).

Programs

  • Mathematica
    Do[k=0;Until[PrimeQ[Prime[n]+k*Prime[n+1]],k++];a[n]=k,{n,82}];Array[a,82] (* James C. McMahon, Mar 28 2025 *)
  • PARI
    a(n) = my(p=prime(n), q=nextprime(p+1), k=1); while (!isprime(p+k*q), k++); k; \\ Michel Marcus, Mar 09 2025
Showing 1-1 of 1 results.