login
Characteristic function of A055932: a(n) = 1 if n is a number all of whose prime divisors are consecutive primes starting at 2, otherwise 0.
3

%I #16 May 08 2021 01:56:36

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

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

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

%N Characteristic function of A055932: a(n) = 1 if n is a number all of whose prime divisors are consecutive primes starting at 2, otherwise 0.

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

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

%H <a href="/index/Pri#prime_indices">Index entries for sequences computed from indices in prime factorization</a>

%F a(n) >= A322585(n) for all n.

%t Array[Boole[MemberQ[{{0}, {1}}, Union@Prepend[Differences[#], First[#]] &@ PrimePi@ FactorInteger[#][[All, 1]] ] ] &, 120] (* _Michael De Vlieger_, Feb 25 2021 *)

%o (PARI) A341629(n) = if(1==n,1,my(f=factor(n)[, 1]~); (primepi(f[#f])==#f));

%Y Cf. A055932 (positions of ones), A080259 (of zeros), A322585, A340346.

%K nonn

%O 1

%A _Antti Karttunen_, Feb 25 2021