A137794 Characteristic function of numbers having no prime gaps in their factorization.
1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1, 0, 1
Offset: 1
Keywords
Links
Crossrefs
Cf. A137721 (partial sums).
Programs
-
Mathematica
a[n_] := With[{pp = PrimePi @ FactorInteger[n][[All, 1]]}, Boole[pp[[-1]] - pp[[1]] + 1 == Length[pp]]]; Array[a, 105] (* Jean-François Alcover, Dec 09 2021 *)
-
PARI
A137794(n) = if(1>=omega(n),1,my(pis=apply(primepi,factor(n)[,1])); for(k=2,#pis,if(pis[k]>(1+pis[k-1]),return(0))); (1)); \\ Antti Karttunen, Sep 27 2018