A331857 a(n) is the greatest value obtained by partitioning the binary representation of n into consecutive blocks, and then reversing those blocks.
0, 1, 2, 3, 4, 6, 6, 7, 8, 12, 12, 14, 12, 14, 14, 15, 16, 24, 24, 28, 24, 26, 28, 30, 24, 28, 28, 30, 28, 30, 30, 31, 32, 48, 48, 56, 48, 52, 56, 60, 48, 52, 52, 58, 56, 58, 60, 62, 48, 56, 56, 60, 56, 58, 60, 62, 56, 60, 60, 62, 60, 62, 62, 63, 64, 96, 96
Offset: 0
Examples
For n = 6: - the binary representation of 6 is "110", - we can split it in 4 ways: "110" -> "011" -> 3 "1" and "10" -> "1" and "01" -> 5 "11" and "0" -> "11" and "0" -> 6 "1" and "1" and "0" -> "1" and "1" and "0" -> 6 - we have 3 distinct values, the greatest being 6, - hence a(6) = 6.
Links
- Rémy Sigrist, Table of n, a(n) for n = 0..16384
- Rémy Sigrist, PARI program for A331857
- Index entries for sequences related to binary expansion of n
Crossrefs
Programs
-
PARI
See Links section.