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.

A351599 a(n) is the smallest integer m > 0 such that m*n is a digitally balanced number (A031443).

Original entry on oeis.org

2, 1, 3, 3, 2, 2, 5, 7, 1, 1, 4, 1, 4, 3, 9, 15, 9, 10, 2, 9, 2, 2, 8, 9, 2, 2, 5, 2, 8, 5, 17, 31, 5, 5, 1, 5, 1, 1, 4, 6, 1, 1, 4, 1, 3, 4, 3, 5, 1, 1, 3, 1, 4, 4, 3, 1, 4, 4, 3, 3, 13, 9, 33, 63, 3, 3, 3, 3, 10, 3, 2, 3, 11, 9, 2, 3, 2, 2, 8, 3, 10, 9, 2
Offset: 1

Views

Author

Alex Ratushnyak, May 02 2022

Keywords

Crossrefs

Programs

  • Mathematica
    balQ[n_] := Module[{d = IntegerDigits[n, 2], m}, EvenQ@(m = Length@d) && Count[d, 1] == m/2]; a[n_] := Module[{k = 1}, While[!balQ[k*n], k++]; k]; Array[a, 100] (* Amiram Eldar, May 02 2022 *)
  • PARI
    is(n) = hammingweight(n)==hammingweight(bitneg(n, #binary(n))); \\ A031443
    a(n) = my(m=1); while (!is(m*n), m++); m; \\ Michel Marcus, May 02 2022

Formula

a(n) = A143146(n) / n. - Rémy Sigrist, Jul 11 2022