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
LINKS
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
KEYWORD
nonn,base
AUTHOR
Reinhard Zumkeller, Nov 26 2003
STATUS
approved