A090003 Length of longest contiguous block of 1's in binary expansion of n^3.
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, 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, 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
Offset: 0
Links
Programs
-
Mathematica
Join[{0},Table[Max[Length/@Select[Split[IntegerDigits[n^3,2]],MemberQ[#,1]&]],{n,110}]] (* Harvey P. Dale, Aug 28 2016 *)
-
PARI
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 A090003(n) = A038374(n^3); \\ Antti Karttunen, Jul 09 2017
Comments