A164874
Triangle read by rows: T(1,1)=2; T(n,k)=2*T(n-1,k)+1, 1<=k
2, 5, 6, 11, 13, 14, 23, 27, 29, 30, 47, 55, 59, 61, 62, 95, 111, 119, 123, 125, 126, 191, 223, 239, 247, 251, 253, 254, 383, 447, 479, 495, 503, 507, 509, 510, 767, 895, 959, 991, 1007, 1015, 1019, 1021, 1022, 1535, 1791, 1919, 1983, 2015, 2031, 2039, 2043, 2045, 2046
Offset: 1
Examples
Initial rows: 1: 2 2: 5 6 3: 11 13 14 4: 23 27 29 30 5: 47 55 59 61 62 6: 95 111 119 123 125 126 also in binary representation: 10 101 110 1011 1101 1110 10111 11011 11101 11110 101111 110111 111011 111101 111110 1011111 1101111 1110111 1111011 1111101 1111110 .
Links
- Reinhard Zumkeller, Rows n = 1..100 of triangle, flattened
Programs
-
Haskell
a164874 n k = a164874_tabl !! (n-1) !! (k-1) a164874_row n = a164874_tabl !! (n-1) a164874_tabl = map reverse $ iterate f [2] where f xs@(x:_) = (2 * x + 2) : map ((+ 1) . (* 2)) xs -- Reinhard Zumkeller, Mar 31 2015
-
Mathematica
A164874row[n_] := 2^(n + 1) - 1 - BitShiftRight[2^n, Range[n]]; Array[A164874row, 10] (* Paolo Xausa, Jun 13 2025 *)
-
Python
from math import isqrt def A164874(n): return (1<<(a:=(isqrt(n<<3)+1>>1)+1))-(1<<(a*(a-1)>>1)-n)-1 # Chai Wah Wu, May 21 2025
Comments