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 17 results. Next

A006003 a(n) = n*(n^2 + 1)/2.

Original entry on oeis.org

0, 1, 5, 15, 34, 65, 111, 175, 260, 369, 505, 671, 870, 1105, 1379, 1695, 2056, 2465, 2925, 3439, 4010, 4641, 5335, 6095, 6924, 7825, 8801, 9855, 10990, 12209, 13515, 14911, 16400, 17985, 19669, 21455, 23346, 25345, 27455, 29679, 32020, 34481, 37065, 39775
Offset: 0

Views

Author

Keywords

Comments

Write the natural numbers in groups: 1; 2,3; 4,5,6; 7,8,9,10; ... and add the groups. In other words, "sum of the next n natural numbers". - Felice Russo
Number of rhombi in an n X n rhombus, if 'crossformed' rhombi are allowed. - Matti De Craene (Matti.DeCraene(AT)rug.ac.be), May 14 2000
Also the sum of the integers between T(n-1)+1 and T(n), the n-th triangular number (A000217). Sum of n-th row of A000027 regarded as a triangular array.
Unlike the cubes which have a similar definition, it is possible for 2 terms of this sequence to sum to a third. E.g., a(36) + a(37) = 23346 + 25345 = 48691 = a(46). Might be called 2nd-order triangular numbers, thus defining 3rd-order triangular numbers (A027441) as n(n^3+1)/2, etc. - Jon Perry, Jan 14 2004
Also as a(n)=(1/6)*(3*n^3+3*n), n > 0: structured trigonal diamond numbers (vertex structure 4) (cf. A000330 = alternate vertex; A000447 = structured diamonds; A100145 for more on structured numbers). - James A. Record (james.record(AT)gmail.com), Nov 07 2004
The sequence M(n) of magic constants for n X n magic squares (numbered 1 through n^2) from n=3 begins M(n) = 15, 34, 65, 111, 175, 260, ... - Lekraj Beedassy, Apr 16 2005 [comment corrected by Colin Hall, Sep 11 2009]
The sequence Q(n) of magic constants for the n-queens problem in chess begins 0, 0, 0, 0, 34, 65, 111, 175, 260, ... - Paul Muljadi, Aug 23 2005
Alternate terms of A057587. - Jeremy Gardiner, Apr 10 2005
Also partial differences of A063488(n) = (2*n-1)*(n^2-n+2)/2. a(n) = A063488(n) - A063488(n-1) for n>1. - Alexander Adamchuk, Jun 03 2006
In an n X n grid of numbers from 1 to n^2, select -- in any manner -- one number from each row and column. Sum the selected numbers. The sum is independent of the choices and is equal to the n-th term of this sequence. - F.-J. Papp (fjpapp(AT)umich.edu), Jun 06 2006
Nonnegative X values of solutions to the equation (X-Y)^3 - (X+Y) = 0. To find Y values: b(n) = (n^3-n)/2. - Mohamed Bouhamida, May 16 2006
For the equation: m*(X-Y)^k - (X+Y) = 0 with X >= Y, k >= 2 and m is an odd number the X values are given by the sequence defined by a(n) = (m*n^k+n)/2. The Y values are given by the sequence defined by b(n) = (m*n^k-n)/2. - Mohamed Bouhamida, May 16 2006
If X is an n-set and Y a fixed 3-subset of X then a(n-3) is equal to the number of 4-subsets of X intersecting Y. - Milan Janjic, Jul 30 2007
(m*(2n)^k+n, m*(2n)^k-n) solves the Diophantine equation: 2m*(X-Y)^k - (X+Y) = 0 with X >= Y, k >= 2 where m is a positive integer. - Mohamed Bouhamida, Oct 02 2007
Also c^(1/2) in a^(1/2) + b^(1/2) = c^(1/2) such that a^2 + b = c. - Cino Hilliard, Feb 09 2008
a(n) = n*A000217(n) - Sum_{i=0..n-1} A001477(i). - Bruno Berselli, Apr 25 2010
a(n) is the number of triples (w,x,y) having all terms in {0,...,n} such that at least one of these inequalities fails: x+y < w, y+w < x, w+x < y. - Clark Kimberling, Jun 14 2012
Sum of n-th row of the triangle in A209297. - Reinhard Zumkeller, Jan 19 2013
The sequence starting with "1" is the third partial sum of (1, 2, 3, 3, 3, ...). - Gary W. Adamson, Sep 11 2015
a(n) is the largest eigenvalue of the matrix returned by the MATLAB command magic(n) for n > 0. - Altug Alkan, Nov 10 2015
a(n) is the number of triples (x,y,z) having all terms in {1,...,n} such that all these triangle inequalities are satisfied: x+y > z, y+z > x, z+x > y. - Heinz Dabrock, Jun 03 2016
Shares its digital root with the stella octangula numbers (A007588). See A267017. - Peter M. Chema, Aug 28 2016
Can be proved to be the number of nonnegative solutions of a system of three linear Diophantine equations for n >= 0 even: 2*a_{11} + a_{12} + a_{13} = n, 2*a_{22} + a_{12} + a_{23} = n and 2*a_{33} + a_{13} + a_{23} = n. The number of solutions is f(n) = (1/16)*(n+2)*(n^2 + 4n + 8) and a(n) = n*(n^2 + 1)/2 is obtained by remapping n -> 2*n-2. - Kamil Bradler, Oct 11 2016
For n > 0, a(n) coincides with the trace of the matrix formed by writing the numbers 1...n^2 back and forth along the antidiagonals (proved, see A078475 for the examples of matrix). - Stefano Spezia, Aug 07 2018
The trace of an n X n square matrix where the elements are entered on the ascending antidiagonals. The determinant is A069480. - Robert G. Wilson v, Aug 07 2018
Bisections are A317297 and A005917. - Omar E. Pol, Sep 01 2018
Number of achiral colorings of the vertices (or faces) of a regular tetrahedron with n available colors. An achiral coloring is identical to its reflection. - Robert A. Russell, Jan 22 2020
a(n) is the n-th centered triangular pyramidal number. - Lechoslaw Ratajczak, Nov 02 2021
a(n) is the number of words of length n defined on 4 letters {b,c,d,e} that contain one or no b's, one c or two d's, and any number of e's. For example, a(3) = 15 since the words are (number of permutations in parentheses): bce (6), bdd (3), cee (3), and dde (3). - Enrique Navarrete, Jun 21 2025

Examples

			G.f. = x + 5*x^2 + 15*x^3 + 34*x^4 + 65*x^5 + 111*x^6 + 175*x^7 + 260*x^8 + ...
For a(2)=5, the five tetrahedra have faces AAAA, AAAB, AABB, ABBB, and BBBB with colors A and B. - _Robert A. Russell_, Jan 31 2020
		

References

  • J.-M. De Koninck, Ces nombres qui nous fascinent, Entry 15, p. 5, Ellipses, Paris 2008.
  • F.-J. Papp, Colloquium Talk, Department of Mathematics, University of Michigan-Dearborn, March 6, 2005.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A000330, A000537, A066886, A057587, A027480, A002817 (partial sums).
Cf. A000578 (cubes).
(1/12)*t*(n^3-n)+n for t = 2, 4, 6, ... gives A004006, A006527, this sequence, A005900, A004068, A000578, A004126, A000447, A004188, A004466, A004467, A007588, A062025, A063521, A063522, A063523.
Antidiagonal sums of array in A000027. Row sums of the triangular view of A000027.
Cf. A063488 (sum of two consecutive terms), A005917 (bisection), A317297 (bisection).
Cf. A105374 / 8.
Tetrahedron colorings: A006008 (oriented), A000332(n+3) (unoriented), A000332 (chiral), A037270 (edges).
Other polyhedron colorings: A337898 (cube faces, octahedron vertices), A337897 (octahedron faces, cube vertices), A337962 (dodecahedron faces, icosahedron vertices), A337960 (icosahedron faces, dodecahedron vertices).
Row 3 of A325001 (simplex vertices and facets) and A337886 (simplex faces and peaks).

Programs

  • GAP
    a_n:=List([0..nmax], n->n*(n^2 + 1)/2); # Stefano Spezia, Aug 12 2018
    
  • Haskell
    a006003 n = n * (n ^ 2 + 1) `div` 2
    a006003_list = scanl (+) 0 a005448_list
    -- Reinhard Zumkeller, Jun 20 2013
    
  • MATLAB
    % Also works with FreeMat.
    for(n=0:nmax); tm=n*(n^2 + 1)/2; fprintf('%d\t%0.f\n', n, tm); end
    % Stefano Spezia, Aug 12 2018
    
  • Magma
    [n*(n^2 + 1)/2 : n in [0..50]]; // Wesley Ivan Hurt, Sep 11 2015
    
  • Magma
    [Binomial(n,3)+Binomial(n-1,3)+Binomial(n-2,3): n in [2..60]]; // Vincenzo Librandi, Sep 12 2015
    
  • Mathematica
    Table[ n(n^2 + 1)/2, {n, 0, 45}]
    LinearRecurrence[{4,-6,4,-1}, {0,1,5,15},50] (* Harvey P. Dale, May 16 2012 *)
    CoefficientList[Series[x (1 + x + x^2)/(x - 1)^4, {x, 0, 45}], x] (* Vincenzo Librandi, Sep 12 2015 *)
    With[{n=50},Total/@TakeList[Range[(n(n^2+1))/2],Range[0,n]]] (* Requires Mathematica version 11 or later *) (* Harvey P. Dale, Nov 28 2017 *)
  • Maxima
    a(n):=n*(n^2 + 1)/2$ makelist(a(n), n, 0, nmax); /* Stefano Spezia, Aug 12 2018 */
    
  • PARI
    {a(n) = n * (n^2 + 1) / 2}; /* Michael Somos, Dec 24 2011 */
    
  • PARI
    concat(0, Vec(x*(1+x+x^2)/(x-1)^4 + O(x^20))) \\ Felix Fröhlich, Oct 11 2016
    
  • Python
    def A006003(n): return n*(n**2+1)>>1 # Chai Wah Wu, Mar 25 2024

Formula

a(n) = binomial(n+2, 3) + binomial(n+1, 3) + binomial(n, 3). [corrected by Michel Marcus, Jan 22 2020]
G.f.: x*(1+x+x^2)/(x-1)^4. - Floor van Lamoen, Feb 11 2002
Partial sums of A005448. - Jonathan Vos Post, Mar 16 2006
Binomial transform of [1, 4, 6, 3, 0, 0, 0, ...] = (1, 5, 15, 34, 65, ...). - Gary W. Adamson, Aug 10 2007
a(n) = -a(-n) for all n in Z. - Michael Somos, Dec 24 2011
a(n) = Sum_{k = 1..n} A(k-1, k-1-n) where A(i, j) = i^2 + i*j + j^2 + i + j + 1. - Michael Somos, Jan 02 2012
a(n) = 4*a(n-1) - 6*a(n-2) + 4*a(n-3) - a(n-4), with a(0)=0, a(1)=1, a(2)=5, a(3)=15. - Harvey P. Dale, May 16 2012
a(n) = 3*a(n-1) - 3*a(n-2) + a(n-3) + 3. - Ant King, Jun 13 2012
a(n) = A000217(n) + n*A000217(n-1). - Bruno Berselli, Jun 07 2013
a(n) = A057145(n+3,n). - Luciano Ancora, Apr 10 2015
E.g.f.: (1/2)*(2*x + 3*x^2 + x^3)*exp(x). - G. C. Greubel, Dec 18 2015; corrected by Ilya Gutkovskiy, Oct 12 2016
a(n) = T(n) + T(n-1) + T(n-2), where T means the tetrahedral numbers, A000292. - Heinz Dabrock, Jun 03 2016
From Ilya Gutkovskiy, Oct 11 2016: (Start)
Convolution of A001477 and A008486.
Convolution of A000217 and A158799.
Sum_{n>=1} 1/a(n) = H(-i) + H(i) = 1.343731971048019675756781..., where H(k) is the harmonic number, i is the imaginary unit. (End)
a(n) = A000578(n) - A135503(n). - Miquel Cerda, Dec 25 2016
Euler transform of length 3 sequence [5, 0, -1]. - Michael Somos, Dec 25 2016
a(n) = A037270(n)/n for n > 0. - Kritsada Moomuang, Dec 15 2018
a(n) = 3*A000292(n-1) + n. - Bruce J. Nicholson, Nov 23 2019
a(n) = A011863(n) - A011863(n-2). - Bruce J. Nicholson, Dec 22 2019
From Robert A. Russell, Jan 22 2020: (Start)
a(n) = C(n,1) + 3*C(n,2) + 3*C(n,3), where the coefficient of C(n,k) is the number of tetrahedron colorings using exactly k colors.
a(n) = C(n+3,4) - C(n,4).
a(n) = 2*A000332(n+3) - A006008(n) = A006008(n) - 2*A000332(n) = A000332(n+3) - A000332(n).
a(n) = A325001(3,n). (End)
From Amiram Eldar, Aug 21 2023: (Start)
Sum_{n>=1} 1/a(n) = 2 * (A248177 + A001620).
Product_{n>=2} (1 - 1/a(n)) = cosh(sqrt(7)*Pi/2)*cosech(Pi)/4.
Product_{n>=1} (1 + 1/a(n)) = cosh(sqrt(7)*Pi/2)*cosech(Pi). (End)

Extensions

Better description from Albert Rich (Albert_Rich(AT)msn.com), Mar 1997

A008486 Expansion of (1 + x + x^2)/(1 - x)^2.

Original entry on oeis.org

1, 3, 6, 9, 12, 15, 18, 21, 24, 27, 30, 33, 36, 39, 42, 45, 48, 51, 54, 57, 60, 63, 66, 69, 72, 75, 78, 81, 84, 87, 90, 93, 96, 99, 102, 105, 108, 111, 114, 117, 120, 123, 126, 129, 132, 135, 138, 141, 144, 147, 150, 153, 156, 159, 162, 165, 168, 171, 174, 177, 180, 183, 186
Offset: 0

Views

Author

Keywords

Comments

Also the Engel expansion of exp^(1/3); cf. A006784 for the Engel expansion definition. - Benoit Cloitre, Mar 03 2002
Coordination sequence for planar net 6^3 (the graphite net, or the graphene crystal) - that is, the number of atoms at graph distance n from any fixed atom. Also for the hcb or honeycomb net. - N. J. A. Sloane, Jan 06 2013, Mar 31 2018
Coordination sequence for 2-dimensional cyclotomic lattice Z[zeta_3].
Conjecture: This is also the maximum number of edges possible in a planar simple graph with n+2 vertices. - Dmitry Kamenetsky, Jun 29 2008
The conjecture is correct. Proof: For n=0 the theorem holds, the maximum planar graph has n+2=2 vertices and 1 edge. Now suppose that we have a connected planar graph with at least 3 vertices. If it contains a face that is not a triangle, we can add an edge that divides this face into two without breaking its planarity. Hence all maximum planar graphs are triangulations. Euler's formula for planar graphs states that in any planar simple graph with V vertices, E edges and F faces we have V+F-E=2. If all faces are triangles, then F=2E/3, which gives us E=3V-6. Hence for n>0 each maximum planar simple graph with n+2 vertices has 3n edges. - Michal Forisek, Apr 23 2009
a(n) = sum of natural numbers m such that n - 1 <= m <= n + 1. Generalization: If a(n,k) = sum of natural numbers m such that n - k <= m <= n + k (k >= 1) then a(n,k) = (k + n)*(k + n + 1)/2 = A000217(k+n) for 0 <= n <= k, a(n,k) = a(n-1,k) +2k + 1 = ((k + n - 1)*(k + n)/2) + 2k + 1 = A000217(k+n-1) +2k +1 for n >= k + 1 (see e.g. A008486). - Jaroslav Krizek, Nov 18 2009
a(n) = partial sums of A158799(n). Partial sums of a(n) = A005448(n). - Jaroslav Krizek, Dec 06 2009
Integers n dividing a(n) = a(n-1) - a(n-2) with initial conditions a(0)=0, a(1)=1 (see A128834 with offset 0). - Thomas M. Bridge, Nov 03 2013
a(n) is conjectured to be the number of polygons added after n iterations of the polygon expansions (type A, B, C, D & E) shown in the Ngaokrajang link. The patterns are supposed to become the planar Archimedean net 3.3.3.3.3.3, 3.6.3.6, 3.12.12, 3.3.3.3.6 and 4.6.12 respectively when n - > infinity. - Kival Ngaokrajang, Dec 28 2014
Number of reduced words of length n in Coxeter group on 3 generators S_i with relations (S_i)^2 = (S_i S_j)^3 = I. - Ray Chandler, Nov 21 2016
Conjecture: let m = n + 2, p is the polyhedron formed by the convex hull of m points, q is the number of quadrilateral faces of p (see the Wikipedia link below), and f(m) = a(n) - q. Then f(m) would be the solution of the Thompson problem for all m in 3-space. - Sergey Pavlov, Feb 03 2017
Also, sequence defined by a(0)=1, a(1)=3, c(0)=2, c(1)=4; and thereafter a(n) = c(n-1) + c(n-2), and c consists of the numbers missing from a (see A001651). - Ivan Neretin, Mar 28 2017

Examples

			G.f. = 1 + 3*x + 6*x^2 + 9*x^3 + 12*x^4 + 15*x^5 + 18*x^6 + 21*x^7 + 24*x^8 + ...
From _Omar E. Pol_, Aug 20 2011: (Start)
Illustration of initial terms as triangles:
.                                              o
.                                 o           o o
.                      o         o o         o   o
.             o       o o       o   o       o     o
.      o     o o     o   o     o     o     o       o
. o   o o   o o o   o o o o   o o o o o   o o o o o o
.
. 1    3      6        9          12           15
(End)
		

References

  • J. V. Uspensky and M. A. Heaslet, Elementary Number Theory, McGraw-Hill, NY, 1939, p. 158.

Crossrefs

Partial sums give A005448.
List of coordination sequences for uniform planar nets: A008458 (the planar net 3.3.3.3.3.3), A008486 (6^3), A008574(4.4.4.4 and 3.4.6.4), A008576 (4.8.8), A008579(3.6.3.6), A008706 (3.3.3.4.4), A072154 (4.6.12), A219529(3.3.4.3.4), A250120 (3.3.3.3.6), A250122 (3.12.12).
List of coordination sequences for Laves tilings (or duals of uniform planar nets): [3,3,3,3,3.3] = A008486; [3.3.3.3.6] = A298014, A298015, A298016; [3.3.3.4.4] = A298022, A298024; [3.3.4.3.4] = A008574, A296368; [3.6.3.6] = A298026, A298028; [3.4.6.4] = A298029, A298031, A298033; [3.12.12] = A019557, A298035; [4.4.4.4] = A008574; [4.6.12] = A298036, A298038, A298040; [4.8.8] = A022144, A234275; [6.6.6] = A008458.

Programs

  • Haskell
    a008486 0 = 1; a008486 n = 3 * n
    a008486_list = 1 : [3, 6 ..]  -- Reinhard Zumkeller, Apr 17 2015
  • Magma
    [0^n+3*n: n in [0..90] ]; // Vincenzo Librandi, Aug 21 2011
    
  • Mathematica
    CoefficientList[Series[(1 + x + x^2) / (1 - x)^2, {x, 0, 80}], x] (* Vincenzo Librandi, Nov 23 2014 *)
    a[ n_] := If[ n == 0, 1, 3 n]; (* Michael Somos, Apr 17 2015 *)
  • PARI
    {a(n) = if( n==0, 1, 3 * n)}; /* Michael Somos, May 05 2015 */
    

Formula

a(0) = 1; a(n) = 3*n = A008585(n), n >= 1.
Euler transform of length 3 sequence [3, 0, -1]. - Michael Somos, Aug 04 2009
a(n) = a(n-1) + 3 for n >= 2. - Jaroslav Krizek, Nov 18 2009
a(n) = 0^n + 3*n. - Vincenzo Librandi, Aug 21 2011
a(n) = -a(-n) unless n = 0. - Michael Somos, May 05 2015
E.g.f.: 1 + 3*exp(x)*x. - Stefano Spezia, Aug 07 2022

A130716 a(0)=a(1)=a(2)=1, a(n)=0 for n>2.

Original entry on oeis.org

1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Offset: 0

Views

Author

Paul Curtz and Tanya Khovanova, Jul 01 2007

Keywords

Comments

With different signs this sequence is the convolutional inverse of the Fibonacci sequence: 1, -1, -1, 0, 0, ... - Tanya Khovanova, Jul 14 2007
Inverse binomial transform of A000124. - R. J. Mathar, Jun 13 2008
Partial sums give A158799. [Jaroslav Krizek, Dec 06 2009]

Examples

			G.f. = 1 + x + x^2.
G.f. = 1/q + 1 + q.
		

Crossrefs

Cf. A049347.

Programs

  • Mathematica
    a[ n_] := Boole[ n>=0 && n<=2]; (* Michael Somos, Oct 22 2013 *)
  • PARI
    {a(n) = n>=0 && n<=2}; /* Michael Somos, Oct 22 2013 */

Formula

Given g.f. A(x), then B(a) = A(q) / q satisfies 0 = f(B(q), B(q^2)) where f(u, v) = v - u * (u - 2). - Michael Somos, Oct 22 2013
Euler transform of length 3 sequence [ 1, 0, -1]. - Michael Somos, Oct 22 2013
G.f. is third cyclotomic polynomial.
G.f.: (1 - x^3) / (1 - x).
Convolution inverse is A049347. - Michael Somos, Oct 22 2013

A157532 a(1) = 2; for n > 1, a(n) = 3.

Original entry on oeis.org

2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3
Offset: 1

Views

Author

Jaroslav Krizek, Mar 02 2009

Keywords

Comments

a(n) = number of neighboring natural numbers of n (e.g., n, n-1, n+1).
a(n) = A158799(n) for n >= 1. - Jaroslav Krizek, Nov 18 2009
Also decimal expansion of 7/3. - Natan Arie Consigli, May 02 2015
Decimal expansion of Sum_{i>=0} (4/7)^i. - Bruno Berselli, Aug 23 2017

Examples

			a(4) = 1[0]1[1]1[2]1[3]1[4]1 = '1+1*1^1^^1 = 3. - _Natan Arie Consigli_, May 02 2015
		

Crossrefs

Cf. A254310 (3[0]3[1]...[n]3), A254225 (2[0]2[1]...[n]2).
Except for initial terms, the same as A156752 and A165020. - M. F. Hasler, Jul 30 2015

Programs

Formula

a(n) = 1[0]1[1]1...1[n-1]1[n]1, where [0] is zeration or successor (y[0]x = x+1), [1] addition, [2] multiplication, [3] exponentiation, [4] repeated exponentiation, etc. - Natan Arie Consigli, May 02 2015
G.f.: x*(2+x)/(1-x). - Robert Israel, May 07 2015

Extensions

More threes from R. J. Mathar, Mar 14 2009; truncated to three lines by M. F. Hasler, Jul 30 2015

A093966 Array read by antidiagonals: number of {112,221}-avoiding words.

Original entry on oeis.org

1, 1, 2, 1, 4, 3, 1, 6, 9, 4, 1, 6, 21, 16, 5, 1, 6, 33, 52, 25, 6, 1, 6, 33, 124, 105, 36, 7, 1, 6, 33, 196, 345, 186, 49, 8, 1, 6, 33, 196, 825, 786, 301, 64, 9, 1, 6, 33, 196, 1305, 2586, 1561, 456, 81, 10, 1, 6, 33, 196, 1305, 6186, 6601, 2808, 657, 100, 11
Offset: 1

Views

Author

Ralf Stephan, Apr 20 2004

Keywords

Comments

A(n,k) is the number of n-long k-ary words that simultaneously avoid the patterns 112 and 221.

Examples

			Array, A(n, k), begins as:
  1,  1,   1,    1,    1,     1,     1 ... 1*A000012(k);
  2,  4,   6,    6,    6,     6,     6 ... 2*A158799(k-1);
  3,  9,  21,   33,   33,    33,    33 ... ;
  4, 16,  52,  124,  196,   196,   196 ... ;
  5, 25, 105,  345,  825,  1305,  1305 ... ;
  6, 36, 186,  786, 2586,  6186,  9786 ... ;
  7, 49, 301, 1561, 6601, 21721, 51961 ... ;
Antidiagonal triangle, T(n, k), begins as:
  1;
  1, 2;
  1, 4,  3;
  1, 6,  9,   4;
  1, 6, 21,  16,    5;
  1, 6, 33,  52,   25,    6;
  1, 6, 33, 124,  105,   36,    7;
  1, 6, 33, 196,  345,  186,   49,   8;
  1, 6, 33, 196,  825,  786,  301,  64,  9;
  1, 6, 33, 196, 1305, 2586, 1561, 456, 81, 10;
		

Crossrefs

Cf. A069778, A093963 (antidiagonal sums), A093964, A093965 (main diagonal).

Programs

  • Mathematica
    A[n_, k_]:= A[n, k]= If[n==1, 1, If[k==1, n, If[2<=kG. C. Greubel, Dec 29 2021 *)
  • PARI
    A(n,k) = if(n >= k+1, sum(j=1, k, j*j!*binomial(k,j)), if(n<2, if(n<1, 0, k), n!*binomial(k,n) + sum(j=1, n-1, j*j!*binomial(k,j))));
    T(n,k) = A(n-k+1, k);
    for(n=1, 15, for(k=1, n, print1(T(n, k), ", ") ) )
    
  • Sage
    @CachedFunction
    def A(n,k):
        if (n==1): return 1
        elif (k==1): return n
        elif (2 <= k < n+1): return factorial(k)*binomial(n,k) + sum( j*factorial(j)*binomial(n,j) for j in (1..k-1) )
        else: return sum( j*factorial(j)*binomial(n,j) for j in (1..n) )
    def T(n,k): return A(k, n-k+1)
    flatten([[T(n,k) for k in (1..n)] for n in (1..15)]) # G. C. Greubel, Dec 29 2021

Formula

A(n, k) = k!*binomial(n, k) + Sum_{j=1..k-1} j*j!*binomial(n, j), for 2 <= k <= n, otherwise Sum_{j=1..n} j*j!*binomial(n, j), with A(1, k) = 1 and A(n, 1) = n.
From G. C. Greubel, Dec 29 2021: (Start)
T(n, k) = A(k, n-k+1).
Sum_{k=1..n} T(n, k) = A093963(n).
T(n, 1) = 1.
T(n, n) = n.
T(n, n-1) = (n-1)^2.
T(n, n-2) = A069778(n).
T(2*n-1, n) = A093965(n).
T(2*n, n) = A093964(n), for n >= 1. (End)

A275015 Number of neighbors of each new term in an isosceles triangle read by rows.

Original entry on oeis.org

0, 1, 2, 1, 3, 2, 1, 3, 3, 2, 1, 3, 3, 3, 2, 1, 3, 3, 3, 3, 2, 1, 3, 3, 3, 3, 3, 2, 1, 3, 3, 3, 3, 3, 3, 2, 1, 3, 3, 3, 3, 3, 3, 3, 2, 1, 3, 3, 3, 3, 3, 3, 3, 3, 2, 1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2
Offset: 1

Views

Author

Omar E. Pol, Nov 20 2016

Keywords

Comments

To evaluate a(n) consider only the neighbors of a(n) that are present in the isosceles triangle when a(n) should be a new term in the triangle.
Apart from the left border and the right border, the rest of the elements are 3's.
If every "3" is replaced with a "4", we have the sequence A278290.
a(n) is also the number of new penny-penny contacts when putting pennies in a triangular arrangement.
For the same idea but for a right triangle see A278317; for a square array see A278290, for a square spiral see A278354; and for a hexagonal spiral see A047931.

Examples

			The sequence written as an isosceles triangle begins:
.
.                     0;
.                   1,  2;
.                 1,  3,  2;
.               1,  3,  3,  2;
.             1,  3,  3,  3,  2;
.           1,  3,  3,  3,  3,  2;
.         1,  3,  3,  3,  3,  3,  2;
.       1,  3,  3,  3,  3,  3,  3,  2;
.     1,  3,  3,  3,  3,  3,  3,  3,  2;
.   1,  3,  3,  3,  3,  3,  3,  3,  3,  2;
...
		

Crossrefs

Row sums give A008585.
Left border gives A057427.
Every diagonal that is parallel to the left border gives the elements greater than 1 of A158799.
Right border gives 0 together with A007395, also twice A057427.
Every diagonal that is parallel to the right border gives A122553.

Programs

  • Mathematica
    Table[Boole[n > 1] (Prepend[Reverse@ Rest@ #, First@ #] &@ Range@ n /. k_ /; k > 3 -> 3), {n, 13}] // Flatten (* or *)
    Table[Boole[n > 1] (Map[Mod[#, n] &, Range@ n] /. {k_ /; k > 1 -> 3, 0 -> 2}), {n, 13}] // Flatten (* Michael De Vlieger, Nov 23 2016 *)

A168092 a(n) = number of natural numbers m such that n - 2 <= m <= n + 2.

Original entry on oeis.org

2, 3, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5
Offset: 0

Views

Author

Jaroslav Krizek, Nov 18 2009

Keywords

Comments

Generalization: If a(n,k) = number of natural numbers m such that n - k <= m <= n + k (k >= 1) then a(n,k) = a(n-1,k) + 1 = n + k for 0 <= n <= k, a(n,k) = a(n-1,k) = 2k + 1 for n >= k + 1 (see, e.g., A158799). a(n) = (2 + n) for 0 <= n <= 2, a(n) = 5 for n >= 3.

Crossrefs

Cf. A158411. - Jaume Oliver Lafont, Nov 29 2009

Formula

G.f.: (2+x+x^2+x^3)/(1-x) = 1/(1-x)+(1-x^4)/(1-x)^2. - Jaume Oliver Lafont, Nov 29 2009

A168093 a(n) = number of natural numbers m such that n - 3 <= m <= n + 3.

Original entry on oeis.org

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

Views

Author

Jaroslav Krizek, Nov 18 2009

Keywords

Comments

Generalization: If a(n,k) = number of natural numbers m such that n - k <= m <= n + k (k >= 1) then a(n,k) = a(n-1,k) + 1 = n + k for 0 <= n <= k, a(n,k) = a(n-1,k) = 2k + 1 for n >= k + 1 (see, e.g., A158799).

Crossrefs

Cf. A000027.

Programs

  • Mathematica
    CoefficientList[Series[(3 - 2*x - x^5)/(1 - x)^2, {x, 0, 25}], x] (* G. C. Greubel, Jul 11 2016 *)

Formula

a(n) = 3 + n for 0 <= n <= 3, a(n) = 7 for n >= 4.
G.f.: (3 - 2*x - x^5)/(1-x)^2. - G. C. Greubel, Jul 11 2016

A168094 a(n) = number of natural numbers m such that n - 4 <= m <= n + 4.

Original entry on oeis.org

4, 5, 6, 7, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9
Offset: 0

Views

Author

Jaroslav Krizek, Nov 18 2009

Keywords

Comments

Generalization: If a(n,k) = number of natural numbers m such that n - k <= m <= n + k (k >= 1) then a(n,k) = a(n-1,k) + 1 = n + k for 0 <= n <= k, a(n,k) = a(n-1,k) = 2k + 1 for n >= k + 1 (see, e.g., A158799).

Crossrefs

Cf. A000027.

Programs

  • Mathematica
    CoefficientList[Series[(4 - 3*x - x^6)/(1 - x)^2, {x, 0, 25}], x] (* G. C. Greubel, Jul 12 2016 *)

Formula

a(n) = 4 + n for 0 <= n <= 4, a(n) = 9 for n >= 4.
G.f.: (4 - 3*x - x^6)/(1 - x)^2. - G. C. Greubel, Jul 12 2016

A168095 a(n) = number of natural numbers m such that n - 5 <= m <= n + 5.

Original entry on oeis.org

5, 6, 7, 8, 9, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11
Offset: 0

Views

Author

Jaroslav Krizek, Nov 18 2009

Keywords

Comments

Generalization: If a(n,k) = number of natural numbers m such that n - k <= m <= n + k (k >= 1) then a(n,k) = a(n-1,k) + 1 = n + k for 0 <= n <= k, a(n,k) = a(n-1,k) = 2k + 1 for n >= k + 1 (see, e.g., A158799).

Crossrefs

Cf. A000027.

Programs

  • Mathematica
    CoefficientList[Series[(5 - 4*x - x^7)/(1 - x)^2, {x, 0, 25}], x] (* G. C. Greubel, Jul 12 2016 *)

Formula

a(n) = 5 + n for 0 <= n <= 5, a(n) = 11 for n >= 6.
G.f.: (5 - 4*x - x^7)/(1-x)^2. - G. C. Greubel, Jul 12 2016
Showing 1-10 of 17 results. Next