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.

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

This page as a plain text file.
%I A378886 #12 Dec 10 2024 09:59:09
%S A378886 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 A378886 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 A378886 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 A378886 The number of consecutive primes in the prime factorization of n starting from the smallest prime dividing n; a(1) = 0.
%C A378886 First differs from A300820 at n = 70 = 2 * 5 * 7: A300820(70) = 2 while a(70) = 1.
%H A378886 Amiram Eldar, <a href="/A378886/b378886.txt">Table of n, a(n) for n = 1..10000</a>
%F A378886 a(n) >= A276084(n).
%F A378886 a(n) <= A300820(n).
%F A378886 a(n) = A001221(n) if and only if n is in A073491.
%F A378886 a(n) >= 1 for n >= 2.
%F A378886 a(n) >= 2 if and only if n is in A378884.
%F A378886 a(n) >= 3 if and only if n is in A378885.
%F A378886 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 A378886 a(42) = 2 since 42 = 2 * 3 * 7 and 2 and 3 are 2 consecutive primes.
%e A378886 a(28) = 1 since 28 = 2^2 * 7 and 3 is not a divisor of 28.
%e A378886 a(4095) = 3 since 4095 = 3^2 * 5 * 7 * 13 and 3, 5 and 7 are 3 consecutive primes.
%t A378886 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 A378886 (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 A378886 Cf. A001221, A020639, A073491, A276084, A300820, A378884, A378885.
%K A378886 nonn,easy
%O A378886 1,6
%A A378886 _Amiram Eldar_, Dec 10 2024