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.

Showing 1-2 of 2 results.

A363787 Primitive binary Niven numbers: binary Niven numbers (A049445) that are not twice another binary Niven number.

Original entry on oeis.org

1, 6, 10, 18, 21, 34, 55, 60, 66, 69, 81, 92, 108, 115, 116, 126, 130, 155, 156, 172, 180, 185, 204, 205, 212, 222, 228, 246, 258, 261, 273, 284, 285, 295, 300, 308, 318, 321, 332, 340, 345, 355, 356, 366, 378, 395, 396, 404, 405, 414, 420, 425, 438, 452, 462
Offset: 1

Views

Author

Amiram Eldar, Jun 22 2023

Keywords

Comments

Every binary Niven number is of the form m*2^k, where m is a term of this sequence and k >= 0.
Includes all the odd binary Niven numbers (A144302).
This sequence is infinite. E.g., 16^k + 4^k + 1 is a term for all k >= 1.

Examples

			6 is a term as 6 is a binary Niven number and 6/2 = 3 is not a binary Niven number.
		

Crossrefs

Subsequence of A049445.
Disjoint union of A144302 and A363788.
A363789 is a subsequence.
Cf. A356349 (decimal analog).

Programs

  • Mathematica
    binNivQ[n_] := Divisible[n, DigitCount[n, 2, 1]]; q[n_] := binNivQ[n] && ! (EvenQ[n] && binNivQ[n/2]); Select[Range[500], q]
  • PARI
    isbinniv(n) = !(n % hammingweight(n));
    is(n) = isbinniv(n) && !(!(n%2) && isbinniv(n/2));

A385482 a(n) is the least number k such that k*n is a binary Niven number (A049445).

Original entry on oeis.org

1, 1, 2, 1, 2, 1, 3, 1, 2, 1, 5, 1, 10, 3, 4, 1, 2, 1, 12, 1, 1, 3, 3, 1, 12, 5, 3, 3, 4, 2, 5, 1, 2, 1, 12, 1, 5, 6, 4, 1, 5, 1, 4, 3, 4, 2, 12, 1, 12, 6, 4, 3, 4, 2, 1, 3, 4, 2, 5, 1, 6, 5, 2, 1, 2, 1, 12, 1, 1, 6, 4, 1, 6, 3, 4, 3, 4, 2, 5, 1, 1, 3, 4, 1, 4
Offset: 1

Views

Author

Amiram Eldar, Jun 30 2025

Keywords

Crossrefs

Cf. A049445, A144261 (decimal analog), A363788, A385483 (indices of records), A385484 (record values), A385485.

Programs

  • Mathematica
    a[n_] := Module[{m = n, k = 1}, While[!Divisible[m, DigitSum[m, 2]], m += n; k++]; k]; Array[a, 100]
  • PARI
    a(n) = {my(m = n, k = 1); while(m % hammingweight(m), m += n; k++); k;}
    
  • Python
    from itertools import count
    def a(n): return next(k for k in count(1) if (m:=k*n)%m.bit_count() == 0)
    print([a(n) for n in range(1, 86)]) # Michael S. Branicky, Jun 30 2025

Formula

a(n) = 1 if and only if n is in A049445.
a(n) = 2 if and only if 2*n is in A363788.
Showing 1-2 of 2 results.