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-10 of 31 results. Next

A000918 a(n) = 2^n - 2.

Original entry on oeis.org

-1, 0, 2, 6, 14, 30, 62, 126, 254, 510, 1022, 2046, 4094, 8190, 16382, 32766, 65534, 131070, 262142, 524286, 1048574, 2097150, 4194302, 8388606, 16777214, 33554430, 67108862, 134217726, 268435454, 536870910, 1073741822, 2147483646, 4294967294, 8589934590, 17179869182, 34359738366, 68719476734, 137438953470
Offset: 0

Views

Author

Keywords

Comments

For n > 1, a(n) is the expected number of tosses of a fair coin to get n-1 consecutive heads. - Pratik Poddar, Feb 04 2011
For n > 2, Sum_{k=1..a(n)} (-1)^binomial(n, k) = A064405(a(n)) + 1 = 0. - Benoit Cloitre, Oct 18 2002
For n > 0, the number of nonempty proper subsets of an n-element set. - Ross La Haye, Feb 07 2004
Numbers j such that abs( Sum_{k=0..j} (-1)^binomial(j, k)*binomial(j + k, j - k) ) = 1. - Benoit Cloitre, Jul 03 2004
For n > 2 this formula also counts edge-rooted forests in a cycle of length n. - Woong Kook (andrewk(AT)math.uri.edu), Sep 08 2004
For n >= 1, conjectured to be the number of integers from 0 to (10^n)-1 that lack 0, 1, 2, 3, 4, 5, 6 and 7 as a digit. - Alexandre Wajnberg, Apr 25 2005
Beginning with a(2) = 2, these are the partial sums of the subsequence of A000079 = 2^n beginning with A000079(1) = 2. Hence for n >= 2 a(n) is the smallest possible sum of exactly one prime, one semiprime, one triprime, ... and one product of exactly n-1 primes. A060389 (partial sums of the primorials, A002110, beginning with A002110(1)=2) is the analog when all the almost primes must also be squarefree. - Rick L. Shepherd, May 20 2005
From the second term on (n >= 1), the binary representation of these numbers is a 0 preceded by (n - 1) 1's. This pattern (0)111...1110 is the "opposite" of the binary 2^n+1: 1000...0001 (cf. A000051). - Alexandre Wajnberg, May 31 2005
The numbers 2^n - 2 (n >= 2) give the positions of 0's in A110146. Also numbers k such that k^(k + 1) = 0 mod (k + 2). - Zak Seidov, Feb 20 2006
Partial sums of A155559. - Zerinvary Lajos, Oct 03 2007
Number of surjections from an n-element set onto a two-element set, with n >= 2. - Mohamed Bouhamida, Dec 15 2007
It appears that these are the numbers n such that 3*A135013(n) = n*(n + 1), thus answering Problem 2 on the Mathematical Olympiad Foundation of Japan, Final Round Problems, Feb 11 1993 (see link Japanese Mathematical Olympiad).
Let P(A) be the power set of an n-element set A and R be a relation on P(A) such that for all x, y of P(A), xRy if x is a proper subset of y or y is a proper subset of x and x and y are disjoint. Then a(n+1) = |R|. - Ross La Haye, Mar 19 2009
The permutohedron Pi_n has 2^n - 2 facets [Pashkovich]. - Jonathan Vos Post, Dec 17 2009
First differences of A005803. - Reinhard Zumkeller, Oct 12 2011
For n >= 1, a(n + 1) is the smallest even number with bit sum n. Cf. A069532. - Jason Kimberley, Nov 01 2011
a(n) is the number of branches of a complete binary tree of n levels. - Denis Lorrain, Dec 16 2011
For n>=1, a(n) is the number of length-n words on alphabet {1,2,3} such that the gap(w)=1. For a word w the gap g(w) is the number of parts missing between the minimal and maximal elements of w. Generally for words on alphabet {1,2,...,m} with g(w)=g>0 the e.g.f. is Sum_{k=g+2..m} (m - k + 1)*binomial((k - 2),g)*(exp(x) - 1)^(k - g). a(3)=6 because we have: 113, 131, 133, 311, 313, 331. Cf. A240506. See the Heubach/Mansour reference. - Geoffrey Critzer, Apr 13 2014
For n > 0, a(n) is the minimal number of internal nodes of a red-black tree of height 2*n-2. See the Oct 02 2015 comment under A027383. - Herbert Eberle, Oct 02 2015
Conjecture: For n>0, a(n) is the least m such that A007814(A000108(m)) = n-1. - L. Edson Jeffery, Nov 27 2015
Actually this follows from the procedure for determining the multiplicity of prime p in C(n) given in A000108 by Franklin T. Adams-Watters: For p=2, the multiplicity is the number of 1 digits minus 1 in the binary representation of n+1. Obviously, the smallest k achieving "number of 1 digits" = k is 2^k-1. Therefore C(2^k-2) is divisible by 2^(k-1) for k > 0 and there is no smaller m for which 2^(k-1) divides C(m) proving the conjecture. - Peter Schorn, Feb 16 2020
For n >= 0, a(n) is the largest number you can write in bijective base-2 (a.k.a. the dyadic system, A007931) with n digits. - Harald Korneliussen, May 18 2019
The terms of this sequence are also the sum of the terms in each row of Pascal's triangle other than the ones. - Harvey P. Dale, Apr 19 2020
For n > 1, binomial(a(n),k) is odd if and only if k is even. - Charlie Marion, Dec 22 2020
For n >= 2, a(n+1) is the number of n X n arrays of 0's and 1's with every 2 X 2 square having density exactly 2. - David desJardins, Oct 27 2022
For n >= 1, a(n+1) is the number of roots of unity in the unique degree-n unramified extension of the 2-adic field Q_2. Note that for each p, the unique degree-n unramified extension of Q_p is the splitting field of x^(p^n) - x, hence containing p^n - 1 roots of unity for p > 2 and 2*(2^n - 1) for p = 2. - Jianing Song, Nov 08 2022

Examples

			a(4) = 14 because the 14 = 6 + 4 + 4 rationals (in lowest terms) for n = 3 are (see the Jun 14 2017 formula above): 1/2, 1, 3/2, 2, 5/2, 3; 1/4, 3/4, 5/4, 7/4; 1/8, 3/8, 5/8, 7/8. - _Wolfdieter Lang_, Jun 14 2017
		

References

  • H. T. Davis, Tables of the Mathematical Functions. Vols. 1 and 2, 2nd ed., 1963, Vol. 3 (with V. J. Fisher), 1962; Principia Press of Trinity Univ., San Antonio, TX, Vol. 2, p. 212.
  • Ralph P. Grimaldi, Discrete and Combinatorial Mathematics: An Applied Introduction, Fifth Edition, Addison-Wesley, 2004, p. 134. - Mohammad K. Azarian, Oct 27 2011
  • S. Heubach and T. Mansour, Combinatorics of Compositions and Words, Chapman and Hall, 2009 page 86, Exercise 3.16.
  • J. Riordan, An Introduction to Combinatorial Analysis, Wiley, 1958, p. 33.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • A. H. Voigt, Theorie der Zahlenreihen und der Reihengleichungen, Goschen, Leipzig, 1911, p. 31.

Crossrefs

Row sums of triangle A026998.
Cf. A058809 (3^n-3, n>0).

Programs

  • Haskell
    a000918 = (subtract 2) . (2 ^)
    a000918_list = iterate ((subtract 2) . (* 2) . (+ 2)) (- 1)
    -- Reinhard Zumkeller, Apr 23 2013
    
  • Magma
    [2^n - 2: n in [0..40]]; // Vincenzo Librandi, Jun 23 2011
    
  • Maple
    seq(2^n-2,n=0..20) ;
  • Mathematica
    Table[2^n - 2, {n, 0, 29}] (* Alonso del Arte, Dec 01 2012 *)
  • PARI
    a(n)=2^n-2 \\ Charles R Greathouse IV, Jun 16 2011
    
  • Python
    def A000918(n): return (1<Chai Wah Wu, Jun 10 2025

Formula

a(n) = 2*A000225(n-1).
G.f.: 1/(1 - 2*x) - 2/(1 - x), e.g.f.: (e^x - 1)^2 - 1. - Dan Fux (dan.fux(AT)OpenGaia.com or danfux(AT)OpenGaia.com), Apr 07 2001
For n >= 1, a(n) = A008970(n + 1, 2). - Philippe Deléham, Feb 21 2004
G.f.: (3*x - 1)/((2*x - 1)*(x - 1)). - Simon Plouffe in his 1992 dissertation for the sequence without the leading -1
a(n) = 2*a(n - 1) + 2. - Alexandre Wajnberg, Apr 25 2005
a(n) = A000079(n) - 2. - Omar E. Pol, Dec 16 2008
a(n) = A058896(n)/A052548(n). - Reinhard Zumkeller, Feb 14 2009
a(n) = A164874(n - 1, n - 1) for n > 1. - Reinhard Zumkeller, Aug 29 2009
a(n) = A173787(n,1); a(n) = A028399(2*n)/A052548(n), n > 0. - Reinhard Zumkeller, Feb 28 2010
a(n + 1) = A027383(2*n - 1). - Jason Kimberley, Nov 02 2011
G.f.: U(0) - 1, where U(k) = 1 + x/(2^k + 2^k/(x - 1 - x^2*2^(k + 1)/(x*2^(k + 1) - (k + 1)/U(k + 1) ))); (continued fraction, 3rd kind, 4-step). - Sergei N. Gladkovskii, Dec 01 2012
a(n+1) is the sum of row n in triangle A051601. - Reinhard Zumkeller, Aug 05 2013
a(n+1) = A127330(n,0). - Reinhard Zumkeller, Nov 16 2013
a(n) = Sum_{k=1..n-1} binomial(n, k) for n > 0. - Dan McCandless, Nov 14 2015
From Miquel Cerda, Aug 16 2016: (Start)
a(n) = A000225(n) - 1.
a(n) = A125128(n-1) - A000325(n).
a(n) = A095151(n) - A125128(n) - 1. (End)
a(n+1) = 2*(n + Sum_{j=1..n-1} (n-j)*2^(j-1)), n >= 1. This is the number of the rationals k/2, k = 1..2*n for n >= 1 and (2*k+1)/2^j for j = 2..n, n >= 2, and 2*k+1 < n-(j-1). See the example for n = 3 below. Motivated by the proposal A287012 by Mark Rickert. - Wolfdieter Lang, Jun 14 2017

Extensions

Maple programs fixed by Vaclav Kotesovec, Dec 13 2014

A052548 a(n) = 2^n + 2.

Original entry on oeis.org

3, 4, 6, 10, 18, 34, 66, 130, 258, 514, 1026, 2050, 4098, 8194, 16386, 32770, 65538, 131074, 262146, 524290, 1048578, 2097154, 4194306, 8388610, 16777218, 33554434, 67108866, 134217730, 268435458, 536870914, 1073741826, 2147483650
Offset: 0

Views

Author

encyclopedia(AT)pommard.inria.fr, Jan 25 2000

Keywords

Comments

The most "compact" sequence that satisfies Bertrand's Postulate. Begin with a(1) = 3 = n, then 2n - 2 = 4 = n_1, 2n_1 - 2 = 6 = n_2, 2n_2 - 2 = 10, etc. = a(n), hence there is guaranteed to be at least one prime between successive members of the sequence. - Andrew S. Plewe, Dec 11 2007
Number of 2-sided prudent polygons of area n, for n>0, see Beaton, p. 5. - Jonathan Vos Post, Nov 30 2010

Crossrefs

Programs

  • Haskell
    a052548 = (+ 2) . a000079
    a052548_list = iterate ((subtract 2) . (* 2)) 3
    -- Reinhard Zumkeller, Sep 05 2015
  • Magma
    [2^n + 2: n in [0..35]]; // Vincenzo Librandi, Apr 29 2011
    
  • Maple
    spec := [S,{S=Union(Sequence(Union(Z,Z)),Sequence(Z),Sequence(Z))},unlabeled]: seq(combstruct[count](spec,size=n), n=0..20);
  • Mathematica
    2^Range[0,40]+2 (* Harvey P. Dale, Jun 26 2012 *)
  • PARI
    a(n)=1<Charles R Greathouse IV, Nov 20 2011
    

Formula

G.f.: (3-5*x)/((1-2*x)*(1-x)) = (3-5*x)/(1 - 3*x + 2*x^2) = 2/(1-x) + 1/(1-2*x).
a(0)=3, a(1)=4, a(n) = 3*a(n-1) - 2*a(n-2).
a(n) = A058896(n)/A000918(n), for n>0. - Reinhard Zumkeller, Feb 14 2009
a(n) = A173786(n,1), for n>0. - Reinhard Zumkeller, Feb 28 2010
a(n)*A000918(n) = A028399(2*n), for n>0. - Reinhard Zumkeller, Feb 28 2010
a(0)=3, a(n) = 2*a(n-1) - 2. - Vincenzo Librandi, Aug 06 2010
E.g.f.: (2 + exp(x))*exp(x). - Ilya Gutkovskiy, Aug 16 2016

Extensions

More terms from James Sellers, Jun 06 2000

A140504 a(n) = 2^n + 4.

Original entry on oeis.org

5, 6, 8, 12, 20, 36, 68, 132, 260, 516, 1028, 2052, 4100, 8196, 16388, 32772, 65540, 131076, 262148, 524292, 1048580, 2097156, 4194308, 8388612, 16777220, 33554436, 67108868, 134217732, 268435460, 536870916, 1073741828
Offset: 0

Views

Author

Paul Curtz, Jun 30 2008

Keywords

Crossrefs

Cf. A000051 (m=0), A052548 (m=2), this sequence (m=4), A153973 (m=6), A231643 (m=5), A175161 (m=8), A175162 (m=16), A175163 (m=32).

Programs

Formula

G.f.: (5 - 9*x)/((1 - x)*(1 - 2*x)). - Jaume Oliver Lafont, Aug 30 2009
a(n) = 2*a(n-1) - 4 with a(0) = 5. - Vincenzo Librandi, Nov 24 2009
From Reinhard Zumkeller, Feb 28 2010: (Start)
a(n) = A173786(n,2) for n > 1.
a(n+2)*A028399(n) = A175164(2*n). (End)
From G. C. Greubel, Jul 08 2021: (Start)
a(n) = m*(2^(n-2) + 1), with m = 4.
E.g.f.: exp(2*x) + 4*exp(x). (End)

Extensions

More terms from Stefan Steinerberger, Aug 04 2008

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

Views

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

A173033 Second diagonal under the main diagonal in A172119 written in a square (see comment).

Original entry on oeis.org

1, 4, 12, 28, 60, 124, 252, 508, 1020, 2044, 4092, 8188, 16380, 32764, 65532, 131068, 262140, 524284, 1048572, 2097148, 4194300, 8388604, 16777212, 33554428, 67108860, 134217724, 268435452, 536870908, 1073741820, 2147483644, 4294967292, 8589934588, 17179869180
Offset: 0

Views

Author

Richard Choulet, Feb 07 2010

Keywords

Comments

The Granvik array of A172119 is here written in "square": 1 :: 1 :: 1 :: 1 :: 1 :: 1 :: 1 :: 1 :: 1 :: 1 // 1 :: 2 :: 2 :: 2 :: 2 :: 2 :: 2 :: 2 :: 2 :: 2 // 1 :: 3 :: 4 :: 4 :: 4 :: 4 :: 4 :: 4 :: 4 :: 4 // 1 :: 4 :: 7 :: 8 :: 8 :: 8 :: 8 :: 8 :: 8 :: 8 // 1 :: 5 :: 12 :: 15 :: 16 :: 16 :: 16 :: 16 :: 16 :: 16 // 1 :: 6 :: 20 :: 28 :: 31 :: 32 :: 32 :: 32 :: 32 :: 32 // 1 :: 7 :: 33 :: 52 :: 60 :: 63 :: 64 :: 64 :: 64 :: 64 // 1 :: 8 :: 54 :: 96 :: 116 :: 124 :: 127 :: 128 :: 128 :: 128 // 1 :: 9 :: 88 :: 177 :: 224 :: 244 :: 252 :: 255 :: 256 :: 256 //
For n>0 a(n) is also the number of ways to place n^2 non-attacking kings on a 2n X 2n toroidal chessboard. - Vaclav Kotesovec, Aug 28 2011
The number of n-step self-avoiding walks on a 2D square lattice where no step is to a lattice point closer to the origin than the current point. - Scott R. Shannon, Dec 15 2023

Examples

			a(3) = 2^5 - 4 = 32 - 4 = 28.
		

Crossrefs

Programs

  • Maple
    taylor(4/(1-2*z)-4/(1-z)+1,z=0,31);
  • Mathematica
    CoefficientList[Series[4 / (1 - 2 x) - 4 / (1 - x) + 1, {x, 0, 60}], x] (* Vincenzo Librandi, May 29 2013 *)
  • PARI
    my(x='x+O('x^50)); Vec(4/(1-2*x)-4/(1-x)+1) \\ Altug Alkan, Nov 02 2015
    
  • Sage
    def a(n): return 1 if 0==n else 2**(n+2) - 4 # Torlach Rush, Jan 09 2025

Formula

G.f.: 4/(1-2*x) - 4/(1-x) + 1.
a(n) = 2^(n+2) - 4 for n>=1, a(0)=1.
a(n) = A028399(n+2), n>0. - R. J. Mathar, Feb 21 2010
a(n) = A240951(n+3) - 4. - Omar E. Pol, Feb 17 2015
a(n) = 2*a(n-1) + 4 for n>1. - J. Conrad, Nov 01 2015
a(n) = 3*a(n-1)-2*a(n-2) for n>2. - Colin Barker, Nov 03 2015
E.g.f.: (1 - 2*exp(x))^2. - Stefano Spezia, May 03 2023

A159741 a(n) = 8*(2^n - 1).

Original entry on oeis.org

8, 24, 56, 120, 248, 504, 1016, 2040, 4088, 8184, 16376, 32760, 65528, 131064, 262136, 524280, 1048568, 2097144, 4194296, 8388600, 16777208, 33554424, 67108856, 134217720, 268435448, 536870904, 1073741816, 2147483640, 4294967288, 8589934584, 17179869176, 34359738360
Offset: 1

Views

Author

Al Hakanson (hawkuu(AT)gmail.com), Apr 20 2009

Keywords

Comments

Fifth diagonal of the array which contains m-acci numbers in the m-th row.
The base array is constructed from m-acci numbers starting each with 1, 1, and 2 and filling one row of the table (see the examples).
The main and the upper diagonals of the table are the powers of 2, A000079.
The first subdiagonal is essentially A000225, followed by essentially A036563.
The next subdiagonal is this sequence here, followed by A159742, A159743, A159744, A159746, A159747, A159748.
a(n) written in base 2: 1000, 11000, 111000, 1111000, ..., i.e., n times 1 and 3 times 0 (A161770). - Jaroslav Krizek, Jun 18 2009
Also numbers for which n^8/(n+8) is an integer. - Vicente Izquierdo Gomez, Jan 03 2013

Examples

			From _R. J. Mathar_, Apr 22 2009: (Start)
The base table is
.1..1....1....1....1....1....1....1....1....1....1....1....1....1
.1..1....1....1....1....1....1....1....1....1....1....1....1....1
.2..2....2....2....2....2....2....2....2....2....2....2....2....2
.0..2....3....4....4....4....4....4....4....4....4....4....4....4
.0..2....5....7....8....8....8....8....8....8....8....8....8....8
.0..2....8...13...15...16...16...16...16...16...16...16...16...16
.0..2...13...24...29...31...32...32...32...32...32...32...32...32
.0..2...21...44...56...61...63...64...64...64...64...64...64...64
.0..2...34...81..108..120..125..127..128..128..128..128..128..128
.0..2...55..149..208..236..248..253..255..256..256..256..256..256
.0..2...89..274..401..464..492..504..509..511..512..512..512..512
.0..2..144..504..773..912..976.1004.1016.1021.1023.1024.1024.1024
.0..2..233..927.1490.1793.1936.2000.2028.2040.2045.2047.2048.2048
.0..2..377.1705.2872.3525.3840.3984.4048.4076.4088.4093.4095.4096
Columns: A000045, A000073, A000078, A001591, A001592 etc. (End)
		

Crossrefs

Programs

Formula

From R. J. Mathar, Apr 22 2009: (Start)
a(n) = 3*a(n-1) - 2*a(n-2).
a(n) = 8*(2^n-1).
G.f.: 8*x/((2*x-1)*(x-1)). (End)
From Jaroslav Krizek, Jun 18 2009: (Start)
a(n) = Sum_{i=3..(n+2)} 2^i.
a(n) = Sum_{i=1..n} 2^(i+2).
a(n) = a(n-1) + 2^(n+2) for n >= 2. (End)
a(n) = A173787(n+3,3) = A175166(2*n)/A175161(n). - Reinhard Zumkeller, Feb 28 2010
From Elmo R. Oliveira, Jun 15 2025: (Start)
E.g.f.: 8*exp(x)*(exp(x) - 1).
a(n) = 8*A000225(n) = 4*A000918(n+1) = 2*A028399(n+2). (End)

Extensions

More terms from R. J. Mathar, Apr 22 2009
Edited by Al Hakanson (hawkuu(AT)gmail.com), May 11 2009
Comments claiming negative entries deleted by R. J. Mathar, Aug 24 2009

A265901 Square array read by descending antidiagonals: A(n,1) = A188163(n), and for k > 1, A(n,k) = A087686(1+A(n,k-1)).

Original entry on oeis.org

1, 2, 3, 4, 7, 5, 8, 15, 12, 6, 16, 31, 27, 14, 9, 32, 63, 58, 30, 21, 10, 64, 127, 121, 62, 48, 24, 11, 128, 255, 248, 126, 106, 54, 26, 13, 256, 511, 503, 254, 227, 116, 57, 29, 17, 512, 1023, 1014, 510, 475, 242, 120, 61, 38, 18, 1024, 2047, 2037, 1022, 978, 496, 247, 125, 86, 42, 19, 2048, 4095, 4084, 2046, 1992, 1006, 502, 253, 192, 96, 45, 20
Offset: 1

Views

Author

Antti Karttunen, Dec 18 2015

Keywords

Comments

Square array read by descending antidiagonals: A(1,1), A(1,2), A(2,1), A(1,3), A(2,2), A(3,1), etc.
The topmost row (row 1) of the array is A000079 (powers of 2), and in general each row 2^k contains the sequence (2^n - k), starting from the term (2^(k+1) - k). This follows from the properties (3) and (4) of A004001 given on page 227 of Kubo & Vakil paper (page 3 in PDF).
Moreover, each row 2^k - 1 (for k >= 2) contains the sequence 2^n - n - (k-2), starting from the term (2^(k+1) - (2k-1)). To see why this holds, consider the definitions of sequences A162598 and A265332, the latter which also illustrates how the frequency counts Q_n for A004001 are recursively constructed (in the Kubo & Vakil paper).

Examples

			The top left corner of the array:
   1,  2,   4,   8,  16,   32,   64,  128,  256,   512,  1024, ...
   3,  7,  15,  31,  63,  127,  255,  511, 1023,  2047,  4095, ...
   5, 12,  27,  58, 121,  248,  503, 1014, 2037,  4084,  8179, ...
   6, 14,  30,  62, 126,  254,  510, 1022, 2046,  4094,  8190, ...
   9, 21,  48, 106, 227,  475,  978, 1992, 4029,  8113, 16292, ...
  10, 24,  54, 116, 242,  496, 1006, 2028, 4074,  8168, 16358, ...
  11, 26,  57, 120, 247,  502, 1013, 2036, 4083,  8178, 16369, ...
  13, 29,  61, 125, 253,  509, 1021, 2045, 4093,  8189, 16381, ...
  17, 38,  86, 192, 419,  894, 1872, 3864, 7893, 16006, 32298, ...
  18, 42,  96, 212, 454,  950, 1956, 3984, 8058, 16226, 32584, ...
  19, 45, 102, 222, 469,  971, 1984, 4020, 8103, 16281, 32650, ...
  20, 47, 105, 226, 474,  977, 1991, 4028, 8112, 16291, 32661, ...
  22, 51, 112, 237, 490,  999, 2020, 4065, 8158, 16347, 32728, ...
  23, 53, 115, 241, 495, 1005, 2027, 4073, 8167, 16357, 32739, ...
  25, 56, 119, 246, 501, 1012, 2035, 4082, 8177, 16368, 32751, ...
  28, 60, 124, 252, 508, 1020, 2044, 4092, 8188, 16380, 32764, ...
  ...
		

Crossrefs

Inverse permutation: A267102.
Transpose: A265903.
Cf. A265900 (main diagonal).
Cf. A162598 (row index of n in array), A265332 (column index of n in array).
Column 1: A188163.
Column 2: A266109.
Row 1: A000079 (2^n).
Row 2: A000225 (2^n - 1, from 3 onward).
Row 3: A000325 (2^n - n, from 5 onward).
Row 4: A000918 (2^n - 2, from 6 onward).
Row 5: A084634 (?, from 9 onward).
Row 6: A132732 (2^n - 2n + 2, from 10 onward).
Row 7: A000295 (2^n - n - 1, from 11 onward).
Row 8: A036563 (2^n - 3).
Row 9: A084635 (?, from 17 onward).
Row 12: A048492 (?, from 20 onward).
Row 13: A249453 (?, from 22 onward).
Row 14: A183155 (2^n - 2n + 1, from 23 onward. Cf. also A244331).
Row 15: A000247 (2^n - n - 2, from 25 onward).
Row 16: A028399 (2^n - 4).
Cf. also permutations A267111, A267112.

Programs

Formula

For the first column k=1, A(n,1) = A188163(n), for columns k > 1, A(n,k) = A087686(1+A(n,k-1)).

A059427 Triangle read by rows: T(n,k) is the number of permutations of [n] with k alternating runs (n>=2, k>=1).

Original entry on oeis.org

2, 2, 4, 2, 12, 10, 2, 28, 58, 32, 2, 60, 236, 300, 122, 2, 124, 836, 1852, 1682, 544, 2, 252, 2766, 9576, 14622, 10332, 2770, 2, 508, 8814, 45096, 103326, 119964, 69298, 15872, 2, 1020, 27472, 201060, 650892, 1106820, 1034992, 505500, 101042, 2, 2044
Offset: 2

Views

Author

N. J. A. Sloane, Jan 31 2001

Keywords

Comments

The permutation 732569148 has 4 alternating runs: 732, 2569, 91 and 148.

Examples

			T(3,2) = 4 because each of the permutations 132, 312, 213, 231 has two alternating runs: (13, 32), (31, 12), (21, 13), (23, 31); each of 123 and 321 has 1 alternating run.
Triangle (with rows n >= 2 and columns k >= 1) begins as follows:
  2;
  2,   4;
  2,  12,  10;
  2,  28,  58,   32;
  2,  60, 236,  300,  122;
  2, 124, 836, 1852, 1682, 544;
  ...
		

References

  • L. Comtet, Advanced Combinatorics, Reidel, Dordrecht, Holland, 1974, p. 261, #13.
  • F. N. David and D. E. Barton, Combinatorial Chance, Hafner, NY, 1962, pp. 157-162.
  • F. N. David, M. G. Kendall and D. E. Barton, Symmetric Function and Allied Tables, Cambridge, 1966, p. 262, Table 7.2.1 doubled.
  • D. E. Knuth, The Art of Computer Programming. Addison-Wesley, Reading, MA, 1973, Vol. 3, pp. 46 and 587-8.

Crossrefs

Diagonals give A001250, A001758. Column k = 2 is A028399.
Cf. A008303 (circular version of this array), A008970.
T(2n,n) gives 2*A360426.

Programs

  • Maple
    P := proc(n,k) if n<2 or k<1 or k>=n then 0 elif n=2 and k=1 then 2 else k*P(n-1,k)+2*P(n-1,k-1)+(n-k)*P(n-1,k-2) fi end: p:=(n,k)->P(n+1,k): matrix(9,9,p);
  • Mathematica
    t[n_, k_] := t[n, k] = k*t[n-1, k] + 2*t[n-1, k-1] + (n-k)*t[n-1, k-2];
    t[2, 1] = 2; t[n_, k_] /; n < 2 || k < 1 || k >= n = 0;
    Flatten[Table[t[n, k], {n,2,11}, {k, 1, n-1}]][[1 ;; 47]]
    (* Jean-François Alcover, Jun 16 2011, after recurrence *)

Formula

P(n, k) = 0 if n < 2 or k < 1 or k >= n; P(2, 1) = 2; P(n, k) = k*P(n-1, k) + 2*P(n-1, k-1) + (n-k)*P(n-1, k-2) [André]. - Emeric Deutsch, Feb 21 2004
The row generating polynomials P[n] satisfy P[n] = t*[(1 - t^2) * dP[n-1]/dt + (2 + (n-2) * t) * P[n-1]] and P[2] = 2*t.
T(n, n-1) = 2*A000111(n) = A001250(n-1).
T(n, k) = k*T(n-1, k) + 2*T(n-1, k-1) + (n-k)*T(n-1, k-2), where we set T(2, 1) = 2 and T(n, k) = 0 if n < 2 or k < 1 or k >= n.
E.g.f.: Sum_{n, k >= 0} T(n, k) * x^n * t^k/n! = 2*(1 - t^2 + t * sqrt(1-t^2) * sinh(x * sqrt(1 - t^2)))/((1 + t)^2*(1-t*cosh(x * sqrt(1 - t^2)))) - 2(1 + t*x)/(1 + t).
T(n, k) = 2*A008970(n, k).

Extensions

Edited by Emeric Deutsch and Ira M. Gessel, Dec 06 2004
André reference from Philippe Deléham, Jul 26 2006

A068913 Square array read by antidiagonals of number of k step walks (each step +-1 starting from 0) which are never more than n or less than -n.

Original entry on oeis.org

1, 0, 1, 0, 2, 1, 0, 2, 2, 1, 0, 4, 4, 2, 1, 0, 4, 6, 4, 2, 1, 0, 8, 12, 8, 4, 2, 1, 0, 8, 18, 14, 8, 4, 2, 1, 0, 16, 36, 28, 16, 8, 4, 2, 1, 0, 16, 54, 48, 30, 16, 8, 4, 2, 1, 0, 32, 108, 96, 60, 32, 16, 8, 4, 2, 1, 0, 32, 162, 164, 110, 62, 32, 16, 8, 4, 2, 1, 0, 64, 324, 328, 220, 124, 64, 32, 16, 8, 4, 2, 1
Offset: 0

Views

Author

Henry Bottomley, Mar 06 2002

Keywords

Examples

			Rows start:
  1,  0,  0,  0,  0, ...
  1,  2,  2,  4,  4, ...
  1,  2,  4,  6, 12, ...
  1,  2,  4,  8, 14, ...
  ...
		

Crossrefs

Cf. early rows: A000007, A016116 (without initial term), A068911, A068912, A216212, A216241, A235701.
Central and lower diagonals are A000079, higher diagonals include A000918, A028399.

Programs

  • Mathematica
    T[n_,0]=1; T[n_,k_]:=2^k/(n+1) Sum[(-1)^r Cos[(Pi (2r-1))/(2 (n+1))]^k Cot[(Pi (1-2r))/(4 (n+1))],{r,1,n+1}]; Table[T[r,n-r],{n,0,20},{r,0,n}]//Round//Flatten (* Herbert Kociemba, Sep 23 2020 *)

Formula

Starting with T(n, 0) = 1, if (k-n) is negative or even then T(n, k) = 2*T(n, k-1), otherwise T(n, k) = 2*T(n, k-1) - A061897(n+1, (k-n-1)/2). So for n>=k, T(n, k) = 2^k. [Corrected by Sean A. Irvine, Mar 23 2024]
T(n,0) = 1, T(n,k) = (2^k/(n+1))*Sum_{r=1..n+1} (-1)^r*cos((Pi*(2*r-1))/(2*(n+1)))^k*cot((Pi*(1-2*r))/(4*(n+1))). - Herbert Kociemba, Sep 23 2020

A182464 a(n) = 3a(n-1) - 2a(n-2) with a(0)=24 and a(1)=60.

Original entry on oeis.org

24, 60, 132, 276, 564, 1140, 2292, 4596, 9204, 18420, 36852, 73716, 147444, 294900, 589812, 1179636, 2359284, 4718580, 9437172, 18874356, 37748724, 75497460, 150994932, 301989876, 603979764, 1207959540, 2415919092, 4831838196, 9663676404, 19327352820, 38654705652
Offset: 0

Views

Author

Odimar Fabeny, Apr 30 2012

Keywords

Comments

Number of vertices into building blocks of 3d objects with 6 vertices.

Examples

			a(0) = 6+12+6;
a(1) = 6+12+24+12+6;
a(2) = 6+12+24+48+24+12+6;
a(3) = 6+12+24+48+96+48+24+12+6.
		

Crossrefs

Programs

  • Mathematica
    CoefficientList[Series[-((12 (x - 2))/(2 x^2 - 3 x + 1)), {x, 0, 40}], x] (* Vincenzo Librandi, Jun 01 2014 *)
    LinearRecurrence[{3,-2},{24,60},40] (* Harvey P. Dale, May 27 2018 *)

Formula

a(n) = a(n-1)*2 + 12.
a(n) = 12*A153893(n). - Michel Marcus, Jun 01 2014
G.f.: -((12*(x-2))/(2*x^2-3*x+1)). - Vincenzo Librandi, Jun 01 2014
Showing 1-10 of 31 results. Next