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

A084266 Binomial transform of A084265.

Original entry on oeis.org

1, 3, 11, 34, 96, 256, 656, 1632, 3968, 9472, 22272, 51712, 118784, 270336, 610304, 1368064, 3047424, 6750208, 14876672, 32636928, 71303168, 155189248, 336592896, 727711744, 1568669696, 3372220416, 7230980096, 15468593152, 33017561088
Offset: 0

Views

Author

Paul Barry, May 31 2003

Keywords

Comments

The sequence starting with a(1) is the binomial transform of A005563 starting with A005563(1). - Paul Curtz, Jan 02 2011

Programs

  • Magma
    [0^n/2+2^n*(n^2+7*n+4)/8: n in [0..35]]; // Vincenzo Librandi, Aug 13 2011
  • Mathematica
    LinearRecurrence[{6,-12,8},{1,3,11,34},30] (* Harvey P. Dale, Dec 12 2021 *)

Formula

E.g.f.: exp(x)*cosh(x) + exp(2*x)*(2*x+x^2/2); a(n) = 0^n/2 + 2^n*(n^2 + 7*n + 4)/8.
a(n) = Sum_{k=0..n-1} a(k) + (n+2)*2^(n-1) - 1. - Philippe Deléham, Jul 12 2007
G.f.: (-4 + 13*x - 16*x^2 + 8*x^3)/(2*x-1)^3. - R. J. Mathar, Jan 06 2011
a(n) = (Sum_{k=0..n+1} binomial(n+1,k)*k^4)/((n+1)*(n+2)), n > 0. - Gary Detlefs, Nov 26 2011

A000384 Hexagonal numbers: a(n) = n*(2*n-1).

Original entry on oeis.org

0, 1, 6, 15, 28, 45, 66, 91, 120, 153, 190, 231, 276, 325, 378, 435, 496, 561, 630, 703, 780, 861, 946, 1035, 1128, 1225, 1326, 1431, 1540, 1653, 1770, 1891, 2016, 2145, 2278, 2415, 2556, 2701, 2850, 3003, 3160, 3321, 3486, 3655, 3828, 4005, 4186, 4371, 4560
Offset: 0

Views

Author

Keywords

Comments

Number of edges in the join of two complete graphs, each of order n, K_n * K_n. - Roberto E. Martinez II, Jan 07 2002
The power series expansion of the entropy function H(x) = (1+x)log(1+x) + (1-x)log(1-x) has 1/a_i as the coefficient of x^(2i) (the odd terms being zero). - Tommaso Toffoli (tt(AT)bu.edu), May 06 2002
Partial sums of A016813 (4n+1). Also with offset = 0, a(n) = (2n+1)(n+1) = A005408 * A000027 = 2n^2 + 3n + 1, i.e., a(0) = 1. - Jeremy Gardiner, Sep 29 2002
Sequence also gives the greatest semiperimeter of primitive Pythagorean triangles having inradius n-1. Such a triangle has consecutive longer sides, with short leg 2n-1, hypotenuse a(n) - (n-1) = A001844(n), and area (n-1)*a(n) = 6*A000330(n-1). - Lekraj Beedassy, Apr 23 2003
Number of divisors of 12^(n-1), i.e., A000005(A001021(n-1)). - Henry Bottomley, Oct 22 2001
More generally, if p1 and p2 are two arbitrarily chosen distinct primes then a(n) is the number of divisors of (p1^2*p2)^(n-1) or equivalently of any member of A054753^(n-1). - Ant King, Aug 29 2011
Number of standard tableaux of shape (2n-1,1,1) (n>=1). - Emeric Deutsch, May 30 2004
It is well known that for n>0, A014105(n) [0,3,10,21,...] is the first of 2n+1 consecutive integers such that the sum of the squares of the first n+1 such integers is equal to the sum of the squares of the last n; e.g., 10^2 + 11^2 + 12^2 = 13^2 + 14^2.
Less well known is that for n>1, a(n) [0,1,6,15,28,...] is the first of 2n consecutive integers such that sum of the squares of the first n such integers is equal to the sum of the squares of the last n-1 plus n^2; e.g., 15^2 + 16^2 + 17^2 = 19^2 + 20^2 + 3^2. - Charlie Marion, Dec 16 2006
a(n) is also a perfect number A000396 when n is an even superperfect number A061652. - Omar E. Pol, Sep 05 2008
Sequence found by reading the line from 0, in the direction 0, 6, ... and the line from 1, in the direction 1, 15, ..., in the square spiral whose vertices are the generalized hexagonal numbers A000217. - Omar E. Pol, Jan 09 2009
For n>=1, 1/a(n) = Sum_{k=0..2*n-1} ((-1)^(k+1)*binomial(2*n-1,k)*binomial(2*n-1+k,k)*H(k)/(k+1)) with H(k) harmonic number of order k.
The number of possible distinct colorings of any 2 colors chosen from n colors of a square divided into quadrants. - Paul Cleary, Dec 21 2010
Central terms of the triangle in A051173. - Reinhard Zumkeller, Apr 23 2011
For n>0, a(n-1) is the number of triples (w,x,y) with all terms in {0,...,n} and max(|w-x|,|x-y|) = |w-y|. - Clark Kimberling, Jun 12 2012
a(n) is the number of positions of one domino in an even pyramidal board with base 2n. - César Eliud Lozada, Sep 26 2012
Partial sums give A002412. - Omar E. Pol, Jan 12 2013
Let a triangle have T(0,0) = 0 and T(r,c) = |r^2 - c^2|. The sum of the differences of the terms in row(n) and row(n-1) is a(n). - J. M. Bergot, Jun 17 2013
With T_(i+1,i)=a(i+1) and all other elements of the lower triangular matrix T zero, T is the infinitesimal generator for A176230, analogous to A132440 for the Pascal matrix. - Tom Copeland, Dec 11 2013
a(n) is the number of length 2n binary sequences that have exactly two 1's. a(2) = 6 because we have: {0,0,1,1}, {0,1,0,1}, {0,1,1,0}, {1,0,0,1}, {1,0,1,0}, {1,1,0,0}. The ordinary generating function with interpolated zeros is: (x^2 + 3*x^4)/(1-x^2)^3. - Geoffrey Critzer, Jan 02 2014
For n > 0, a(n) is the largest integer k such that k^2 + n^2 is a multiple of k + n. More generally, for m > 0 and n > 0, the largest integer k such that k^(2*m) + n^(2*m) is a multiple of k + n is given by k = 2*n^(2*m) - n. - Derek Orr, Sep 04 2014
Binomial transform of (0, 1, 4, 0, 0, 0, ...) and second partial sum of (0, 1, 4, 4, 4, ...). - Gary W. Adamson, Oct 05 2015
a(n) also gives the dimension of the simple Lie algebras D_n, for n >= 4. - Wolfdieter Lang, Oct 21 2015
For n > 0, a(n) equals the number of compositions of n+11 into n parts avoiding parts 2, 3, 4. - Milan Janjic, Jan 07 2016
Also the number of minimum dominating sets and maximal irredundant sets in the n-cocktail party graph. - Eric W. Weisstein, Jun 29 and Aug 17 2017
As Beedassy's formula shows, this Hexagonal number sequence is the odd bisection of the Triangle number sequence. Both of these sequences are figurative number sequences. For A000384, a(n) can be found by multiplying its triangle number by its hexagonal number. For example let's use the number 153. 153 is said to be the 17th triangle number but is also said to be the 9th hexagonal number. Triangle(17) Hexagonal(9). 17*9=153. Because the Hexagonal number sequence is a subset of the Triangle number sequence, the Hexagonal number sequence will always have both a triangle number and a hexagonal number. n* (2*n-1) because (2*n-1) renders the triangle number. - Bruce J. Nicholson, Nov 05 2017
Also numbers k with the property that in the symmetric representation of sigma(k) the smallest Dyck path has a central valley and the largest Dyck path has a central peak, n >= 1. Thus all hexagonal numbers > 0 have middle divisors. (Cf. A237593.) - Omar E. Pol, Aug 28 2018
k^a(n-1) mod n = 1 for prime n and k=2..n-1. - Joseph M. Shunia, Feb 10 2019
Consider all Pythagorean triples (X, Y, Z=Y+1) ordered by increasing Z: a(n+1) gives the semiperimeter of related triangles; A005408, A046092 and A001844 give the X, Y and Z values. - Ralf Steiner, Feb 25 2020
See A002939(n) = 2*a(n) for the corresponding perimeters. - M. F. Hasler, Mar 09 2020
It appears that these are the numbers k with the property that the smallest subpart in the symmetric representation of sigma(k) is 1. - Omar E. Pol, Aug 28 2021
The above conjecture is true. See A280851 for a proof. - Hartmut F. W. Hoft, Feb 02 2022
The n-th hexagonal number equals the sum of the n consecutive integers with the same parity starting at n; for example, 1, 2+4, 3+5+7, 4+6+8+10, etc. In general, the n-th 2k-gonal number is the sum of the n consecutive integers with the same parity starting at (k-2)*n - (k-3). When k = 1 and 2, this result generates the positive integers, A000027, and the squares, A000290, respectively. - Charlie Marion, Mar 02 2022
Conjecture: For n>0, min{k such that there exist subsets A,B of {0,1,2,...,a(n)} such that |A|=|B|=k and A+B={0,1,2,...,2*a(n)}} = 2*n. - Michael Chu, Mar 09 2022

References

  • Albert H. Beiler, Recreations in the Theory of Numbers, Dover, NY, 1964, p. 189.
  • Louis Comtet, Advanced Combinatorics, Reidel, 1974, pp. 77-78. (In the integral formula on p. 77 a left bracket is missing for the cosine argument.)
  • John H. Conway and Richard K. Guy, The Book of Numbers, New York: Springer-Verlag, 1996. See p. 38.
  • E. Deza and M. M. Deza, Figurate numbers, World Scientific Publishing (2012), page 6.
  • L. E. Dickson, History of the Theory of Numbers. Carnegie Institute Public. 256, Washington, DC, Vol. 1, 1919; Vol. 2, 1920; Vol. 3, 1923, see vol. 2, p. 2.
  • Alfred S. Posamentier, Math Charmers, Tantalizing Tidbits for the Mind, Prometheus Books, NY, 2003, pages 53-54, 129-130, 132.
  • 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).
  • James J. Tattersall, Elementary Number Theory in Nine Chapters, Cambridge University Press, 1999, page 21.
  • David Wells, The Penguin Dictionary of Curious and Interesting Numbers. Penguin Books, NY, 1986, Revised edition 1987. See pp. 122-123.

Crossrefs

a(n)= A093561(n+1, 2), (4, 1)-Pascal column.
a(n) = A100345(n, n-1) for n>0.
Cf. A002939 (twice a(n): sums of Pythagorean triples (X, Y, Z=Y+1)).
Cf. A280851.

Programs

  • Haskell
    a000384 n = n * (2 * n - 1)
    a000384_list = scanl (+) 0 a016813_list
    -- Reinhard Zumkeller, Dec 16 2012
    
  • Maple
    A000384:=n->n*(2*n-1); seq(A000384(k), k=0..100); # Wesley Ivan Hurt, Sep 27 2013
  • Mathematica
    Table[n*(2 n - 1), {n, 0, 100}] (* Wesley Ivan Hurt, Sep 27 2013 *)
    LinearRecurrence[{3, -3, 1}, {0, 1, 6}, 50] (* Harvey P. Dale, Sep 10 2015 *)
    Join[{0}, Accumulate[Range[1, 312, 4]]] (* Harvey P. Dale, Mar 26 2016 *)
    (* For Mathematica 10.4+ *) Table[PolygonalNumber[RegularPolygon[6], n], {n, 0, 48}] (* Arkadiusz Wesolowski, Aug 27 2016 *)
    PolygonalNumber[6, Range[0, 20]] (* Eric W. Weisstein, Aug 17 2017 *)
    CoefficientList[Series[x*(1 + 3*x)/(1 - x)^3 , {x, 0, 100}], x] (* Stefano Spezia, Sep 02 2018 *)
  • PARI
    a(n)=n*(2*n-1)
    
  • PARI
    a(n) = binomial(2*n,2) \\ Altug Alkan, Oct 06 2015
    
  • Python
    # Intended to compute the initial segment of the sequence, not isolated terms.
    def aList():
         x, y = 1, 1
         yield 0
         while True:
             yield x
             x, y = x + y + 4, y + 4
    A000384 = aList()
    print([next(A000384) for i in range(49)]) # Peter Luschny, Aug 04 2019

Formula

a(n) = Sum_{k=1..n} tan^2((k - 1/2)*Pi/(2n)). - Ignacio Larrosa Cañestro, Apr 17 2001
E.g.f.: exp(x)*(x+2x^2). - Paul Barry, Jun 09 2003
G.f.: x*(1+3*x)/(1-x)^3. - Simon Plouffe in his 1992 dissertation, dropping the initial zero
a(n) = A000217(2*n-1) = A014105(-n).
a(n) = 4*A000217(n-1) + n. - Lekraj Beedassy, Jun 03 2004
a(n) = right term of M^n * [1,0,0], where M = the 3 X 3 matrix [1,0,0; 1,1,0; 1,4,1]. Example: a(5) = 45 since M^5 *[1,0,0] = [1,5,45]. - Gary W. Adamson, Dec 24 2006
Row sums of triangle A131914. - Gary W. Adamson, Jul 27 2007
Row sums of n-th row, triangle A134234 starting (1, 6, 15, 28, ...). - Gary W. Adamson, Oct 14 2007
Starting with offset 1, = binomial transform of [1, 5, 4, 0, 0, 0, ...]. Also, A004736 * [1, 4, 4, 4, ...]. - Gary W. Adamson, Oct 25 2007
a(n)^2 + (a(n)+1)^2 + ... + (a(n)+n-1)^2 = (a(n)+n+1)^2 + ... + (a(n)+2n-1)^2 + n^2; e.g., 6^2 + 7^2 = 9^2 + 2^2; 28^2 + 29^2 + 30^2 + 31^2 = 33^2 + 34^2 + 35^2 + 4^2. - Charlie Marion, Nov 10 2007
a(n) = binomial(n+1,2) + 3*binomial(n,2).
a(n) = 3*a(n-1) - 3*a(n-2) + a(n-3), a(0)=0, a(1)=1, a(2)=6. - Jaume Oliver Lafont, Dec 02 2008
a(n) = T(n) + 3*T(n-1), where T(n) is the n-th triangular number. - Vincenzo Librandi, Nov 10 2010
a(n) = a(n-1) + 4*n - 3 (with a(0)=0). - Vincenzo Librandi, Nov 20 2010
a(n) = A007606(A000290(n)). - Reinhard Zumkeller, Feb 12 2011
a(n) = 2*a(n-1) - a(n-2) + 4. - Ant King, Aug 26 2011
a(n+1) = A045896(2*n). - Reinhard Zumkeller, Dec 12 2011
a(2^n) = 2^(2n+1) - 2^n. - Ivan N. Ianakiev, Apr 13 2013
a(n) = binomial(2*n,2). - Gary Detlefs, Jul 28 2013
a(n+1) = A128918(2*n+1). - Reinhard Zumkeller, Oct 13 2013
a(4*a(n)+7*n+1) = a(4*a(n)+7*n) + a(4*n+1). - Vladimir Shevelev, Jan 24 2014
Sum_{n>=1} 1/a(n) = 2*log(2) = 1.38629436111989...= A016627. - Vaclav Kotesovec, Apr 27 2016
Sum_{n>=1} (-1)^n/a(n) = log(2) - Pi/2. - Vaclav Kotesovec, Apr 20 2018
a(n+1) = trinomial(2*n+1, 2) = trinomial(2*n+1, 4*n), for n >= 0, with the trinomial irregular triangle A027907. a(n+1) = (n+1)*(2*n+1) = (1/Pi)*Integral_{x=0..2} (1/sqrt(4 - x^2))*(x^2 - 1)^(2*n+1)*R(4*n-2, x) with the R polynomial coefficients given in A127672. [Comtet, p. 77, the integral formula for q=3, n -> 2*n+1, k = 2, rewritten with x = 2*cos(phi)]. - Wolfdieter Lang, Apr 19 2018
Sum_{n>=1} 1/(a(n))^2 = 2*Pi^2/3-8*log(2) = 1.0345588... = 10*A182448 - A257872. - R. J. Mathar, Sep 12 2019
a(n) = (A005408(n-1) + A046092(n-1) + A001844(n-1))/2. - Ralf Steiner, Feb 27 2020
Product_{n>=2} (1 - 1/a(n)) = 2/3. - Amiram Eldar, Jan 21 2021
a(n) = floor(Sum_{k=(n-1)^2..n^2} sqrt(k)), for n >= 1. - Amrit Awasthi, Jun 13 2021
a(n+1) = A084265(2*n), n>=0. - Hartmut F. W. Hoft, Feb 02 2022
a(n) = A000290(n) + A002378(n-1). - Charles Kusniec, Sep 11 2022

Extensions

Partially edited by Joerg Arndt, Mar 11 2010

A176222 a(n) = (n^2 - 3*n + 1 + (-1)^n)/2.

Original entry on oeis.org

0, 3, 5, 10, 14, 21, 27, 36, 44, 55, 65, 78, 90, 105, 119, 136, 152, 171, 189, 210, 230, 253, 275, 300, 324, 351, 377, 406, 434, 465, 495, 528, 560, 595, 629, 666, 702, 741, 779, 820, 860, 903, 945, 990, 1034, 1081, 1127, 1176, 1224, 1275, 1325, 1378, 1430
Offset: 3

Views

Author

Vladimir Shevelev, Apr 12 2010

Keywords

Comments

Let I = I_n be the n X n identity matrix and P = P_n be the incidence matrix of the cycle (1,2,3,...,n).
Let T = P^(-1)+I+P.
11000...01
11100....0
01110.....
00111.....
..........
00.....111
10.....011
Then a(n) is the number of (0,1) n X n matrices A <= T (i.e., an element of A can be 1 only if T has a 1 at this place) having exactly two 1's in every row and column with per(A) = 4.
a(n) is the maximum number m such that m white kings and m black kings can coexist on an n+1 X n+1 chessboard without attacking each other. - Aaron Khan, Jul 05 2022

Examples

			For n=5 the reference matrix is:
  11001
  11100
  01110
  00111
  10011
There are 2^(3*n) = 32768 0-1 matrices obtained from removing one or more 1's in it.
There are 305 such matrices with permanent 4 and there are 13 such matrices with exactly two 1's in every column and every row.
There are 5 matrices having both properties. One of them is:
  10001
  01100
  01100
  00011
  10010
From _Aaron Khan_, Jul 05 2022: (Start)
Examples of the sequence when used for kings on a chessboard:
.
A solution illustrating a(2)=3:
  +-------+
  | B B B |
  | . . . |
  | W W W |
  +-------+
.
A solution illustrating a(3)=5:
  +---------+
  | B B B B |
  | B . . . |
  | . . . W |
  | W W W W |
  +---------+
(End)
		

References

  • V. S. Shevelyov (Shevelev), Extension of the Moser class of four-line Latin rectangles, DAN Ukrainy, 3 (1992), 15-19.

Crossrefs

Cf. A000211, A052928, A128209, A250000 (queens on a chessboard), A002620 (rooks on a chessboard), A355509 (knights on a chessboard).

Programs

  • Magma
    [(n^2-3*n+1+(-1)^n)/2: n in [3..100]]; // Vincenzo Librandi, Mar 24 2011
    
  • Maple
    A176222:=n->(n^2-3*n+1+(-1)^n)/2: seq(A176222(n), n=3..100); # Wesley Ivan Hurt, May 25 2015
  • Mathematica
    Table[(n^2 - 3*n + 1 + (-1)^n)/2, {n, 3, 100}] (* or *) CoefficientList[Series[x (x - 3)/((1 + x)*(x - 1)^3), {x, 0, 30}], x] (* Wesley Ivan Hurt, May 25 2015 *)
    LinearRecurrence[{2,0,-2,1},{0,3,5,10},90] (* Harvey P. Dale, Jan 14 2024 *)
  • PARI
    a(n)=(n^2-3*n+1+(-1)^n)/2 \\ Charles R Greathouse IV, Oct 16 2015
    
  • Sage
    [n*(n-3)/2 + ((n+1)%2) for n in (3..60)] # G. C. Greubel, Mar 22 2022

Formula

a(n) = (n - t(n))*(n - 3 + t(n))/2, where t(n) = 1-(n mod 2).
G.f.: x^4*(3-x)/( (1+x)*(1-x)^3 ). - R. J. Mathar, Mar 06 2011
From Bruno Berselli, Sep 13 2011: (Start)
a(n) + a(n+1) = A005563(n-2).
a(-n) = A084265(n). (End)
a(n) = 1 -2*n +floor(n/2) +floor(n^2/2). - Wesley Ivan Hurt, Jun 14 2013
From Wesley Ivan Hurt, May 25 2015: (Start)
a(n) = 2*a(n-1) - 2*a(n-3) + a(n-4), n>4.
a(n) = Sum_{i=(-1)^n..n-2} i. (End)
a(n) = A174239(n-2) * A174239(n-1). - Paul Curtz, Jul 17 2017
With offset 0, this is ceiling(n/2)*(2*floor(n/2)+3). - N. J. A. Sloane, Jan 16 2020
E.g.f.: (1/2)*((1-x)*exp(x/2) - exp(-x/2))^2. - G. C. Greubel, Mar 22 2022

Extensions

Matrix class definition checked, edited and illustrated by Olivier Gérard, Mar 26 2011

A114112 a(1)=1, a(2)=2; thereafter a(n) = n+1 if n odd, n-1 if n even.

Original entry on oeis.org

1, 2, 4, 3, 6, 5, 8, 7, 10, 9, 12, 11, 14, 13, 16, 15, 18, 17, 20, 19, 22, 21, 24, 23, 26, 25, 28, 27, 30, 29, 32, 31, 34, 33, 36, 35, 38, 37, 40, 39, 42, 41, 44, 43, 46, 45, 48, 47, 50, 49, 52, 51, 54, 53, 56, 55, 58, 57, 60, 59, 62, 61, 64, 63, 66, 65, 68, 67, 70, 69, 72, 71
Offset: 1

Views

Author

Leroy Quet, Nov 13 2005

Keywords

Comments

a(1)=1; for n>1, a(n) is the smallest positive integer not occurring earlier in the sequence such that a(n) does not divide Sum_{k=1..n-1} a(k). - Leroy Quet, Nov 13 2005 (This was the original definition. A simple induction argument shows that this is the same as the present definition. - N. J. A. Sloane, Mar 12 2018)
Define b(1)=2; for n>1, b(n) is the smallest number not yet in the sequence which shares a prime factor with the sum of all preceding terms. Then a simple induction argument shows that the b(n) sequence is the same as the present sequence with the first term omitted. - David James Sycamore, Feb 26 2018
Here are the details of the two induction arguments (Start)
For a(n), let A(n) = a(1)+...+a(n). The claim is that for n>2 a(n)=n+1 if n odd, n-1 if n even.
The induction hypotheses are: for i
For b(n), the argument is very similar, except that the missing numbers when looking for b(n) are slightly different, and (setting B(n) = b(1)+...b(n)), we have B(2i)=(i+1)(2i+1), B(2i+1)=(i+2)(2i+1). - N. J. A. Sloane, Mar 14 2018
When sequence a(n) is increasing, then the Cesàro means sequence c(n) = (a(1)+...+a(n))/n is also increasing, but the converse is false. This sequence is a such an example where c(n) is increasing, while a(n) is not increasing (Arnaudiès et al.). See proof in A354008. - Bernard Schott, May 11 2022

References

  • J. M. Arnaudiès, P. Delezoide et H. Fraysse, Exercices résolus d'Analyse du cours de mathématiques - 2, Dunod, Exercice 10, pp. 14-16.

Crossrefs

All of A014681, A103889, A113981, A114112, A114285 are essentially the same sequence. - N. J. A. Sloane, Mar 12 2018
Cf. A114113 (partial sums).
See A084265 for the partial sums of the b(n) sequence.
About Cesàro mean theorem: A033999, A141310, A237420, A354008.
Cf. A244009.

Programs

  • Mathematica
    a[1] = 1; a[n_] := a[n] = Block[{k = 1, s, t = Table[ a[i], {i, n - 1}]}, s = Plus @@ t; While[ Position[t, k] != {} || Mod[s, k] == 0, k++ ]; k]; Array[a, 72] (* Robert G. Wilson v, Nov 18 2005 *)
  • PARI
    a(n) = if (n<=2, n, if (n%2, n+1, n-1)); \\ Michel Marcus, May 16 2022
    
  • Python
    def A114112(n): return n + (0 if n <= 2 else -1+2*(n%2)) # Chai Wah Wu, May 24 2022

Formula

G.f.: x*(x^4-2*x^3+x^2+x+1)/((1-x)*(1-x^2)). - N. J. A. Sloane, Mar 12 2018
The g.f. for the b(n) sequence is x*(x^3-3*x^2+2*x+2)/((1-x)*(1-x^2)). - Conjectured (correctly) by Colin Barker, Mar 04 2018
E.g.f.: 1 - x + x^2/2 + (x - 1)*cosh(x) + (x + 1)*sinh(x). - Stefano Spezia, Sep 02 2022
Sum_{n>=1} (-1)^(n+1)/a(n) = 1 - log(2) (A244009). - Amiram Eldar, Jun 29 2025

Extensions

More terms from Robert G. Wilson v, Nov 18 2005
Entry edited (with simpler definition) by N. J. A. Sloane, Mar 12 2018

A114113 a(n) = sum{k=1 to n} (A114112(k)). (For n>=2, a(n) = sum{k=1 to n} (A014681(k)) =sum{k=1 to n} (A103889(k)).).

Original entry on oeis.org

1, 3, 7, 10, 16, 21, 29, 36, 46, 55, 67, 78, 92, 105, 121, 136, 154, 171, 191, 210, 232, 253, 277, 300, 326, 351, 379, 406, 436, 465, 497, 528, 562, 595, 631, 666, 704, 741, 781, 820, 862, 903, 947, 990, 1036, 1081, 1129, 1176, 1226, 1275, 1327, 1378, 1432
Offset: 1

Author

Leroy Quet, Nov 13 2005

Keywords

Comments

a(n) is not divisible by (A114112(n+1)).
Sequence is A130883 union A014105 - {0,2}. - Anthony Hernandez, Sep 08 2016

Programs

  • Magma
    I:=[1,3,7,10,16]; [n le 5 select I[n] else 2*Self(n-1)-2*Self(n-3)+Self(n-4): n in [1..60]]; // Vincenzo Librandi, Mar 13 2018
    
  • Mathematica
    Join[{1}, LinearRecurrence[{2, 0, -2, 1}, {3, 7, 10, 16}, 52]] (* Jean-François Alcover, Sep 22 2017 *)
    CoefficientList[Series[(1 + x + x^2 -2 x^3 + x^4)/((1 + x) (1 - x)^3), {x, 0, 60}], x] (* Vincenzo Librandi, Mar 13 2018 *)
  • Python
    def A114113(n): return 1 if n == 1 else (m:=n//2)*(n+1) + (n+1-m)*(n-2*m) # Chai Wah Wu, May 24 2022

Formula

a(1)=1. a(2n) = n*(2n+1). a(2n+1) = 2n^2 +3n +2.
From R. J. Mathar, Nov 04 2008: (Start)
a(n) = A026035(n+1) - A026035(n), n>1.
G.f.: x(1+x+x^2-2x^3+x^4)/((1+x)(1-x)^3).
a(n) = 2*a(n-1)-2*a(n-3)+a(n-4), n>5. (End)
This is (essentially) 1 + A084265, - N. J. A. Sloane, Mar 12 2018

Extensions

More terms from R. J. Mathar, Aug 31 2007

A171608 Triangle by columns, T(n,k); (..., n, (n+1)) preceded by (n-1) zeros, as an infinite lower triangular matrix.

Original entry on oeis.org

1, 2, 0, 0, 2, 0, 0, 3, 0, 0, 0, 0, 3, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0
Offset: 1

Author

Gary W. Adamson, Dec 12 2009

Keywords

Comments

Let the triangle = M as an infinite lower triangular matrix.
M * (1, 2, 3, ...) = A002620: (1, 2, 4, 6, 9, 12, 16, 20, ...);
M * (1, 3, 5, ...) = A084265: (1, 2, 6, 9, 15, 20, 28, 35, ...);
M * (1, 3, 6, ...) = A028724: (1, 2, 6, 9, 18, 24, 40, 50, ...);
Limit_{n->infinity} M^n = A171609: (1, 2, 4, 6, 12, 16, 24, 30, ...).

Examples

			First few rows of the triangle:
  1;
  2, 0;
  0, 2, 0;
  0, 3, 0, 0;
  0, 0, 3, 0, 0;
  0, 0, 4, 0, 0, 0;
  0, 0, 0, 4, 0, 0, 0;
  0, 0, 0, 5, 0, 0, 0, 0;
  0, 0, 0, 0, 5, 0, 0, 0, 0;
  0, 0, 0, 0, 6, 0, 0, 0, 0, 0;
  0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0;
  0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0;
  0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0;
  0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0;
  0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0;
  0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0;
  ...
		

Crossrefs

Programs

  • Maple
    A171609 := proc(n,k)
        if k  = ceil(n/2) then
            floor( (n+2)/2) ;
        else
            0;
        end if;
    end proc:
    seq(seq( A171609(n,k),k=1..n),n=1..10) ; # R. J. Mathar, Sep 23 2021

Formula

Triangle by columns, T(n,k); (..., n, (n+1)) preceded by (n-1) zeros, as an infinite lower triangular matrix.

Extensions

More terms from Micah Manary, Aug 07 2022

A139755 Table of q-derangement numbers of type A, by rows.

Original entry on oeis.org

1, 1, 1, 1, 2, 2, 2, 1, 1, 1, 3, 5, 7, 8, 8, 6, 4, 2, 1, 4, 9, 16, 24, 32, 37, 38, 35, 28, 20, 12, 6, 2, 1, 1, 5, 14, 30, 54, 86, 123, 160, 191, 210, 214, 202, 176, 141, 104, 69, 41, 21, 9, 3, 1, 6, 20, 50, 104, 190, 313, 473, 663, 868, 1068, 1240, 1362, 1417, 1398, 1307, 1157, 968
Offset: 1

Author

Jonathan Vos Post, Jun 13 2008

Keywords

Comments

This sequence is from Table 1.1 of Chen and Wang, p. 2. Abstract: We show that the distribution of the coefficients of the q-derangement numbers is asymptotically normal. We also show that this property holds for the q-derangement numbers of type B.
Number of terms in row n appears to be A084265(n+2). - N. J. A. Sloane, Jul 20 2008
T(n,k) is the number of derangements in the set S(n) of permutations of {1,2,...,n} having major index equal to k. Example: T(4,3)=2 because we have 4312 (descent positions 1 and 2) and 2341 (descent position 3). - Emeric Deutsch, May 04 2009

Examples

			The table begins:
==============================================================================
k=...|.1.|.2.|.3.|..4.|..5.|..6.|..7.|..8.|..9.|.10.|.11.|.12.|.13.|.14.|.15.|
==============================================================================
n=2..|.1.|
n=3..|.1.|.1.|
n=4..|.1.|.2.|.2.|..2.|..1.|..1.|
n=5..|.1.|.3.|.5.|..7.|..8.|..8.|..6.|..4.|..2.|
n=6..|.1.|.4.|.9.|.16.|.24.|.32.|.37.|.38.|.35.|.28.|.20.|.12.|..6.|..2.|..1.|
===============================================================================
Number of terms in rows 2..22: [1,2,6,9,15,20,28,35,45,54,66,77,91,104,120,135,153,170,190,209,231].
From _Paul D. Hanna_, Jun 20 2009: (Start)
For row n=4, the sum over powers of I, a 4th root of unity, is:
1*I + 2*I^2 + 2*I^3 + 2*I^4 + 1*I^5 + 1*I^6 = -1. (End)
		

Crossrefs

Cf. diagonals: A141753, A141754.

Programs

  • Mathematica
    T[n_, k_] := SeriesCoefficient[QFactorial[n, q] Sum[(-1)^m q^(m(m-1)/2)/ QFactorial[m, q], {m, 0, n}], {q, 0, k}];
    Table[T[n, k], {n, 2, 8}, {k, 1, n(n-1)/2 - Mod[n, 2]}] // Flatten (* Jean-François Alcover, Jul 26 2018 *)
  • PARI
    T(n,k)=if(k<1 || k>n*(n-1)/2-(n%2),0,polcoeff( prod(j=1,n,(1-q^j)/(1-q))*sum(k=0,n,(-1)^k*q^(k*(k-1)/2)/if(k==0,1,prod(j =1,k,(1-q^j)/(1-q)))),k,q)) \\ Paul D. Hanna, Jul 07 2008

Formula

From Paul D. Hanna, Jun 20 2009: (Start)
For row n>1, the sum over powers of the n-th root of unity = -1:
-1 = Sum_{k=1..n*(n-1)/2} T(n,k)*exp(2*Pi*I*k/n), where I^2=-1.
(End)

Extensions

More terms from Paul D. Hanna, Jul 07 2008

A064843 a(n) = A064842(n)/2.

Original entry on oeis.org

0, 1, 3, 9, 18, 33, 53, 81, 116, 161, 215, 281, 358, 449, 553, 673, 808, 961, 1131, 1321, 1530, 1761, 2013, 2289, 2588, 2913, 3263, 3641, 4046, 4481, 4945, 5441, 5968, 6529, 7123, 7753, 8418, 9121, 9861, 10641, 11460, 12321, 13223, 14169
Offset: 1

Author

N. J. A. Sloane, Oct 25 2001

Keywords

Comments

Partial sums of A084265. - N. J. A. Sloane, Jul 20 2008

Crossrefs

Formula

G.f.: -x^2*(-1+x^3-2*x^2) / ( (1+x)*(x-1)^4 ). - R. J. Mathar, Nov 26 2012

A373418 Triangle read by rows: T(n,k) is the number of permutations in symmetric group S_n with (n-k) fixed points and an odd number of non-fixed point cycles. Equivalent to the number of cycles of n items with cycle type defined by non-unity partitions of k <= n that contain an odd number of parts.

Original entry on oeis.org

0, 0, 0, 0, 0, 1, 0, 0, 3, 2, 0, 0, 6, 8, 6, 0, 0, 10, 20, 30, 24, 0, 0, 15, 40, 90, 144, 135, 0, 0, 21, 70, 210, 504, 945, 930, 0, 0, 28, 112, 420, 1344, 3780, 7440, 7420, 0, 0, 36, 168, 756, 3024, 11340, 33480, 66780, 66752, 0, 0, 45, 240, 1260, 6048, 28350, 111600, 333900, 667520, 667485
Offset: 0

Author

Keywords

Comments

a(n) + A343417(n) = A098825(n) = partial derangement "rencontres" triangle.
a(n) - A343417(n) = (k-1) * binomial(n,k) = A127717(n-1,k-1).
Difference of 2nd and 1st leading diagonals (n > 0):
T(n,n-1) - T(n,n) = 0,-1,1,2,6,9,15,20,28,35,45,54,...
= (0-1) + (2+1) + (4+3) + (6+5) + (8+7) + (10+9) + ...
Cf. A084265(n) with 2 terms 0,-1 prepended (moving its offset from 0 to -2).

Examples

			Triangle begins:
   n: {k<=n}
   0: {0}
   1: {0, 0}
   2: {0, 0,  1}
   3: {0, 0,  3,   2}
   4: {0, 0,  6,   8,    6}
   5: {0, 0, 10,  20,   30,   24}
   6: {0, 0, 15,  40,   90,  144,   135}
   7: {0, 0, 21,  70,  210,  504,   945,    930}
   8: {0, 0, 28, 112,  420, 1344,  3780,   7440,   7420}
   9: {0, 0, 36, 168,  756, 3024, 11340,  33480,  66780,  66752}
  10: {0, 0, 45, 240, 1260, 6048, 28350, 111600, 333900, 667520, 667485}
T(n,0) = 0 because the sole permutation in S_n with n fixed points, namely the identity permutation, has 0 non-fixed point cycles, not an odd number.
T(n,1) = 0 because there are no permutations in S_n with (n-1) fixed points.
Example:
T(3,3) = 2 since S_3 contains 3 permutations with 0 fixed points and an odd number of non-fixed point cycles, namely the derangements (123) and (132).
Worked Example:
T(7,6) = 945 permutations in S_7 with 1 fixed point and an odd number of non-fixed point cycles;
T(7,6) = 945 possible 6- and (2,2,2)-cycles of 7 items.
N(n,y) = possible y-cycles of n items;
N(n,y) = (n!/(n-k)!) / (M(y) * s(y)).
y = partition of k<=n with q parts = (p_1, p_2, ..., p_i, ..., p_q) such that k = Sum_{i=1..q} p_i.
Or:
y = partition of k<=n with d distinct parts, each with multiplicity m_j = (y_1^m_1, y_2^m_2, ..., y_j^m_j, ..., y_d^m_d) such that k = Sum_{j=1..d} m_j*y_j.
M(y) = Product_{i=1..q} p_i = Product_{j=1..d} y_j^m_j.
s(y) = Product_{j=1..d} m_j! ("symmetry of repeated parts").
Note: (n!/(n-k)!) / s(y) = multinomial(n, {m_j}).
Therefore:
T(7,6) = N(7,y=(6)) + N(7,y=(2^3))
       = (7!/6) + (7!/(2^3)/3!)
       = 7! * (1/6 + 1/48)
       = 5040 * (3/16);
T(7,6) = 945.
		

Crossrefs

Cf. A373417 (even case), A373340 (row sums), A216779 (main diagonal).

Programs

  • Maple
    b:= proc(n, t) option remember; `if`(n=0, t, add(expand(`if`(j>1, x^j, 1)*
          b(n-j, irem(t+signum(j-1), 2)))*binomial(n-1, j-1)*(j-1)!, j=1..n))
        end:
    T:= n-> (p-> seq(coeff(p, x, i), i=0..n))(b(n, 0)):
    seq(T(n), n=0..10);
  • Mathematica
    Table[Table[n!/(n-k)!/2 * (Sum[(-1)^j/j!, {j, 0, k}] - ((k - 1)/k!)),{k,1,n}], {n,1,10}]

Formula

T(n,k) = (n!/(n-k)!/2) * ((Sum_{j=0..k} (-1)^j/j!) + (k-1)/k!). Cf. Sum_{j=0..k} (-1)^j/j! = A053557(k) / A053556(k).
Showing 1-9 of 9 results.