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”).
%I #13 Dec 09 2021 11:54:33
%S 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,
%T 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,
%U 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
%N Characteristic function of numbers having no prime gaps in their factorization.
%H Antti Karttunen, <a href="/A137794/b137794.txt">Table of n, a(n) for n = 1..65537</a>
%H <a href="/index/Ch#char_fns">Index entries for characteristic functions</a>
%F a(n) = 0^A073490(n).
%F a(A073491(n)) = 1; a(A073492(n)) = 0;
%F a(n) = A137721(n) - A137721(n-1) for n>1.
%t a[n_] := With[{pp = PrimePi @ FactorInteger[n][[All, 1]]},
%t Boole[pp[[-1]] - pp[[1]] + 1 == Length[pp]]];
%t Array[a, 105] (* _Jean-François Alcover_, Dec 09 2021 *)
%o (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
%Y Cf. A137721 (partial sums).
%K nonn
%O 1,1
%A _Reinhard Zumkeller_, Feb 11 2008