login
Length of longest contiguous block of 1's in binary expansion of n^3.
6

%I #10 Jul 10 2017 01:36:33

%S 0,1,1,2,1,5,2,3,1,2,5,2,2,1,3,4,1,2,2,2,5,2,2,5,2,4,1,3,3,5,4,5,1,2,

%T 2,4,2,3,2,4,5,3,2,2,2,6,5,4,2,3,4,2,1,2,3,4,3,2,5,2,4,3,5,6,1,2,2,2,

%U 2,4,4,3,2,5,3,8,2,4,4,4,5,6,3,3,2,4,2,3,2,3,6,8,5,2,4,5,2,4,3,3,4,5

%N Length of longest contiguous block of 1's in binary expansion of n^3.

%C a(n) = A038374(A000578(n)).

%H Antti Karttunen, <a href="/A090003/b090003.txt">Table of n, a(n) for n = 0..16384</a>

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

%t Join[{0},Table[Max[Length/@Select[Split[IntegerDigits[n^3,2]],MemberQ[#,1]&]],{n,110}]] (* _Harvey P. Dale_, Aug 28 2016 *)

%o (PARI)

%o A038374(n) = { if(n<2, return(n)); n>>=valuation(n, 2); if(n<2, return(n)); my(e=valuation(n+1, 2)); max(e, A038374(n>>e)); } \\ After _Charles R Greathouse IV_, Jan 12 2014

%o A090003(n) = A038374(n^3); \\ _Antti Karttunen_, Jul 09 2017

%Y Cf. A000120, A090001, A090002, A090049.

%K nonn,base

%O 0,4

%A _Reinhard Zumkeller_, Nov 20 2003