OFFSET
1,2
COMMENTS
a(n) = n - A199238(n). - Reinhard Zumkeller, Nov 04 2011
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
EXAMPLE
11 (decimal) in binary is 1011. There are three 1's. Because 9 is the largest multiple of 3 that is <= 11, then a(11) = 9.
MAPLE
a := proc (n) local n2, n1, j: n2 := convert(n, base, 2): n1 := add(n2[i], i = 1 .. nops(n2)): for j while j*n1 <= n do j*n1 end do end proc: seq(a(n), n = 1 .. 80); # Emeric Deutsch, Jun 26 2009
PROG
(PARI) a(n)=local(B=binary(n), w=B*vector(#B, x, 1)~); n-n%w \\ Hagen von Eitzen, Jun 22 2009
(Haskell)
a161764 n = n - a199238 n -- Reinhard Zumkeller, Nov 04 2011
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Leroy Quet, Jun 18 2009
EXTENSIONS
Extended by Hagen von Eitzen and Emeric Deutsch, Jun 26 2009
STATUS
approved