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-7 of 7 results.

A018900 Sums of two distinct powers of 2.

Original entry on oeis.org

3, 5, 6, 9, 10, 12, 17, 18, 20, 24, 33, 34, 36, 40, 48, 65, 66, 68, 72, 80, 96, 129, 130, 132, 136, 144, 160, 192, 257, 258, 260, 264, 272, 288, 320, 384, 513, 514, 516, 520, 528, 544, 576, 640, 768, 1025, 1026, 1028, 1032, 1040, 1056, 1088, 1152, 1280, 1536, 2049, 2050, 2052, 2056, 2064, 2080, 2112, 2176, 2304, 2560, 3072
Offset: 1

Views

Author

Jonn Dalton (jdalton(AT)vnet.ibm.com), Dec 11 1996

Keywords

Comments

Appears to give all k such that 8 is the highest power of 2 dividing A005148(k). - Benoit Cloitre, Jun 22 2002
Seen as a triangle read by rows, T(n,k) = 2^(k-1) + 2^n, 1 <= k <= n, the sum of the n-th row equals A087323(n). - Reinhard Zumkeller, Jun 24 2009
Numbers whose base-2 sum of digits is 2. - Tom Edgar, Aug 31 2013
All odd terms are A000051. - Robert G. Wilson v, Jan 03 2014
A239708 holds the subsequence of terms m such that m - 1 is prime. - Hieronymus Fischer, Apr 20 2014

Examples

			From _Hieronymus Fischer_, Apr 27 2014: (Start)
a(1) = 3, since 3 = 2^1 + 2^0.
a(5) = 10, since 10 = 2^3 + 2^1.
a(10^2) = 16640
a(10^3) = 35184372089344
a(10^4) = 2788273714550169769618891533295908724670464 = 2.788273714550...*10^42
a(10^5) = 3.6341936214780344527466190...*10^134
a(10^6) = 4.5332938264998904048012398...*10^425
a(10^7) = 1.6074616084721302346802429...*10^1346
a(10^8) = 1.4662184497310967196301632...*10^4257
a(10^9) = 2.3037539289782230932863807...*10^13462
a(10^10) = 9.1836811272250798973464436...*10^42571
(End)
		

Crossrefs

Cf. A000079, A014311, A014312, A014313, A023688, A023689, A023690, A023691 (Hamming weight = 1, 3, 4, ..., 9).
Sum of base-b digits equal b: A226636 (b = 3), A226969 (b = 4), A227062 (b = 5), A227080 (b = 6), A227092 (b = 7), A227095 (b = 8), A227238 (b = 9), A052224 (b = 10). - M. F. Hasler, Dec 23 2016

Programs

  • C
    unsigned hakmem175(unsigned x) {
        unsigned s, o, r;
        s = x & -x; r = x + s;
        o = x ^ r;  o = (o >> 2) / s;
        return r | o;
    }
    unsigned A018900(int n) {
        if (n == 1) return 3;
        return hakmem175(A018900(n - 1));
    } // Peter Luschny, Jan 01 2014
    
  • Haskell
    a018900 n = a018900_list !! (n-1)
    a018900_list = elemIndices 2 a073267_list  -- Reinhard Zumkeller, Mar 07 2012
    
  • Maple
    a:= n-> (i-> 2^i+2^(n-1-i*(i-1)/2))(floor((sqrt(8*n-1)+1)/2)):
    seq(a(n), n=1..100);  # Alois P. Heinz, Feb 01 2022
  • Mathematica
    Select[ Range[ 1056 ], (Count[ IntegerDigits[ #, 2 ], 1 ]==2)& ]
    Union[Total/@Subsets[2^Range[0,10],{2}]] (* Harvey P. Dale, Mar 04 2012 *)
  • PARI
    for(m=1,9,for(n=0,m-1,print1(2^m+2^n", "))) \\ Charles R Greathouse IV, Sep 09 2011
    
  • PARI
    is(n)=hammingweight(n)==2 \\ Charles R Greathouse IV, Mar 03 2014
    
  • PARI
    for(n=0,10^5,if(hammingweight(n)==2,print1(n,", "))); \\ Joerg Arndt, Mar 04 2014
    
  • PARI
    a(n)= my(t=sqrtint(n*8)\/2); 2^t + 2^(n-1-t*(t-1)/2); \\ Ruud H.G. van Tol, Nov 30 2024
    
  • Python
    print([n for n in range(1, 3001) if bin(n)[2:].count("1")==2]) # Indranil Ghosh, Jun 03 2017
    
  • Python
    A018900_list = [2**a+2**b for a in range(1,10) for b in range(a)] # Chai Wah Wu, Jan 24 2021
    
  • Python
    from math import isqrt, comb
    def A018900(n): return (1<<(m:=isqrt(n<<3)+1>>1))+(1<<(n-1-comb(m,2))) # Chai Wah Wu, Oct 30 2024
  • Smalltalk
    distinctPowersOf: b
      "Version 1: Answers the n-th number of the form b^i + b^j, i>j>=0, where n is the receiver.
      b > 1 (b = 2, for this sequence).
      Usage: n distinctPowersOf: 2
      Answer: a(n)"
      | n i j |
      n := self.
      i := (8*n - 1) sqrtTruncated + 1 // 2.
      j := n - (i*(i - 1)/2) - 1.
      ^(b raisedToInteger: i) + (b raisedToInteger: j)
    [by Hieronymus Fischer, Apr 20 2014]
    ------------
    
  • Smalltalk
    distinctPowersOf: b
      "Version 2: Answers an array which holds the first n numbers of the form b^i + b^j, i>j>=0, where n is the receiver. b > 1 (b = 2, for this sequence).
      Usage: n distinctPowersOf: 2
      Answer: #(3 5 6 9 10 12 ...) [first n terms]"
      | k p q terms |
      terms := OrderedCollection new.
      k := 0.
      p := b.
      q := 1.
      [k < self] whileTrue:
             [[q < p and: [k < self]] whileTrue:
                       [k := k + 1.
                       terms add: p + q.
                       q := b * q].
             p := b * p.
             q := 1].
      ^terms as Array
    [by Hieronymus Fischer, Apr 20 2014]
    ------------
    
  • Smalltalk
    floorDistinctPowersOf: b
      "Answers an array which holds all the numbers b^i + b^j < n, i>j>=0, where n is the receiver.
      b > 1 (b = 2, for this sequence).
      Usage: n floorDistinctPowersOf: 2
      Answer: #(3 5 6 9 10 12 ...) [all terms < n]"
      | a n p q terms |
      terms := OrderedCollection new.
      n := self.
      p := b.
      q := 1.
      a := p + q.
      [a < n] whileTrue:
             [[q < p and: [a < n]] whileTrue:
                       [terms add: a.
                       q := b * q.
                       a := p + q].
             p := b * p.
             q := 1.
             a := p + q].
      ^terms as Array
    [by Hieronymus Fischer, Apr 20 2014]
    ------------
    
  • Smalltalk
    invertedDistinctPowersOf: b
      "Given a number m which is a distinct power of b, this method answers the index n such that there are uniquely defined i>j>=0 for which b^i + b^j = m, where m is the receiver;  b > 1 (b = 2, for this sequence).
      Usage: m invertedDistinctPowersOf: 2
      Answer: n such that a(n) = m, or, if no such n exists, min (k | a(k) >= m)"
      | n i j k m |
      m := self.
      i := m integerFloorLog: b.
      j := m - (b raisedToInteger: i) integerFloorLog: b.
      n := i * (i - 1) / 2 + 1 + j.
      ^n
    [by Hieronymus Fischer, Apr 20 2014]
    

Formula

a(n) = 2^trinv(n-1) + 2^((n-1)-((trinv(n-1)*(trinv(n-1)-1))/2)), i.e., 2^A002024(n)+2^A002262(n-1). - Antti Karttunen
a(n) = A059268(n-1) + A140513(n-1). A000120(a(n)) = 2. Complement of A161989. A151774(a(n)) = 1. - Reinhard Zumkeller, Jun 24 2009
A073267(a(n)) = 2. - Reinhard Zumkeller, Mar 07 2012
Start with A000051. If n is in sequence, then so is 2n. - Ralf Stephan, Aug 16 2013
a(n) = A057168(a(n-1)) for n>1 and a(1) = 3. - Marc LeBrun, Jan 01 2014
From Hieronymus Fischer, Apr 20 2014: (Start)
Formulas for a general parameter b according to a(n) = b^i + b^j, i>j>=0; b = 2 for this sequence.
a(n) = b^i + b^j, where i = floor((sqrt(8n - 1) + 1)/2), j = n - 1 - i*(i - 1)/2 [for a Smalltalk implementation see Prog section, method distinctPowersOf: b (2 versions)].
a(A000217(n)) = (b + 1)*b^(n-1) = b^n + b^(n-1).
a(A000217(n)+1) = 1 + b^(n+1).
a(n + 1 + floor((sqrt(8n - 1) + 1)/2)) = b*a(n).
a(n + 1 + floor(log_b(a(n)))) = b*a(n).
a(n + 1) = b^2/(b+1) * a(n) + 1, if n is a triangular number (s. A000217).
a(n + 1) = b*a(n) + (1-b)* b^floor((sqrt(8n - 1) + 1)/2), if n is not a triangular number.
The next term can also be calculated without using the index n. Let m be a term and i = floor(log_b(m)), then:
a(n + 1) = b*m + (1-b)* b^i, if floor(log_b(m/(b+1))) + 1 < i,
a(n + 1) = b^2/(b+1) * m + 1, if floor(log_b(m/(b+1))) + 1 = i.
Partial sum:
Sum_{k=1..n} a(k) = ((((b-1)*(j+1)+i-1)*b^(i-j) + b)*b^j - i)/(b-1), where i = floor((sqrt(8*n - 1) + 1)/2), j = n - 1 - i*(i - 1)/2.
Inverse:
For each sequence term m, the index n such that a(n) = m is determined by n := i*(i-1)/2 + j + 1, where i := floor(log_b(m)), j := floor(log_b(m - b^floor(log_b(m)))) [for a Smalltalk implementation see Prog section, method invertedDistinctPowersOf: b].
Inequalities:
a(n) <= (b+1)/b * b^floor(sqrt(2n)+1/2), equality holds for triangular numbers.
a(n) > b^floor(sqrt(2n)+1/2).
a(n) < b^sqrt(2n)*sqrt(b).
a(n) > b^sqrt(2n)/sqrt(b).
Asymptotic behavior:
lim sup a(n)/b^sqrt(2n) = sqrt(b).
lim inf a(n)/b^sqrt(2n) = 1/sqrt(b).
lim sup a(n)/b^(floor(sqrt(2n))) = b.
lim inf a(n)/b^(floor(sqrt(2n))) = 1.
lim sup a(n)/b^(floor(sqrt(2n)+1/2)) = (b+1)/b.
lim inf a(n)/b^(floor(sqrt(2n)+1/2)) = 1.
(End)
Sum_{n>=1} 1/a(n) = A179951. - Amiram Eldar, Oct 06 2020

Extensions

Edited by M. F. Hasler, Dec 23 2016

A059268 Concatenate subsequences [2^0, 2^1, ..., 2^n] for n = 0, 1, 2, ...

Original entry on oeis.org

1, 1, 2, 1, 2, 4, 1, 2, 4, 8, 1, 2, 4, 8, 16, 1, 2, 4, 8, 16, 32, 1, 2, 4, 8, 16, 32, 64, 1, 2, 4, 8, 16, 32, 64, 128, 1, 2, 4, 8, 16, 32, 64, 128, 256, 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048
Offset: 0

Views

Author

N. J. A. Sloane, Jan 23 2001

Keywords

Comments

Triangular array T(n,k) read by rows, where T(n,k) = i!*j! times coefficient of x^n*y^k in exp(x+2y).
T(n,k) is the number of subsets of {0,1,...,n} whose largest element is k. To see this, let A be any subset of the 2^k subsets of {0,1,...,k-1}. Then there are 2^k subsets of the form (A U {k}). See example below. - Dennis P. Walsh, Nov 27 2011
Sequence B is called a reluctant sequence of sequence A, if B is triangle array read by rows: row number k coincides with first k elements. A059268 is reluctant sequence of sequence A000079. - Boris Putievskiy, Dec 17 2012

Examples

			T(4,3)=8 since there are 8 subsets of {0,1,2,3,4} whose largest element is 3, namely, {3}, {0,3}, {1,3}, {2,3}, {0,1,3}, {0,2,3}, {1,2,3}, and {0,1,2,3}.
Triangle starts:
  1;
  1, 2;
  1, 2, 4;
  1, 2, 4, 8;
  1, 2, 4, 8, 16;
  1, 2, 4, 8, 16, 32;
  ...
		

Crossrefs

Cf. A140531.
Cf. A000079.
Cf. A131816.
Row sums give A126646.

Programs

  • Haskell
    a059268 n k = a059268_tabl !! n !! k
    a059268_row n = a059268_tabl !! n
    a059268_tabl = iterate (scanl (+) 1) [1]
    -- Reinhard Zumkeller, Apr 18 2013, Jul 05 2012
    
  • Maple
    seq(seq(2^k,k=0..n),n=0..10);
  • Mathematica
    Table[2^k, {n, 0, 11}, {k, 0, n}] // Flatten (* Jean-François Alcover, Jun 10 2013 *)
  • Python
    from math import isqrt
    def A059268(n):
        a = (m:=isqrt(k:=n+1<<1))-(k<=m*(m+1))
        return 1<>1) # Chai Wah Wu, Feb 24 2025

Formula

E.g.f.: exp(x+2*y) (T coordinates).
a(n) = A018900(n+1) - A140513(n). - Reinhard Zumkeller, Jun 24 2009
T(n,k) = A173786(n-1,k-1) - A173787(n-1,k-1), 0Reinhard Zumkeller, Feb 28 2010
T(n,k) = 2^k. - Reinhard Zumkeller, Jan 29 2010
As a linear array, the sequence is a(n) = 2^(n-1-t*(t+1)/2), where t = floor((-1+sqrt(8*n-7))/2), n>=1. - Boris Putievskiy, Dec 17 2012
As a linear array, the sequence is a(n) = 2^(n-1-t*(t+1)/2), where t = floor(sqrt(2*n)-1/2), n>=1. - Zhining Yang, Jun 09 2017

Extensions

Formula corrected by Reinhard Zumkeller, Feb 23 2010

A173786 Triangle read by rows: T(n,k) = 2^n + 2^k, 0 <= k <= n.

Original entry on oeis.org

2, 3, 4, 5, 6, 8, 9, 10, 12, 16, 17, 18, 20, 24, 32, 33, 34, 36, 40, 48, 64, 65, 66, 68, 72, 80, 96, 128, 129, 130, 132, 136, 144, 160, 192, 256, 257, 258, 260, 264, 272, 288, 320, 384, 512, 513, 514, 516, 520, 528, 544, 576, 640, 768, 1024, 1025, 1026, 1028, 1032, 1040, 1056, 1088, 1152, 1280, 1536, 2048
Offset: 0

Views

Author

Reinhard Zumkeller, Feb 28 2010

Keywords

Comments

Essentially the same as A048645. - T. D. Noe, Mar 28 2011

Examples

			Triangle begins as:
     2;
     3,    4;
     5,    6,    8;
     9,   10,   12,   16;
    17,   18,   20,   24,   32;
    33,   34,   36,   40,   48,   64;
    65,   66,   68,   72,   80,   96,  128;
   129,  130,  132,  136,  144,  160,  192,  256;
   257,  258,  260,  264,  272,  288,  320,  384,  512;
   513,  514,  516,  520,  528,  544,  576,  640,  768, 1024;
  1025, 1026, 1028, 1032, 1040, 1056, 1088, 1152, 1280, 1536, 2048;
		

Crossrefs

Programs

  • Magma
    [2^n + 2^k: k in [0..n], n in [0..12]]; // G. C. Greubel, Jul 07 2021
    
  • Mathematica
    Flatten[Table[2^n + 2^m, {n,0,10}, {m, 0, n}]] (* T. D. Noe, Jun 18 2013 *)
  • PARI
    A173786(n) = { my(c = (sqrtint(8*n + 1) - 1) \ 2); 1 << c + 1 << (n - binomial(c + 1, 2)); }; \\ Antti Karttunen, Feb 29 2024, after David A. Corneth's PARI-program in A048645
    
  • Python
    from math import isqrt, comb
    def A173786(n):
        a = (m:=isqrt(k:=n+1<<1))-(k<=m*(m+1))
        return (1<Chai Wah Wu, Jun 20 2025
  • Sage
    flatten([[2^n + 2^k for k in (0..n)] for n in (0..12)]) # G. C. Greubel, Jul 07 2021
    

Formula

1 <= A000120(T(n,k)) <= 2.
For n>0, 0<=kA048645(n+1,k+2) and T(n,n) = A048645(n+2,1).
Row sums give A006589(n).
Central terms give A161168(n).
T(2*n+1,n) = A007582(n+1).
T(2*n+1,n+1) = A028403(n+1).
T(n,k) = A140513(n,k) - A173787(n,k), 0<=k<=n.
T(n,k) = A059268(n+1,k+1) + A173787(n,k), 0
T(n,k) * A173787(n,k) = A173787(2*n,2*k), 0<=k<=n.
T(n,0) = A000051(n).
T(n,1) = A052548(n) for n>0.
T(n,2) = A140504(n) for n>1.
T(n,3) = A175161(n-3) for n>2.
T(n,4) = A175162(n-4) for n>3.
T(n,5) = A175163(n-5) for n>4.
T(n,n-4) = A110287(n-4) for n>3.
T(n,n-3) = A005010(n-3) for n>2.
T(n,n-2) = A020714(n-2) for n>1.
T(n,n-1) = A007283(n-1) for n>0.
T(n,n) = 2*A000079(n).

Extensions

Typo in first comment line fixed by Reinhard Zumkeller, Mar 07 2010

A173787 Triangle read by rows: T(n,k) = 2^n - 2^k, 0 <= k <= n.

Original entry on oeis.org

0, 1, 0, 3, 2, 0, 7, 6, 4, 0, 15, 14, 12, 8, 0, 31, 30, 28, 24, 16, 0, 63, 62, 60, 56, 48, 32, 0, 127, 126, 124, 120, 112, 96, 64, 0, 255, 254, 252, 248, 240, 224, 192, 128, 0, 511, 510, 508, 504, 496, 480, 448, 384, 256, 0, 1023, 1022, 1020, 1016, 1008, 992, 960, 896, 768, 512, 0
Offset: 0

Author

Reinhard Zumkeller, Feb 28 2010

Keywords

Examples

			Triangle begins as:
   0;
   1,  0;
   3,  2,  0;
   7,  6,  4,  0;
  15, 14, 12,  8,  0;
  31, 30, 28, 24, 16, 0;
		

Programs

  • Magma
    [2^n -2^k: k in [0..n], n in [0..15]]; // G. C. Greubel, Jul 13 2021
    
  • Mathematica
    Table[2^n -2^k, {n,0,15}, {k,0,n}]//Flatten (* G. C. Greubel, Jul 13 2021 *)
  • Sage
    flatten([[2^n -2^k for k in (0..n)] for n in (0..15)]) # G. C. Greubel, Jul 13 2021

Formula

A000120(T(n,k)) = A025581(n,k).
Row sums give A000337.
Central terms give A020522.
T(2*n+1, n) = A006516(n+1).
T(2*n+3, n+2) = A059153(n).
T(n, k) = A140513(n,k) - A173786(n,k), 0 <= k <= n.
T(n, k) = A173786(n,k) - A059268(n+1,k+1), 0 < k <= n.
T(2*n, 2*k) = T(n,k) * A173786(n,k), 0 <= k <= n.
T(n, 0) = A000225(n).
T(n, 1) = A000918(n) for n>0.
T(n, 2) = A028399(n) for n>1.
T(n, 3) = A159741(n-3) for n>3.
T(n, 4) = A175164(n-4) for n>4.
T(n, 5) = A175165(n-5) for n>5.
T(n, 6) = A175166(n-6) for n>6.
T(n, n-4) = A110286(n-4) for n>3.
T(n, n-3) = A005009(n-3) for n>2.
T(n, n-2) = A007283(n-2) for n>1.
T(n, n-1) = A000079(n-1) for n>0.
T(n, n) = A000004(n).

A104709 Triangle read by rows: T(n,k) = Sum_{j=0..n} 2^(n-j)*binomial(j,k) for n >= 0 and 0 <= k <= n; also, Riordan array (1/((1-x)*(1-2*x)), x/(1-x)).

Original entry on oeis.org

1, 3, 1, 7, 4, 1, 15, 11, 5, 1, 31, 26, 16, 6, 1, 63, 57, 42, 22, 7, 1, 127, 120, 99, 64, 29, 8, 1, 255, 247, 219, 163, 93, 37, 9, 1, 511, 502, 466, 382, 256, 130, 46, 10, 1, 1023, 1013, 968, 848, 638, 386, 176, 56, 11, 1, 2047, 2036, 1981, 1816, 1486, 1024, 562, 232, 67
Offset: 0

Author

Gary W. Adamson, Mar 19 2005

Keywords

Comments

This array (A104709) is the mirror of the fission, A054143, of the polynomial sequence ((x+1)^n: n >= 0) by the polynomial sequence (q(n,x): n >= 0) given by q(n,x) = x^n + x^(n-1) + ... + x + 1. See A193842 for the definition of fission. - Clark Kimberling, Aug 07 2011
The elements of the matrix inverse appear to be T^(-1)(n,k) = (-1)^(n+k)*A110813(n,k) assuming the same offset in both triangles. - R. J. Mathar, Mar 15 2013
From Paul Curtz, Jun 12 2019: (Start)
Numerators of the triangle [Curtz, page 15, triangle (E)]:
1/2;
3/4, 1/4;
7/8, 4/8, 1/8;
15/16, 11/16, 5/16, 1/16;
31/32, 26/31, 16/32, 6/32, 1/32;
63/64, 57/64, 42/64, 22/64, 7/64, 1/64;
...
Denominators - Numerators: Triangle A054143.
1;
1, 3;
1, 4, 7;
1, 5, 11, 15;
...
(E) is a transform which accelerates the convergence of series.
For log(2) = 1 - 1/2 + 1/3 - 1/4 ... = 0.6931..., we have
1*(1/2) = 1/2,
1*(3/4) - (1/2)*(1/4) = 5/8,
1*(7/8) - (1/2)*(4/8) + (1/3)*(1/8) = 2/3,
1*(15/16) - (1/2)*(11/16) + (1/3)*(5/16) - (1/4)*1/16 = 131/192,
...
This is A068566/A068565. (End)

Examples

			Triangle T(n,k) (with rows n >= 0 and columns k = 0..n) begins:
   1;
   3,  1;
   7,  4,  1;
  15, 11,  5,  1;
  31, 26, 16,  6,  1;
  63, 57, 42, 22,  7,  1;
  ...
		

Programs

  • Maple
    A104709_row := proc(n) add(add(binomial(n,n-i)*x^(n-k-1),i=0..k),k=0..n-1);
    coeffs(sort(%)) end; seq(print(A104709_row(n)),n=1..6); # Peter Luschny, Sep 29 2011
  • Mathematica
    z = 10;
    p[n_, x_] := (x + 1)^n;
    q[0, x_] := 1; q[n_, x_] := x*q[n - 1, x] + 1;
    p1[n_, k_] := Coefficient[p[n, x], x^k];
    p1[n_, 0] := p[n, x] /. x -> 0;
    d[n_, x_] := Sum[p1[n, k]*q[n - 1 - k, x], {k, 0, n - 1}]
    h[n_] := CoefficientList[d[n, x], {x}]
    TableForm[Table[Reverse[h[n]], {n, 0, z}]]
    Flatten[Table[Reverse[h[n]], {n, -1, z}]] (* A054143 *)
    TableForm[Table[h[n], {n, 0, z}]]
    Flatten[Table[h[n], {n, -1, z}]] (* A104709 *)
    (* Clark Kimberling, Aug 07 2011 *)

Formula

Begin with A055248 as a triangle, delete leftmost column.
The Riordan array factors as (1/(1-2*x), x)*(1/(1-x), x/(1-x)) - the sequence array for 2^n times Pascal's triangle. - Paul Barry, Aug 05 2005
T(n,k) = Sum_{j=0..n-k} C(n-j, k)*2^j. - Paul Barry, Jan 12 2006
T(n,k) = 3*T(n-1,k) + T(n-1,k-1) - 2*T(n-2,k) - 2*T(n-2,k-1), T(0,0) = 1, T(n,k) = 0 if k < 0 or if k > n. - Philippe Deléham, Nov 30 2013
Working with an offset of 0, we have exp(x) * (e.g.f. for row n) = (e.g.f. for diagonal n). For example, for n = 3 we have exp(x)*(15 + 11*x + 5*x^2/2! + x^3/3!) = 15 + 26*x + 42*x^2/2! + 64*x^3/3! + 93*x^4/4! + .... The same property holds more generally for Riordan arrays of the form (f(x), x/(1 - x)). - Peter Bala, Dec 21 2014
From Petros Hadjicostas, Jun 05 2020: (Start)
Bivariate o.g.f.: A(x,y) = Sum_{n,k >= 0} T(n,k)*x^n*y^k = 1/(1 - 3*x - x*y + 2*x^2 + 2*x^2*y) = 1/((1 - 2*x)*(1 - x*(y+1))).
The o.g.f. of the n-th row is (2^(n+1) - (1 + y)^(n+1))/(1 - y).
Let B(x,y) be the bivariate o.g.f. of triangular array A054143. Because A054143 is the mirror image of the current array, we have A(x,y) = B(x*y, 1/y) and B(x,y) = A(x*y, 1/y). This makes it easy to identify lower diagonals of the array.
For example, if we want to identify the second lower diagonal of the array (i.e., 7, 11, 16, 22, ...), we take the 2nd derivative of B(x,y) with respect to y, set y = 0, and divide by 2!. (Note that columns in A054143 start at k = 0.) We get the g.f. x^2*(7 - 10*x + 4*x^2)/(1 - x)^3.
It is then easy to derive that T(n,n-2) = A000124(n+1) = (n+1)*(n+2)/2 + 1 for n >= 2 (by ignoring the first three terms of A000124). Of course, in the current case, it is much easier to use the formula for T(n,k) to find T(n,n-2). (End)
T(n,0) = 2^(n+1) - 1 for n >= 0; T(n,k) = T(n-1,k) + T(n-1,k-1) for 1 <= k <= n. - Peter Bala, Jan 30 2023
T(n,1) = 2^(n+1) - n - 2 = A000295(n+1) for n >= 1. - Bernard Schott, Feb 22 2023

Extensions

Name edited and offset changed by Petros Hadjicostas, Jun 04 2020

A140589 Triangle A(k,n) = (-2)^k+2^n read by rows.

Original entry on oeis.org

2, -1, 0, 5, 6, 8, -7, -6, -4, 0, 17, 18, 20, 24, 32, -31, -30, -28, -24, -16, 0, 65, 66, 68, 72, 80, 96, 128, -127, -126, -124, -120, -112, -96, -64, 0, 257, 258, 260, 264, 272, 288, 320, 384, 512, -511, -510, -508, -504, -496, -480, -448, -384, -256, 0, 1025, 1026, 1028, 1032
Offset: 0

Author

Paul Curtz, Jul 06 2008

Keywords

Comments

The flattened sequence a(A000217(k)+j)=A(k,j) obeys a(n+1)-2a(n)= -5, 2, 5, -4, -4, -23, 8, 8, 8, 17, -16, -16, -16, -16, -95, ..., which is a dispersion of 2, -4, -4, 8, 8, 8, ... (a signed version of A140513) with -5, 5, -23, 17, -95, 65,... The latter sequence is A(k,0)-2*A(k-1,k-1), an alternation of the negative of A140529 with each second element of A000051.

Examples

			Rows starting at k=0: (2), (-1,0); (5, 6, 8); (-7,-6,-4,0); (17,18,20,24,32);...
		

Formula

A(k,n) = A000079(n)+A122803(k).

Extensions

Edited by R. J. Mathar, Jul 08 2008

A140946 Triangle T(n,k) = (-2)^n*(-1)^k if kA001045(n+1).

Original entry on oeis.org

1, -2, -1, 4, -4, 3, -8, 8, -8, -5, 16, -16, 16, -16, 11, -32, 32, -32, 32, -32, -21, 64, -64, 64, -64, 64, -64, 43, -128, 128, -128, 128, -128, 128, -128, -85, 256, -256, 256, -256, 256, -256, 256, -256, 171, -512, 512, -512, 512, -512, 512, -512, 512, -512, -341, 1024, -1024, 1024, -1024, 1024
Offset: 0

Author

Paul Curtz, Jul 24 2008

Keywords

Comments

The sequence appears if the values b(n+1)-2*b(n) are computed from the (flattened) sequence b(.)=A140944.
Reading the triangle by rows, taking absolute values and removing duplicates we obtain A112387.

Examples

			1;
-2,-1;
4,-4,3;
-8,8,-8,-5;
16,-16,16,-16,11;
-32,32,-32,32,-32,-21;
64,-64,64,-64,64,-64,43;
-128,128,-128,128,-128,128,-128,-85;
		

Crossrefs

Programs

  • Mathematica
    (* A = A140944 *) A[0, 0] = 0; A[1, 0] = A[0, 1] = 1; A[0, k_] := A[0, k] = A[0, k-1] + 2*A[0, k-2]; A[n_, n_] = 0; A[n_, k_] := A[n, k] = A[n-1, k+1] - A[n-1, k];  T[n_, n_] := T[n, n] = A[n+1, 0] - 2*A[n, n]; T[n_, k_] := T[n, k] = A[n, k+1] - 2*A[n, k]; Table[T[n, k], {n, 0, 10}, {k, 0, n}] // Flatten (* Jean-François Alcover, Dec 17 2014 *)

Formula

T(n,k) = A140944(n,k+1)-2*A140944(n,k), k
T(n,n) = A140944(n+1,0) -2*A140944(n,n).

Extensions

Edited by R. J. Mathar, Jul 06 2011
Showing 1-7 of 7 results.