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

A348416
For n >= 1; a(n) = gcd(n,w(n)) where w(n) is the binary weight of n, A000120(n).
1
1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 1, 2, 1, 2, 3, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 2, 1, 1, 1, 2, 1, 3, 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 1, 2, 5, 1, 1, 2, 1, 4, 1, 1, 3, 1, 1, 2, 1, 2, 3, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 2, 3, 1, 1, 3
OFFSET
1,6
COMMENTS
a(n) is even for n in A125592, a(n) = 1 for n in A094387.
FORMULA
a(n) = gcd(n, A000120(n)).
a(n) = A000120(n) if and only if n is in A049445. - Amiram Eldar, Oct 19 2021
EXAMPLE
n = 6; gcd(6, A000120(6)) = 2, thus a(6) = 2.
MATHEMATICA
Array[GCD[#, Total@ IntegerDigits[#, 2]] &, 105] (* Michael De Vlieger, Oct 19 2021 *)
PROG
(PARI) a(n) = gcd(n, hammingweight(n)); \\ Michel Marcus, Oct 19 2021
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Ctibor O. Zizka, Oct 19 2021
STATUS
approved