cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A348416 For n >= 1; a(n) = gcd(n,w(n)) where w(n) is the binary weight of n, A000120(n).

Original entry on oeis.org

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

Views

Author

Ctibor O. Zizka, Oct 19 2021

Keywords

Comments

a(n) is even for n in A125592, a(n) = 1 for n in A094387.

Examples

			n = 6; gcd(6, A000120(6)) = 2, thus a(6) = 2.
		

Crossrefs

Programs

  • Mathematica
    Array[GCD[#, Total@ IntegerDigits[#, 2]] &, 105] (* Michael De Vlieger, Oct 19 2021 *)
  • PARI
    a(n) = gcd(n, hammingweight(n)); \\ Michel Marcus, Oct 19 2021

Formula

a(n) = gcd(n, A000120(n)).
a(n) = A000120(n) if and only if n is in A049445. - Amiram Eldar, Oct 19 2021