A090048 Length of longest contiguous block of 0's in binary expansion of n-th triangular number.
1, 0, 0, 1, 1, 0, 1, 2, 2, 1, 1, 4, 2, 1, 2, 3, 3, 2, 1, 1, 2, 2, 1, 3, 2, 3, 1, 1, 2, 2, 3, 4, 4, 3, 2, 2, 2, 1, 2, 4, 2, 1, 4, 2, 1, 6, 4, 3, 3, 2, 2, 2, 3, 2, 2, 6, 3, 2, 1, 1, 2, 3, 4, 5, 5, 4, 3, 3, 2, 2, 2, 2, 3, 3, 1, 3, 1, 1, 6, 3, 3, 2, 2, 2, 2, 3, 2, 2, 2, 2, 0, 5, 4, 3, 3, 4, 4, 3, 2, 2, 2, 5
Offset: 0
Links
- Amiram Eldar, Table of n, a(n) for n = 0..10000
Programs
-
Mathematica
a[n_] := Module[{d = IntegerDigits[n*(n + 1)/2, 2]}, If[! MemberQ[d, 0], 0, Max[Length /@ Split[d][[2 ;; -1 ;; 2]]]]]; a[0] = 1; Array[a, 102, 0] (* Amiram Eldar, Jul 29 2025 *)