%I #36 Sep 05 2022 22:38:15
%S 0,1,1,1,1,1,1,1,1,2,1,1,1,2,1,1,1,1,1,2,2,2,1,1,1,2,1,2,1,1,1,1,2,2,
%T 1,1,1,2,2,2,1,2,1,2,1,2,1,1,1,2,2,2,1,1,2,2,2,2,1,1,1,2,2,1,2,2,1,2,
%U 2,2,1,1,1,2,1,2,1,2,1,2,1,2,1,2,2,2,2
%N a(n) = number of runs of consecutive prime numbers among the prime divisors of n.
%C a(n) = 0 iff n = 1.
%C a(n) = 1 iff n belongs to A073491.
%C a(p) = 1 for any prime p.
%C a(A002110(n)) = 1 for any n > 0.
%C a(n!) = 1 for any n > 1.
%C a(A066205(n)) = n for any n > 0.
%C a(n) = a(A007947(n)) for any n > 0.
%C a(n) = a(A003961(n)) for any n > 0.
%C a(n*m) <= a(n) + a(m) for any n > 0 and m > 0.
%C Each number n can be uniquely represented as a product of a(n) distinct terms from A073491; this representation is minimal relative to the number of terms.
%H Rémy Sigrist, <a href="/A287170/b287170.txt">Table of n, a(n) for n = 1..10000</a>
%H Rémy Sigrist, <a href="/A287170/a287170.pdf">Illustration of the first terms</a>
%H Rémy Sigrist, <a href="/A287170/a287170.png">Scatterplot of the ordinal transform of the first 1000000 terms</a>
%F a(n) = A069010(A087207(n))
%e See illustration of the first terms in the Links section.
%e The prime indices of 18564 are {1,1,2,4,6,7}, which separate into maximal gapless submultisets {1,1,2}, {4}, {6,7}, so a(18564) = 3; this corresponds to the ordered factorization 18564 = 12 * 7 * 221. - _Gus Wiseman_, Sep 03 2022
%t Table[Length[Select[First/@If[n==1,{},FactorInteger[n]],!Divisible[n,NextPrime[#]]&]],{n,30}] (* _Gus Wiseman_, Sep 03 2022 *)
%o (PARI) a(n) = my (f=factor(n)); if (#f~==0, return (0), return (#f~ - sum(i=1, #f~-1, if (primepi(f[i,1])+1 == primepi(f[i+1,1]), 1, 0))))
%o (Python)
%o from sympy import factorint, primepi
%o def a087207(n):
%o f=factorint(n)
%o return sum([2**primepi(i - 1) for i in f])
%o def a069010(n): return sum(1 for d in bin(n)[2:].split('0') if len(d)) # this function from _Chai Wah Wu_
%o def a(n): return a069010(a087207(n)) # _Indranil Ghosh_, Jun 06 2017
%Y Cf. A002110, A003961, A007947, A069010, A087207.
%Y Positions of first appearances are A066205.
%Y These are the row-lengths of A356226 and A356234. Other statistics are:
%Y - length: A287170 (this sequence)
%Y - minimum: A356227
%Y - maximum: A356228
%Y - bisected length: A356229
%Y - standard composition: A356230
%Y - Heinz number: A356231
%Y - positions of first appearances: A356603 or A356232 (sorted)
%Y A001222 counts prime factors, distinct A001221.
%Y A003963 multiplies together the prime indices.
%Y A056239 adds up the prime indices, row sums of A112798.
%Y A073491 lists numbers with gapless prime indices, complement A073492.
%Y Cf. A000005, A053251, A055932, A061395, A073493, A107428, A132747, A137921, A193829, A286470.
%K nonn
%O 1,10
%A _Rémy Sigrist_, Jun 04 2017