login
A359473
a(n) = 1 if the number of divisors of n is a power of 2, otherwise 0.
3
1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 1, 1, 1
OFFSET
1
FORMULA
a(n) = A209229(A000005(n)).
a(n) = [A348341(n) == 0], where [ ] is the Iverson bracket.
A359472(n) <= a(n) <= A295316(n).
Sum_{k=1..n} a(k) ~ c * n, where c = A327839. - Amiram Eldar, Jan 05 2023
MATHEMATICA
a[n_] := If[IntegerQ@Log2[DivisorSigma[0, n]], 1, 0]; Array[a, 100] (* Amiram Eldar, Jan 05 2023 *)
PROG
(PARI)
A209229(n) = (n && !bitand(n, n-1));
A359473(n) = A209229(numdiv(n));
(Python)
from sympy import factorint
def A359473(n): return int(all(map(lambda m:not((k:=m+1)&-k)^k, factorint(n).values()))) # Chai Wah Wu, Jan 04 2023
CROSSREFS
Characteristic function of A036537, whose complement A162643 gives the positions of 0's.
Sequence in context: A267773 A325321 A255887 * A181183 A295316 A014677
KEYWORD
nonn
AUTHOR
Antti Karttunen, Jan 04 2023
STATUS
approved