A335133 Binary interpretation of the left diagonal of the EQ-triangle with first row generated from the binary expansion of n, with most significant bit given by first row.
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 10, 13, 12, 14, 15, 16, 17, 18, 19, 22, 23, 20, 21, 26, 27, 24, 25, 28, 29, 30, 31, 32, 33, 35, 34, 36, 37, 39, 38, 44, 45, 47, 46, 40, 41, 43, 42, 53, 52, 54, 55, 49, 48, 50, 51, 57, 56, 58, 59, 61, 60, 62, 63, 64, 65, 66, 67
Offset: 0
Examples
For n = 42: - the binary representation of 42 is "101010", - the corresponding EQ-triangle is: 1 0 1 0 1 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 - the bits on the left diagonal are: 1, 0, 1, 1, 1, 1, - so a(42) = 2^5 + 2^3 + 2^2 + 2^1 + 2^0 = 47.
Links
Programs
-
PARI
a(n) = { my (b=binary(n), v=0); forstep (x=#b-1, 0, -1, if (b[1], v+=2^x); b=vector(#b-1, k, b[k]==b[k+1]) ); return (v) }
Comments