close
login
A378886
The number of consecutive primes in the prime factorization of n starting from the smallest prime dividing n; a(1) = 0.
1
0, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 2, 1, 2, 2, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 3
OFFSET
1,6
COMMENTS
First differs from A300820 at n = 70 = 2 * 5 * 7: A300820(70) = 2 while a(70) = 1.
LINKS
FORMULA
a(n) >= A276084(n).
a(n) <= A300820(n).
a(n) = A001221(n) if and only if n is in A073491.
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);
KEYWORD
nonn,easy
AUTHOR
Amiram Eldar, Dec 10 2024
STATUS
approved