OFFSET
1,1
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
a(11) = 10131 = 11 * 921 because 11 contains two 1's while 10131 contains three, and every multiple of 11 less than 10131 contains at most two 1's.
MAPLE
f:= proc(n) local t, k;
t:= 1+numboccur(1, convert(n, base, 10));
for k from 2*n by n do
if numboccur(1, convert(k, base, 10)) = t then return k fi
od
end proc:
map(f, [$1..100]);
MATHEMATICA
a[n_]:=Module[{k=1}, While[Count[IntegerDigits[k*n], 1]-Count[IntegerDigits[n], 1]!=1, k++]; k*n]; Array[a, 60] (* Stefano Spezia, Oct 22 2024 *)
PROG
(Python)
from gmpy2 import digits
from itertools import count
def a(n):
t = digits(n).count("1")
return next(k*n for k in count(2) if digits(k*n).count("1") - t == 1)
print([a(n) for n in range(1, 100)]) # Michael S. Branicky, Oct 22 2024
CROSSREFS
KEYWORD
AUTHOR
Robert Israel, Oct 22 2024
STATUS
approved