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.

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

A130883 a(n) = 2*n^2 - n + 1.

Original entry on oeis.org

1, 2, 7, 16, 29, 46, 67, 92, 121, 154, 191, 232, 277, 326, 379, 436, 497, 562, 631, 704, 781, 862, 947, 1036, 1129, 1226, 1327, 1432, 1541, 1654, 1771, 1892, 2017, 2146, 2279, 2416, 2557, 2702, 2851, 3004, 3161, 3322, 3487, 3656, 3829, 4006, 4187, 4372, 4561
Offset: 0

Views

Author

Mohammad K. Azarian, Jul 26 2007

Keywords

Comments

Maximum number of regions determined by n bent lines (or angular sectors). See Concrete Mathematics reference.
A "bent line" may also be regarded as a "long-legged letter V", meaning a letter V with both line segments extended to infinity. See A117625 for the analogous sequence for a long-legged Z. - N. J. A. Sloane, Jun 18 2025
a(n)*Pi is the total length of half circle spiral after n rotations. It is formed as irregular spiral with two center points. At the 2nd stage, there are two alternatives: (1) select 2nd half circle radius, r2 = 2, the sequence will be A014105 or (2) select r2 = 0, the sequence will be A130883. See illustration in links. - Kival Ngaokrajang, Jan 19 2014
A128218(a(n)) = 2*n+1 and A128218(m) != 2*n+1 for m < a(n). - Reinhard Zumkeller, Jun 20 2015

References

  • R. L. Graham, D. E. Knuth and O. Patashnik, Concrete Mathematics, 2nd ed., Addison-Wesley, Reading, MA, 1994, pp. 7-8, and Problem 1.18, pages 19 and 500.

Crossrefs

See also A117625.
A row of the array in A386478.

Programs

Formula

a(n) = a(n-1) + 4*n - 3 for n > 0, a(0)=1. - Vincenzo Librandi, Nov 23 2010
a(n) = A000124(2*n) - 2*n. - Geoffrey Critzer, Mar 30 2011
O.g.f.: (4*x^2-x+1)/(1-x)^3. - Geoffrey Critzer, Mar 30 2011
a(n) = 2*a(n-1) - a(n-2) + 4. - Eric Werley, Jun 27 2011
a(0)=1, a(1)=2, a(2)=7; for n > 2, a(n) = 3*a(n-1) - 3*a(n-2) + a(n-3). - Harvey P. Dale, Jul 20 2011
a(n) = A128918(2*n). - Reinhard Zumkeller, Oct 27 2013
a(n) = 1 + A000384(n). - Omar E. Pol, Apr 27 2017
E.g.f.: (2*x^2 + x + 1)*exp(x). - G. C. Greubel, Jul 14 2017
a(n) = A152947(2*n+1). - Franck Maminirina Ramaharo, Jan 10 2018

A131179 a(n) = if n mod 2 == 0 then n*(n+1)/2, otherwise (n-1)*n/2 + 1.

Original entry on oeis.org

0, 1, 3, 4, 10, 11, 21, 22, 36, 37, 55, 56, 78, 79, 105, 106, 136, 137, 171, 172, 210, 211, 253, 254, 300, 301, 351, 352, 406, 407, 465, 466, 528, 529, 595, 596, 666, 667, 741, 742, 820, 821, 903, 904, 990, 991, 1081, 1082, 1176, 1177, 1275, 1276, 1378, 1379, 1485
Offset: 0

Views

Author

Philippe LALLOUET, Sep 16 2007

Keywords

Comments

From Wesley Ivan Hurt, Jun 24 2024: (Start)
Fill an array with the natural numbers n = 1,2,... along diagonals in alternating 'down' and 'up' directions. For n > 0, a(n) is row 1 of the boustrophedon-style array (see example).
In general, row k is given by (1+t^2+(n-k)*(-1)^t)/2, t = n+k-1. Here, k=1, n>0. (End)

Examples

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

Crossrefs

Cf. A128918.
For rows k = 1..10: this sequence (k=1) n>0, A373662 (k=2), A373663 (k=3), A374004 (k=4), A374005 (k=5), A374007 (k=6), A374008 (k=7), A374009 (k=8), A374010 (k=9), A374011 (k=10).

Programs

  • Haskell
    a131179 n = (n + 1 - m) * n' + m  where (n', m) = divMod n 2
    -- Reinhard Zumkeller, Oct 12 2013
    
  • Magma
    [(n^2+1+(n-1)*(-1)^n )/2: n in [0..60]]; // Vincenzo Librandi, Feb 12 2016
    
  • Mathematica
    LinearRecurrence[{1, 2, -2, -1, 1}, {0, 1, 3, 4, 10}, 60] (* Jean-François Alcover, Feb 12 2016 *)
    Table[If[EvenQ[n],(n(n+1))/2,(n(n-1))/2+1],{n,0,60}] (* Harvey P. Dale, Jul 25 2024 *)
  • Python
    def A131179(n): return n*(n+1)//2 + (1-n)*(n % 2) # Chai Wah Wu, May 24 2022

Formula

G.f.: -x*(1+2*x-x^2+2*x^3)/((1+x)^2*(x-1)^3). - R. J. Mathar, Sep 05 2012
a(n) = ( n^2+1+(n-1)*(-1)^n )/2. - Luce ETIENNE, Aug 19 2014

A265721 Decimal representation of the n-th iteration of the "Rule 1" elementary cellular automaton starting with a single ON (black) cell.

Original entry on oeis.org

1, 0, 4, 99, 16, 1935, 64, 32319, 256, 522495, 1024, 8381439, 4096, 134189055, 16384, 2147368959, 65536, 34359279615, 262144, 549753978879, 1048576, 8796085682175, 4194304, 140737458995199, 16777216, 2251799696244735, 67108864, 36028796549201919, 268435456
Offset: 0

Views

Author

Robert Price, Dec 14 2015

Keywords

Comments

Rule 33 also generates this sequence.

Examples

			From _Michael De Vlieger_, Dec 14 2015: (Start)
First 8 rows, replacing leading zeros with ".", the row converted to its binary (A265720), then decimal equivalent at right:
              1                ->               1  =     1
            . . 0              ->               0  =     0
          . . 1 0 0            ->             100  =     4
        1 1 0 0 0 1 1          ->         1100011  =    99
      . . . . 1 0 0 0 0        ->           10000  =    16
    1 1 1 1 0 0 0 1 1 1 1      ->     11110001111  =  1935
  . . . . . . 1 0 0 0 0 0 0    ->         1000000  =    64
1 1 1 1 1 1 0 0 0 1 1 1 1 1 1  -> 111111000111111  = 32319
(End)
		

References

  • S. Wolfram, A New Kind of Science, Wolfram Media, 2002; p. 55.

Crossrefs

Programs

  • Mathematica
    rule = 1; rows = 30; Table[FromDigits[Table[Take[CellularAutomaton[rule,{{1},0}, rows-1, {All,All}][[k]], {rows-k+1, rows+k-1}], {k,1,rows}][[k]],2], {k,1,rows}]
  • Python
    print([2*4**n  - 7*2**(n-1) - 1 if n%2 else 2**n for n in range(50)]) # Karl V. Keller, Jr., Aug 24 2021

Formula

From Colin Barker, Dec 14 2015 and Apr 16 2019: (Start)
a(n) = 21*a(n-2) - 84*a(n-4) + 64*a(n-6) for n>5.
G.f.: (1-17*x^2+99*x^3+16*x^4-144*x^5) / ((1-x)*(1+x)*(1-2*x)*(1+2*x)*(1-4*x)*(1+4*x)).
(End)
a(n) = 2*4^n - 7*2^(n-1) - 1 for odd n; a(n) = 2^n for even n. - Karl V. Keller, Jr., Aug 24 2021

A316966 Same as A316671, except numbering of the squares starts at 0 rather than 1.

Original entry on oeis.org

0, 4, 3, 11, 10, 22, 21, 37, 36, 56, 55, 79, 78, 106, 105, 137, 136, 172, 171, 211, 210, 254, 253, 301, 300, 352, 351, 407, 406, 466, 465, 529, 528, 596, 595, 667, 666, 742, 741, 821, 820, 904, 903, 991, 990, 1082, 1081, 1177, 1176, 1276, 1275, 1379, 1378
Offset: 0

Views

Author

Daniël Karssen, Jul 17 2018

Keywords

Comments

See A316671 for further information.

Crossrefs

Cf. A316671.
Cf. A128918: it is provided by a(-n-1).

Programs

  • Mathematica
    Table[1 + (n + 2) (n - (-1)^n)/2, {n, 0, 60}] (* Bruno Berselli, Jul 19 2018 *)
  • PARI
    concat(0, Vec(x*(4 - x + x^3) / ((1 - x)^3*(1 + x)^2) + O(x^40))) \\ Colin Barker, Jul 19 2018

Formula

a(n) = A316671(n+1) - 1.
From Colin Barker, Jul 19 2018: (Start)
G.f.: x*(4 - x + x^3) / ((1 - x)^3*(1 + x)^2).
a(n) = a(n-1) + 2*a(n-2) - 2*a(n-3) - a(n-4) + a(n-5) for n>4. (End)
a(n) = 1 + (n + 2)*(n - (-1)^n)/2. - Bruno Berselli, Jul 19 2018

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

Original entry on oeis.org

3, 5, 8, 14, 17, 27, 30, 44, 47, 65, 68, 90, 93, 119, 122, 152, 155, 189, 192, 230, 233, 275, 278, 324, 327, 377, 380, 434, 437, 495, 498, 560, 563, 629, 632, 702, 705, 779, 782, 860, 863, 945, 948, 1034, 1037, 1127, 1130, 1224, 1227, 1325, 1328, 1430, 1433, 1539
Offset: 1

Views

Author

Wesley Ivan Hurt, Jun 27 2024

Keywords

Comments

Fill an array with the natural numbers n = 1,2,... along diagonals in alternating 'down' and 'up' directions. a(n) is column 2 of the boustrophedon-style array (see example).
In general, column k is given by (1+(t-1)^2+(n-k)*(-1)^t)/2, t = n+k. Here, k=2.

Examples

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

Crossrefs

Cf. A128918 (Column 1) n>0, this sequence (Column 2).
Column 2 of the table in A056011.
Row 2 of the rectangular array in A056023.

Programs

  • Magma
    [(1 + (n+1)^2 + (n-2)*(-1)^n)/2: n in [1..80]];
    
  • Mathematica
    CoefficientList[Series[-(2*x^3 - 3*x^2 + 2*x + 3)/((x + 1)^2*(x - 1)^3), {x, 0, 50}], x]
    k := 2; Table[(1 + (n + k - 1)^2 + (n - k) (-1)^(n + k))/2, {n, 60}]
  • Python
    def A374084(n): return (n*(n+1)+4 if n&1 else n*(n+3))>>1 # Chai Wah Wu, Jul 07 2024

Formula

a(n) = a(n-1) + 2*a(n-2) - 2*a(n-3) - a(n-4) + a(n-5).
G.f.: -x*(2*x^3-3*x^2+2*x+3)/((x+1)^2*(x-1)^3).
a(n) = A128918(n+1) - (-1)^n.
E.g.f.: (2 + x)*(exp(x)*x + 2*sinh(x))/2. - Stefano Spezia, Jun 29 2024

A385406 Triangle read by rows: T(n, k) = n*(n+1)/2 - floor((n-1)/2) - (-1)^k * floor(k/2).

Original entry on oeis.org

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

Views

Author

Werner Schulte, Jun 27 2025

Keywords

Comments

This triangle seen as a sequence yields a permutation of the natural numbers (A000027).

Examples

			Triangle T(n, k) for 1 <= k <= n starts:
n \k :   1   2   3   4   5   6   7   8   9  10  11  12  13
==========================================================
   1 :   1
   2 :   3   2
   3 :   5   4   6
   4 :   9   8  10   7
   5 :  13  12  14  11  15
   6 :  19  18  20  17  21  16
   7 :  25  24  26  23  27  22  28
   8 :  33  32  34  31  35  30  36  29
   9 :  41  40  42  39  43  38  44  37  45
  10 :  51  50  52  49  53  48  54  47  55  46
  11 :  61  60  62  59  63  58  64  57  65  56  66
  12 :  73  72  74  71  75  70  76  69  77  68  78  67
  13 :  85  84  86  83  87  82  88  81  89  80  90  79  91
  etc.
		

Crossrefs

Cf. A080827 (column 1), A128918 (main diagonal), A006003 (row sums), A213399.

Programs

  • Mathematica
    T[n_, k_] := n*(n+1)/2 - Floor[(n-1)/2] - (-1)^k*Floor[k/2]; Table[T[n, k], {n, 1, 12}, {k, 1, n}] // Flatten (* Amiram Eldar, Jun 28 2025 *)
  • PARI
    T(n, k) = n*(n+1)/2 - floor((n-1)/2) - (-1)^k * floor(k/2)

Formula

T(n, k) = T(n, k-1) - (-1)^k * (k-1) for 1 < k <= n with initial values T(n, 1) = n*(n+1)/2 - floor((n-1)/2) for n >= 1.
T(n, n) = n*(n+1)/2 + (1-n) * (1 - n mod 2) = A128918(n).
T(2*n-1, n) = 2*n^2 - 2*n + 1 - (-1)^n * floor(n/2) = A213399(n-1).
Showing 1-7 of 7 results.