OFFSET
1,6
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000
FORMULA
a(n) >= A276084(n).
a(n) <= A300820(n).
a(n) >= 1 for n >= 2.
a(n) >= 2 if and only if n is in A378884.
a(n) >= 3 if and only if n is in A378885.
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = Sum_{k>=1} k * (d(k) - d(k+1)) = 1.2630925015039..., where d(1) = 1 and d(k) = Sum_{i>=1} (Product_{j=1..i-1} (1-1/prime(j)))/(Product_{j=0..k-1} prime(i+j)), for k >= 2. d(k) is the asymptotic density of numbers m for which a(m) >= k.
EXAMPLE
a(42) = 2 since 42 = 2 * 3 * 7 and 2 and 3 are 2 consecutive primes.
a(28) = 1 since 28 = 2^2 * 7 and 3 is not a divisor of 28.
a(4095) = 3 since 4095 = 3^2 * 5 * 7 * 13 and 3, 5 and 7 are 3 consecutive primes.
MATHEMATICA
a[n_] := Module[{p = FactorInteger[n][[;; , 1]], c = 1, q}, q = p[[1]]; Do[q = NextPrime[q]; If[q == p[[i]], c++, Break[]], {i, 2, Length[p]}]; c]; a[1] = 0; Array[a, 100]
PROG
(PARI) a(n) = if(n == 1, 0, my(p = factor(n)[, 1], c = 1, q); q = p[1]; for(i = 2, #p, q = nextprime(q+1); if(q == p[i], c++, break)); c);
CROSSREFS
KEYWORD
nonn,easy,new
AUTHOR
Amiram Eldar, Dec 10 2024
STATUS
approved