login
A088864
Maximum of the products of left and right parts when splitting the binary representation of n.
1
0, 0, 1, 0, 2, 2, 3, 0, 4, 4, 6, 4, 6, 6, 9, 0, 8, 8, 12, 8, 10, 12, 15, 8, 12, 12, 18, 12, 15, 18, 21, 0, 16, 16, 24, 16, 20, 24, 28, 16, 20, 20, 30, 24, 26, 30, 35, 16, 24, 24, 36, 24, 30, 36, 42, 24, 28, 30, 42, 36, 39, 42, 49, 0, 32, 32, 48, 32, 40, 48, 56, 32, 36, 40, 54
OFFSET
1,5
COMMENTS
a(2^n) = 0, a(2^n + 1) = 2^(n-1).
a(2*n+1) > a(2*n) = 2*a(n). - Reinhard Zumkeller, Jun 27 2013
FORMULA
a(n) = Max{floor(n/(2^k))*(n mod 2^k)}.
EXAMPLE
n=77 -> '1001101': a(77) = Max{'1'*'001101', '10'*'01101',
'100'*'1101', '1001'*'101', '10011'*'01', '100110'*'1'} = Max{1*13, 2*13,
4*13, 9*5, 19*1, 38*1} = Max{13, 26, 52, 45, 19, 38} = 52.
MATHEMATICA
mplrp[n_]:=Module[{idn2=IntegerDigits[n, 2], len}, len=Length[idn2]; Max[ Times @@@Table[{FromDigits[Take[idn2, i], 2], FromDigits[Take[ idn2, -(len-i)], 2]}, {i, len}]]]; Array[mplrp, 80] (* Harvey P. Dale, Jun 24 2013 *)
PROG
(Haskell)
import Data.List (inits, tails)
import Data.Function (on)
a088864 1 = 0
a088864 n = maximum $ zipWith ((*) `on` foldr (\d v -> v * 2 + d) 0)
(init $ tail $ inits bs) (init $ tail $ tails bs)
where bs = a030308_row n
-- Reinhard Zumkeller, Jun 27 2013
CROSSREFS
Cf. A007088.
Cf. A030308.
Sequence in context: A104594 A079626 A257697 * A330925 A191361 A199784
KEYWORD
nonn,base
AUTHOR
Reinhard Zumkeller, Nov 26 2003
STATUS
approved