cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A164874 Triangle read by rows: T(1,1)=2; T(n,k)=2*T(n-1,k)+1, 1<=k

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Aug 29 2009

Keywords

Comments

All terms contain exactly 1 zero in binary representation.

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 .
		

Crossrefs

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

Formula

T(n,k) = 2^(n+1) - 2^(n-k) - 1, 1 <= k <= n.
T(n,k) = A030130(n*(n-1)/2 + k + 1);
A023416(T(n,k)) = 1, 1<=k<=n;
A059673(n) = sum of n-th row;
T(n,1) = A055010(n);
T(n,2) = A086224(n-2) for n > 1;
T(n,n-1) = A036563(n+1) for n > 1;
T(n,n) = A000918(n+1).