login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

The number of consecutive primes in the prime factorization of n starting from the smallest prime dividing n; a(1) = 0.
0

%I #12 Dec 10 2024 09:59:09

%S 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,

%T 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,

%U 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

%N The number of consecutive primes in the prime factorization of n starting from the smallest prime dividing n; a(1) = 0.

%C First differs from A300820 at n = 70 = 2 * 5 * 7: A300820(70) = 2 while a(70) = 1.

%H Amiram Eldar, <a href="/A378886/b378886.txt">Table of n, a(n) for n = 1..10000</a>

%F a(n) >= A276084(n).

%F a(n) <= A300820(n).

%F a(n) = A001221(n) if and only if n is in A073491.

%F a(n) >= 1 for n >= 2.

%F a(n) >= 2 if and only if n is in A378884.

%F a(n) >= 3 if and only if n is in A378885.

%F 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.

%e a(42) = 2 since 42 = 2 * 3 * 7 and 2 and 3 are 2 consecutive primes.

%e a(28) = 1 since 28 = 2^2 * 7 and 3 is not a divisor of 28.

%e a(4095) = 3 since 4095 = 3^2 * 5 * 7 * 13 and 3, 5 and 7 are 3 consecutive primes.

%t 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]

%o (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);

%Y Cf. A001221, A020639, A073491, A276084, A300820, A378884, A378885.

%K nonn,easy,new

%O 1,6

%A _Amiram Eldar_, Dec 10 2024