login
A359464
a(n) = 1 if the total number of 1-bits in the exponents of prime factorization n is even, otherwise 0.
4
1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 0, 1, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1
OFFSET
1
FORMULA
a(n) = A059841(A064547(n)).
a(n) = 1 - A092248(A367514(n)). - Amiram Eldar, Oct 02 2024
MATHEMATICA
a[n_] := Boole@ EvenQ[Plus @@ DigitCount[FactorInteger[n][[;; , 2]], 2, 1]]; a[1] = 1; Array[a, 100] (* Amiram Eldar, Oct 02 2024 *)
PROG
(PARI)
A064547(n) = {my(f = factor(n)[, 2]); sum(k=1, #f, hammingweight(f[k])); } \\ From A064547.
A359464(n) = !(A064547(n)%2);
(Python)
from functools import reduce
from operator import ixor
from sympy import factorint
def A359464(n): return reduce(ixor, (d.bit_count() for d in factorint(n).values()), 1)&1 # Chai Wah Wu, Jan 04 2023
CROSSREFS
Characteristic function of A000379.
Sequence in context: A374051 A354927 A173861 * A011746 A071005 A287801
KEYWORD
nonn,easy,base
AUTHOR
Antti Karttunen, Jan 02 2023
STATUS
approved