login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A088864 Maximum of the products of left and right parts when splitting the binary representation of n. 1

%I #12 Jun 27 2013 03:25:58

%S 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,

%T 18,21,0,16,16,24,16,20,24,28,16,20,20,30,24,26,30,35,16,24,24,36,24,

%U 30,36,42,24,28,30,42,36,39,42,49,0,32,32,48,32,40,48,56,32,36,40,54

%N Maximum of the products of left and right parts when splitting the binary representation of n.

%C a(2^n) = 0, a(2^n + 1) = 2^(n-1).

%C a(2*n+1) > a(2*n) = 2*a(n). - _Reinhard Zumkeller_, Jun 27 2013

%H Reinhard Zumkeller, <a href="/A088864/b088864.txt">Table of n, a(n) for n = 1..10000</a>

%H <a href="/index/Bi#binary">Index entries for sequences related to binary expansion of n</a>

%F a(n) = Max{floor(n/(2^k))*(n mod 2^k)}.

%e n=77 -> '1001101': a(77) = Max{'1'*'001101', '10'*'01101',

%e '100'*'1101', '1001'*'101', '10011'*'01', '100110'*'1'} = Max{1*13, 2*13,

%e 4*13, 9*5, 19*1, 38*1} = Max{13, 26, 52, 45, 19, 38} = 52.

%t 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 *)

%o (Haskell)

%o import Data.List (inits, tails)

%o import Data.Function (on)

%o a088864 1 = 0

%o a088864 n = maximum $ zipWith ((*) `on` foldr (\d v -> v * 2 + d) 0)

%o (init $ tail $ inits bs) (init $ tail $ tails bs)

%o where bs = a030308_row n

%o -- _Reinhard Zumkeller_, Jun 27 2013

%Y Cf. A007088.

%Y Cf. A030308.

%K nonn,base

%O 1,5

%A _Reinhard Zumkeller_, Nov 26 2003

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 16 04:17 EDT 2024. Contains 371696 sequences. (Running on oeis4.)