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.

Showing 1-3 of 3 results.

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).

A059937 Sum of binary numbers with n 1's and two (possibly leading) 0's.

Original entry on oeis.org

0, 7, 45, 186, 630, 1905, 5355, 14308, 36828, 92115, 225225, 540606, 1277874, 2981797, 6881175, 15728520, 35651448, 80215911, 179306325, 398458690, 880803630, 1937768217, 4244635395, 9261022956, 20132658900, 43620761275
Offset: 0

Views

Author

Henry Bottomley, Feb 13 2001

Keywords

Examples

			a(2) = 45 since binary sum of 1100 + 1010 + 1001 + 0110 + 0101 + 0011 is 12 + 10 + 9 + 6 + 5 + 3 = 45.
		

Crossrefs

Programs

  • PARI
    concat(0, Vec(x*(12*x^2-18*x+7)/((x-1)^3*(2*x-1)^3) + O(x^100))) \\ Colin Barker, Sep 13 2014

Formula

a(n) = (2^(n+2) - 1)*n*(n+1)/2 = A059672(n) + A059938(n) = a(n-1)*2*(n+1)/(n-1) + n(n+1)/2.
G.f.: x*(12*x^2-18*x+7) / ((x-1)^3*(2*x-1)^3). - Colin Barker, Sep 13 2014

A059938 Sum of binary numbers with n 1's and two (non-leading) 0's.

Original entry on oeis.org

0, 4, 31, 141, 506, 1590, 4593, 12523, 32740, 82908, 204755, 495561, 1179582, 2768818, 6422437, 14745495, 33554312, 75759480, 169869159, 378535765, 838860610, 1849687854, 4060086041, 8875147011, 19327352556, 41943039700
Offset: 0

Views

Author

Henry Bottomley, Feb 13 2001

Keywords

Examples

			a(2) = 1100_2 + 1010_2 + 1001_2 = 12 + 10 + 9 = 31.
		

Crossrefs

Programs

  • PARI
    concat(0, Vec(x*(8*x^3-6*x^2-5*x+4)/((x-1)^3*(2*x-1)^3) + O(x^100))) \\ Colin Barker, Sep 14 2014

Formula

a(n) = n^2*2^(n+1) - n*(n-1)/2 = A059937(n) - A059672(n) = A059937(n-1) + 2^(n+1)*n*(n+1)/2.
G.f.: x*(8*x^3-6*x^2-5*x+4) / ((x-1)^3*(2*x-1)^3). - Colin Barker, Sep 14 2014
Showing 1-3 of 3 results.