A090047 Length of longest contiguous block of 0's in binary expansion of n^2.
1, 0, 2, 2, 4, 2, 2, 3, 6, 3, 2, 2, 4, 2, 3, 4, 8, 4, 3, 2, 4, 2, 2, 4, 6, 3, 2, 2, 4, 2, 4, 5, 10, 5, 4, 2, 4, 2, 2, 3, 6, 3, 2, 2, 4, 2, 4, 4, 8, 4, 3, 3, 4, 2, 2, 3, 6, 3, 2, 2, 4, 3, 5, 6, 12, 6, 5, 3, 4, 2, 2, 3, 6, 3, 2, 2, 4, 2, 3, 4, 8, 4, 3, 2, 4, 4, 2, 3, 6, 3, 2, 6, 4, 4, 4, 5, 10, 5, 4, 2, 4, 2
Offset: 0
Links
- Amiram Eldar, Table of n, a(n) for n = 0..10000
Programs
-
Mathematica
a[n_] := If[n <= 1, 1-n, Max[Length /@ Split[IntegerDigits[n^2, 2]][[2 ;; -1 ;; 2]]]]; Array[a, 100, 0] (* Amiram Eldar, Jul 28 2025 *)