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.

A072064 Least k>0 such that prime(n)+k*n is prime.

Original entry on oeis.org

1, 1, 2, 1, 4, 1, 2, 3, 2, 3, 2, 2, 2, 2, 4, 3, 4, 1, 6, 3, 4, 1, 10, 1, 4, 1, 2, 2, 2, 2, 4, 1, 4, 1, 6, 2, 6, 2, 6, 3, 24, 1, 2, 2, 6, 3, 8, 1, 6, 3, 8, 5, 2, 2, 2, 3, 2, 4, 6, 2, 16, 3, 2, 2, 2, 1, 4, 3, 6, 1, 10, 1, 4, 2, 6, 6, 16, 3, 8, 2, 4, 1, 6, 2, 10, 3, 4, 4, 18, 2, 6, 1, 2
Offset: 1

Views

Author

Reinhard Zumkeller, Jun 12 2002

Keywords

Examples

			n=3, prime(3)=5: 5+1*3=8 is not prime, but 5+2*3=11, therefore a(3)=2 and A072063(3)=11.
		

Crossrefs

Programs

  • Mathematica
    A072064[n_]:=Module[{p=Prime[n],k=1},While[!PrimeQ[p+k*n],k++];k];Array[A072064,100] (* Paolo Xausa, Nov 27 2023 *)
  • PARI
    a(n) = my(p=prime(n), k=1); while (!isprime(p+k*n), k++); k; \\ Michel Marcus, Nov 27 2023