login
A385485
a(n) is the least number k such that k*n is not a binary Niven number (A049445).
4
3, 7, 1, 7, 1, 5, 1, 7, 1, 3, 1, 29, 1, 1, 1, 7, 1, 3, 1, 5, 3, 1, 1, 29, 1, 1, 1, 1, 1, 1, 1, 7, 1, 3, 1, 13, 1, 1, 1, 5, 1, 5, 1, 1, 1, 1, 1, 29, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 17, 1, 1, 1, 7, 1, 3, 1, 7, 3, 1, 1, 13, 1, 1, 1, 1, 1, 1, 1, 5, 3, 1, 1, 17, 1
OFFSET
1,1
COMMENTS
All the terms are odd numbers because if k is even and k*n is not a binary Niven number then so is k*n/2, since A000120(k*n) = A000120(k*n/2).
LINKS
FORMULA
a(n) = 1 if and only if n is in A065878.
MATHEMATICA
a[n_] := Module[{m = n, k = 1}, While[Divisible[m, DigitSum[m, 2]], m += 2*n; k += 2]; k]; Array[a, 100]
PROG
(PARI) a(n) = {my(m = n, k = 1); while(!(m % hammingweight(m)), m += 2*n; k += 2); 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
CROSSREFS
Cf. A000120, A049445, A065878, A144262 (decimal analog), A385482, A385486 (indices of records), A385487 (record values).
Sequence in context: A383432 A354977 A080172 * A133065 A335815 A021733
KEYWORD
nonn,easy,base
AUTHOR
Amiram Eldar, Jun 30 2025
STATUS
approved