login
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.
4
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,2
COMMENTS
First 4 occurs at n=12720, first 5 occurs at n=19440. See A074200.
LINKS
EXAMPLE
a(12) = 3 as 13 = 1*prime, 14 = 2*prime, 15 = 3*prime.
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 *)
PROG
(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))))))
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).
Sequence in context: A283978 A002655 A064891 * A035211 A352558 A324735
KEYWORD
nonn
AUTHOR
Antti Karttunen, Nov 30 2016
STATUS
approved