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.

A278500 a(n) = largest k such that n+1 = a prime, n+2 = 2 * a prime, ..., n+k is k times a prime, a(n) = 0 if n+1 is not a prime.

Original entry on oeis.org

1, 2, 0, 2, 0, 1, 0, 0, 0, 1, 0, 3, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 3, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0
Offset: 1

Views

Author

Antti Karttunen, Nov 30 2016

Keywords

Comments

First 4 occurs at n=12720, first 5 occurs at n=19440. See A074200.

Examples

			a(12) = 3 as 13 = 1*prime, 14 = 2*prime, 15 = 3*prime.
		

Crossrefs

Cf. A072668 (positions of zeros), A006093 (nonzeros), A089965 (positions of terms >= 2), A278583 (of terms >= 3), A278585 (of terms >= 4).
Cf. A074200 (position of the first term >= n).

Programs

  • Mathematica
    Table[If[CompositeQ[n + 1], 0, k = 1; While[Times @@ Boole@ Map[PrimeQ, MapIndexed[#1/First@ #2 &, (n + Range@ k)]] == 1, k++]; k - 1], {n, 120}] (* Michael De Vlieger, Dec 01 2016 *)
  • PARI
    A278500(n) = { my(k=1); while((!((n+k)%k) && isprime((n+k)/k)), k = k+1); (k-1); }
    for(n=1, 2^20, write("b278500.txt", n, " ", A278500(n)));
    
  • Scheme
    (define (A278500 n) (let loop ((k 1)) (let ((h (/ (+ n k) k))) (if (or (not (integer? h)) (zero? (A010051 h))) (- k 1) (loop (+ 1 k))))))