login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

a(n) = 1 if n has exactly one non-unitary prime factor, otherwise 0.
7

%I #18 Jan 05 2023 03:20:28

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

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

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

%N a(n) = 1 if n has exactly one non-unitary prime factor, otherwise 0.

%H Antti Karttunen, <a href="/A359466/b359466.txt">Table of n, a(n) for n = 1..100000</a>

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

%H <a href="/index/Eu#epf">Index entries for sequences computed from exponents in factorization of n</a>.

%F a(n) = [A056170(n) == 1], where [ ] is the Iverson bracket.

%F a(n) = A353670(A181819(n)).

%F a(n) >= A359472(n) and a(n) >= A359474(n).

%F Sum_{k=1..n} a(k) ~ c * n, where c = A059956 * A154945 = 0.335389... . - _Amiram Eldar_, Jan 05 2023

%t a[n_] := If[Count[(f = FactorInteger[n])[[;; , 2]], 1] == Length[f] - 1, 1, 0]; Array[a, 100] (* _Amiram Eldar_, Jan 05 2023 *)

%o (PARI) A359466(n) = { my(f=factor(n)); (1==#select(x->(x>1), f[, 2])); }; \\ After isok function in A190641

%Y Characteristic function of A190641.

%Y Cf. A056170, A181819, A353670, A359472, A359474.

%Y Differs from A359467 for the first time at n=225, where a(225) = 0, while A359467(225) = 1.

%Y Cf. A059956, A154945.

%K nonn

%O 1

%A _Antti Karttunen_, Jan 02 2023