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”).

Characteristic function for A104210: a(n) = 1 if n is divisible by at least 2 consecutive primes, 0 otherwise.
7

%I #7 Dec 18 2017 11:57:12

%S 0,0,0,0,0,1,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,

%T 1,1,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,

%U 0,1,0,1,0,0,1,0,1,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,1

%N Characteristic function for A104210: a(n) = 1 if n is divisible by at least 2 consecutive primes, 0 otherwise.

%H Antti Karttunen, <a href="/A296210/b296210.txt">Table of n, a(n) for n = 1..65537</a>

%H <a href="/index/Ch#char_fns">Index entries for characteristic functions</a>

%t Array[Boole@ MemberQ[Differences@ PrimePi@ FactorInteger[#][[All, 1]], 1] &, 105] (* _Michael De Vlieger_, Dec 16 2017 *)

%o (PARI) A296210(n) = { if(1==n,return(0)); my(ps=factor(n)[,1], pis=vector(length(ps),i,primepi(ps[i])), diffsminusones = vector(length(pis)-1,i,(pis[i+1]-pis[i])-1)); !factorback(diffsminusones); };

%Y Cf. A104210, A166469, A192280.

%K nonn

%O 1

%A _Antti Karttunen_, Dec 15 2017