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.

Previous Showing 11-20 of 38 results. Next

A100035 a(n+1) occurs not earlier as a neighbor of terms = a(n): either it is the greatest number < a(n) or, if no such number exists, the smallest number > a(n); a(1) = 1.

Original entry on oeis.org

1, 2, 3, 1, 4, 3, 5, 4, 2, 5, 1, 6, 5, 7, 6, 4, 7, 3, 6, 2, 7, 1, 8, 7, 9, 8, 6, 9, 5, 8, 4, 9, 3, 8, 2, 9, 1, 10, 9, 11, 10, 8, 11, 7, 10, 6, 11, 5, 10, 4, 11, 3, 10, 2, 11, 1, 12, 11, 13, 12, 10, 13, 9, 12, 8, 13, 7, 12, 6, 13, 5, 12, 4, 13, 3, 12, 2, 13, 1, 14, 13, 15, 14, 12, 15, 11, 14, 10
Offset: 1

Views

Author

Reinhard Zumkeller, Oct 31 2004

Keywords

Comments

The natural numbers (A000027) occur infinitely many times as disjoint subsequences, see the example below and A100036, A100037, A100038 and A100039: exactly one k exists for all x < y such that a(k) = x and (a(k-1) = y or a(k+1) = y).
a(2*k^2 + k + 1) = a(A084849(k)) = 1 for k >= 0;
a(2*k^2 - 3*k) = a(A014107(k)) = 2 for k > 1;
a(2*k^2 + 5*k) = a(A033537(k)) = 3 for k > 1;
a(2*k^2 + k - 5) = a(A100040(k)) = 4 for k > 2;
a(2*k^2 + k - 7) = a(A100041(k)) = 5 for k > 3.

Examples

			First terms (10 = A, 11 = B, 12 = C) and some subsequences = A000027:
1231435425165764736271879869584938291A9BA8B7A6B5A4B3A2B1CBD
123.4.5....6.7........8.9............A.B................C.D.
...1....2........3............4................5..........
..........1........2............3................4......
.....................1............2................3....
		

Crossrefs

A059255 Both sum of n+1 consecutive squares and sum of the immediately following n consecutive squares.

Original entry on oeis.org

0, 25, 365, 2030, 7230, 19855, 45955, 94220, 176460, 308085, 508585, 802010, 1217450, 1789515, 2558815, 3572440, 4884440, 6556305, 8657445, 11265670, 14467670, 18359495, 23047035, 28646500, 35284900, 43100525, 52243425, 62875890, 75172930, 89322755, 105527255, 124002480
Offset: 0

Views

Author

Henry Bottomley, Jan 23 2001

Keywords

Comments

The analog for sums of integers is A059270, and the analog for sums of triangular numbers is A222716. - Jonathan Sondow, Mar 07 2013
In 1879, Dostor gave formulas for all solutions -- see the Dickson link. - Jonathan Sondow, Jun 21 2014

Examples

			a(3) = 2030 = 21^2 + 22^2 + 23^2 + 24^2 = 25^2 + 26^2 + 27^2.
		

References

  • Albert H. Beiler, Recreations in the theory of numbers, New York, Dover, (2nd ed.) 1966. See Table 68 at p. 152.

Crossrefs

The n+1 consecutive squares start with the square of A014105, while the n consecutive squares start with the square of A001844.
Cf. also A059270, A222716.
Cf. A234319 for nonexistence of analogs for sums of n-th powers, n > 2. - Jonathan Sondow, Apr 23 2014

Programs

  • Magma
    [n*(n+1)*(2*n+1)*(12*n^2+12*n+1)/6 : n in [0..50]]; // Wesley Ivan Hurt, Jun 21 2014
    
  • Maple
    A059255:=n->n*(n+1)*(2*n+1)*(12*n^2+12*n+1)/6; seq(A059255(n), n=0..50); # Wesley Ivan Hurt, Jun 21 2014
  • Mathematica
    Table[1/6(-1+n)(-n+14n^2-36n^3+24n^4),{n,40}] (* or *) LinearRecurrence[ {6,-15,20,-15,6,-1},{0,25,365,2030,7230,19855},40] (* Harvey P. Dale, May 09 2011 *)
  • PARI
    a(n)=n*(n+1)*(2*n+1)*(12*n^2+12*n+1)/6 \\ Charles R Greathouse IV, Jul 27 2021

Formula

a(n) = n*(n + 1)*(2n + 1)*(12n^2 + 12n + 1)/6.
a(n) = 4*n^5 + 10*n^4 + (25/3)*n^3 + (5/2)*n^2 + (1/6)*n. [Corrected by Ignacio Larrosa Cañestro, Nov 15 2021]
a(n) = A000330(A046092(n)) - A000330(A014107(n + 1)).
a(n) = A000330(A014106(n)) - A000330(A046092(n)).
From Harvey P. Dale, May 09 2011: (Start)
G.f.: (5x(1+x)(5+x(38+5x)))/(x-1)^6.
a(0)=0, a(1)=25, a(2)=365, a(3)=2030, a(4)=7230, a(5)=19855, a(n) = 6a(n-1)-15a(n-2)+20a(n-3)-15a(n-4)+6a(n-5)-a(n-6). (End)
a(n) = (4*T(n)-n)^2+(4*T(n)-n+1)^2+...+(4*T(n))^2 = (4*T(n)+1)^2+(4*T(n)+2)^2+...+(4*T(n)+n)^2, where T = A000217. See Boardman (2000). - Jonathan Sondow, Mar 07 2013
a(0)=0, a(n) = 25 + 340*C(n-1,1) + 1325*C(n-1,2) + 2210*C(n-1,3) + 1680*C(n-1,4) + 480*C(n-1,5) for n >= 1, where C(a,b) are binomial coefficients. - Kieren MacMillan, Sep 16 2014
E.g.f.: exp(x)*x*(150 + 945*x + 1010*x^2 + 300*x^3 + 24*x^4)/6. - Stefano Spezia, Aug 05 2024

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

Original entry on oeis.org

1, 2, 6, 9, 15, 20, 28, 35, 45, 54, 66, 77, 91, 104, 120, 135, 153, 170, 190, 209, 231, 252, 276, 299, 325, 350, 378, 405, 435, 464, 496, 527, 561, 594, 630, 665, 703, 740, 780, 819, 861, 902, 946, 989, 1035, 1080, 1128, 1175, 1225, 1274, 1326, 1377, 1431, 1484
Offset: 0

Views

Author

Paul Barry, May 31 2003

Keywords

Comments

Previous name was: Modified triangular numbers.
Binomial transform is A084266.
Partial sums give A064843. - N. J. A. Sloane, Jul 20 2008
Starting with "1" = triangle A171608 * the odd integers, (1, 3, 5, ...). - Gary W. Adamson, Dec 12 2009

Crossrefs

Programs

  • Magma
    [(n^2+3*n+1)/2+(-1)^n/2: n in [0..60]]; // Vincenzo Librandi, Aug 15 2013
    
  • Maple
    A084265:=n->(n^2+3*n+1)/2+(-1)^n/2: seq(A084265(n),n=0..100); # Wesley Ivan Hurt, Mar 21 2015
  • Mathematica
    CoefficientList[Series[(-1 - 2 x^2 + x^3) / ((1 + x) (x - 1)^3), {x, 0, 60}], x] (* Vincenzo Librandi, Aug 15 2013 *)
  • PARI
    vector(100,n,(n^2+n-1-(-1)^n)/2) \\ Derek Orr, Mar 22 2015

Formula

a(n) = A000217(n)+A059841(n)+n.
E.g.f.: cosh(x) + exp(x)*(2x+x^2/2).
a(n) = (n^2+3*n+1)/2+(-1)^n/2.
G.f.: ( -1-2*x^2+x^3 ) / ( (1+x)*(x-1)^3 ). - R. J. Mathar, Nov 26 2012
From Wesley Ivan Hurt, Mar 21 2015: (Start)
a(n) = 2*a(n-1)-2*a(n-3)+a(n-4).
a(n) = Sum_{i=0..n+1} i-(-1)^i. (End)
a(2*n) = A000384(n+1); a(2*n-1) = A014105(n)-1; a(2*n-1) = A014107(n+1), for all integers n. - Hartmut F. W. Hoft, Feb 02 2022

Extensions

New name from Joerg Arndt, Aug 15 2013

A100036 a(n) = smallest m such that A100035(m) = n.

Original entry on oeis.org

1, 2, 3, 5, 7, 12, 14, 23, 25, 38, 40, 57, 59, 80, 82, 107, 109, 138, 140, 173, 175, 212, 214, 255, 257, 302, 304, 353, 355, 408, 410, 467, 469, 530, 532, 597, 599, 668, 670, 743, 745, 822, 824, 905, 907, 992, 994, 1083, 1085, 1178, 1180, 1277, 1279, 1380
Offset: 1

Views

Author

Reinhard Zumkeller, Oct 31 2004

Keywords

Comments

Smallest positions of occurrences of the natural numbers as subsequence in A100035;
A100035(a(n)) = n and A100035(m) <> n for m < a(n);
a(n) < A100037(n) < A100038(n) < A100039(n).

Examples

			First terms (10=A,11=B,12=C) of A100035(a(n)):
123.4.5....6.7........8.9............A.B................C.
1231435425165764736271879869584938291A9BA8B7A6B5A4B3A2B1CBD;
a(1) = A084849(1) = 1, A100035(1) = 1;
a(2) = A014107(1) = 2, A100035(2) = 2;
a(3) = A033537(1) = 3, A100035(3) = 3;
a(4) = A100040(1) = 5, A100035(5) = 4;
a(5) = A100041(1) = 7, A100035(7) = 5.
		

Formula

Conjecture: a(n) = partial sums of sequence [1,1,1,2,2,5,2,9,2,13,2,17,2,21,2,25,2,29,2,33,...2,n/2-7,2,...]. In other words, a(n) consists of the numbers 1,2,3 and the sequences A096376 and A096376+2 interspersed. - Ralf Stephan, May 15 2007

A100345 Triangle read by rows: T(n,k) = n*(n+k), 0 <= k <= n.

Original entry on oeis.org

0, 1, 2, 4, 6, 8, 9, 12, 15, 18, 16, 20, 24, 28, 32, 25, 30, 35, 40, 45, 50, 36, 42, 48, 54, 60, 66, 72, 49, 56, 63, 70, 77, 84, 91, 98, 64, 72, 80, 88, 96, 104, 112, 120, 128, 81, 90, 99, 108, 117, 126, 135, 144, 153, 162, 100, 110, 120, 130, 140, 150, 160, 170, 180, 190
Offset: 0

Views

Author

Reinhard Zumkeller, Nov 18 2004

Keywords

Comments

Distinct members (except 0) are in A071562. Numbers occurring at least twice are in A175040. - Franklin T. Adams-Watters, Apr 04 2010

Examples

			Triangle begins:
   0
   1   2
   4   6   8
   9  12  15  18
  16  20  24  28  32
  25  30  35  40  45  50
  36  42  48  54  60  66  72
  49  56  63  70  77  84  91  98
  64  72  80  88  96 104 112 120 128
		

Crossrefs

Programs

  • Mathematica
    Table[n(n+k),{n,0,10},{k,0,n}]//Flatten (* Harvey P. Dale, Aug 16 2018 *)
  • PARI
    row(n) = vector(n+1, k, n*(n+k-1)); \\ Amiram Eldar, May 09 2025

Formula

T(n,0) = A000290(n).
T(n,1) = A002378(n) for n > 0.
T(n,2) = A005563(n) for n > 1.
T(n,3) = A028552(n) for n > 2.
T(n,4) = A028347(n+2) for n > 3.
T(n,5) = A028557(n) for n > 4.
T(n,6) = A028560(n) for n > 5.
T(n,7) = A028563(n) for n > 6.
T(n,8) = A028566(n) for n > 7.
T(n,9) = A028569(n) for n > 8.
T(n,10) = A098603(n) for n > 9.
T(n,n-5) = A071355(n-4) for n > 4.
T(n,n-4) = A054000(n-1) for n > 3.
T(n,n-3) = A014107(n) for n > 2.
T(n,n-2) = A046092(n-1) for n > 1.
T(n,n-1) = A000384(n) for n > 0.
T(n,n) = A001105(n).
Row sums give A085789 for n > 0.
G.f.: x*(1 + 2*y + 6*x^3*y^2 - 3*x^2*y*(1 + 2*y) + x*(1 - 3*y + 2*y^2))/((1 - x)^3*(1 - x*y)^3). - Stefano Spezia, Jul 03 2025

A097070 Consider all compositions (ordered partitions) of n into n parts, allowing zeros. E.g., for n = 3 we get 300, 030, 003, 210, 120, 201, 102, 021, 012, 111. Then a(n) is the total number of 1's.

Original entry on oeis.org

1, 2, 9, 40, 175, 756, 3234, 13728, 57915, 243100, 1016158, 4232592, 17577014, 72804200, 300874500, 1240940160, 5109183315, 21002455980, 86213785350, 353452638000, 1447388552610, 5920836618840, 24197138082780, 98801168731200, 403095046038750, 1643337883690776, 6694900194799404
Offset: 1

Views

Author

Amy J. Kolan, Sep 15 2004

Keywords

Comments

Number of compositions of n into n parts, allowing zeros = binomial(2*n-1,n) = A088218 = essentially A001700.

Examples

			The compositions for n=2 are 20, 02, 11. There are two 1's in these so a(2) = 2.
From _Robert G. Wilson v_, Sep 16 2004: (Start)
The case n = 5:
A. There are 5 combinations associated with the numbers 50000: 50000, 05000, 00500, 00050, 00005.
B. There are 20 combinations associated with the numbers 41000.
C. There are 20 combinations associated with 32000.
D. There are 30 combinations associated with 31100.
E. There are 30 combinations associated with 22100.
F. There are 20 combinations associated with 21110.
G. There is one combinations associated with 11111.
The number of 1's associated with A is 0, with B 20, with C 0, with D 60, with E 30, with F 60 and with G 5. 0 + 20 + 0 + 60 + 30 + 60 + 5 = 175.
(End)
		

Crossrefs

Programs

  • GAP
    List([1..30], n-> n*Binomial(2*n-3, n-1)); # G. C. Greubel, Jul 27 2019
  • Magma
    [n*Binomial(2*n-3, n-1): n in [1..30]]; // Vincenzo Librandi, Jul 13 2019
    
  • Maple
    A097070 := n -> ifelse(n=1, 1, 2^(n-2)*JacobiP(n-1, -1/2, -n+2, 3)):
    seq(simplify(A097070(n)), n = 1..28);  # Peter Luschny, Jan 22 2025
  • Mathematica
    Table[n*Binomial[2n-3, n-1], {n, 30}] (* Robert G. Wilson v, Sep 17 2004 *)
  • PARI
    a(n) = n*binomial(2*n-3, n-1); \\ Joerg Arndt, Feb 17 2015
    
  • Sage
    [n*binomial(2*n-3, n-1) for n in (1..30)] # G. C. Greubel, Jul 27 2019
    

Formula

a(n) = n*binomial(2*n-3, n-1).
More generally, total number of k's (k>=0) in all ordered partitions of n into n parts, allowing zeros, is n*binomial(2*n-k-2, n-2) if n >= k, 0 otherwise.
Total number of 0's is given by A005430.
From Vladeta Jovovic, Sep 17 2004: (Start)
a(n) = Sum_{k=0..n} k*binomial(n, k)*binomial(n-2, k-2).
G.f.: x*(1 -2*x +(1-4*x)^(3/2))/(2*(1-4*x)^(3/2)).
E.g.f.: (x/2)*(exp(2*x)*BesselI(0, 2*x)+1). (End)
a(n) = A014107(n)*A000108(n-2). - Philippe Deléham, Apr 12 2007
a(n) = n*A088218(n-1) for n > 0. - Werner Schulte, Jan 22 2017
From Bruce J. Nicholson, Jul 11 2019: (Start)
a(n) = A002740(n) + A097613(n).
a(n) = A110609(n-1) - A002457(n-2) + A097613(n).
a(n) = A005430(n-1) - A000917(n-3) for n > 1.
a(n) = A002457(n-1) - A037965(n) - A000917(n-3) for n > 1.
a(n) = A037965(n)/2.
a(n) = A001700(n-2)*n.
a(n) = A001791(n-2)*n + A000984(n-2)*n for n > 1. (End)
From Amiram Eldar, May 16 2022: (Start)
Sum_{n>=1} 1/a(n) = 4*Pi/(3*sqrt(3)) - Pi^2/9.
Sum_{n>=1} (-1)^(n+1)/a(n) = 8*log(phi)/sqrt(5) - 4*log(phi)^2, where phi is the golden ratio (A001622). (End)
a(n) = 2^(n-2)*JacobiP(n-1, -1/2, -n+2, 3) for n > 1. - Peter Luschny, Jan 22 2025

Extensions

Formula, more terms and comments from Vladeta Jovovic, Sep 15 2004

A317303 Numbers k such that both Dyck paths of the symmetric representation of sigma(k) have a central peak.

Original entry on oeis.org

2, 7, 8, 9, 16, 17, 18, 19, 20, 29, 30, 31, 32, 33, 34, 35, 46, 47, 48, 49, 50, 51, 52, 53, 54, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 154, 155, 156, 157, 158, 159, 160
Offset: 1

Views

Author

Omar E. Pol, Aug 27 2018

Keywords

Comments

Also triangle read by rows which gives the odd-indexed rows of triangle A014132.
There are no triangular number (A000217) in this sequence.
For more information about the symmetric representation of sigma see A237593 and its related sequences.
Equivalently, numbers k with the property that both Dyck paths of the symmetric representation of sigma(k) have an odd number of peaks. - Omar E. Pol, Sep 13 2018

Examples

			Written as an irregular triangle in which the row lengths are the odd numbers, the sequence begins:
    2;
    7,   8,   9;
   16,  17,  18,  19,  20;
   29,  30,  31,  32,  33,  34,  35;
   46,  47,  48,  49,  50,  51,  52,  53,  54;
   67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77;
   92,  93,  94,  95,  96,  97,  98,  99, 100, 101, 102, 103, 104;
  121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135;
...
Illustration of initial terms:
-----------------------------------------------------------
   k   sigma(k)   Diagram of the symmetry of sigma
-----------------------------------------------------------
                    _         _ _ _             _ _ _ _ _
                  _| |       | | | |           | | | | | |
   2      3      |_ _|       | | | |           | | | | | |
                             | | | |           | | | | | |
                            _|_| | |           | | | | | |
                          _|  _ _|_|           | | | | | |
                  _ _ _ _|  _| |               | | | | | |
   7      8      |_ _ _ _| |_ _|               | | | | | |
   8     15      |_ _ _ _ _|              _ _ _| | | | | |
   9     13      |_ _ _ _ _|             |  _ _ _|_| | | |
                                        _| |    _ _ _|_| |
                                      _|  _|   |  _ _ _ _|
                                  _ _|  _|  _ _| |
                                 |  _ _|  _|    _|
                                 | |     |     |
                  _ _ _ _ _ _ _ _| |  _ _|  _ _|
  16     31      |_ _ _ _ _ _ _ _ _| |  _ _|
  17     18      |_ _ _ _ _ _ _ _ _| | |
  18     39      |_ _ _ _ _ _ _ _ _ _| |
  19     20      |_ _ _ _ _ _ _ _ _ _| |
  20     42      |_ _ _ _ _ _ _ _ _ _ _|
.
For the first nine terms of the sequence we can see in the above diagram that both Dyck path (the smallest and the largest) of the symmetric representation of sigma(k) have a central peak.
Compare with A317304.
		

Crossrefs

Column 1 gives A130883, n >= 1.
Column 2 gives A033816, n >= 1.
Row sums give the odd-indexed terms of A006002.
Right border gives the positive terms of A014107, also the odd-indexed terms of A000096.
The union of A000217, A317304 and this sequence gives A001477.
Some other sequences related to the central peak or the central valley of the symmetric representation of sigma are A000217, A000384, A007606, A007607, A014105, A014132, A162917, A161983, A317304. See also A317306.

A162917 Numbers n which are not in A161983.

Original entry on oeis.org

1, 2, 6, 7, 8, 9, 15, 16, 17, 18, 19, 20, 28, 29, 30, 31, 32, 33, 34, 35, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 120, 121, 122, 123, 124, 125, 126, 127, 128
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Jul 17 2009

Keywords

Comments

They have a block structure: A000384(n) is followed by the next n integers.
Numbers k with the property that the largest Dyck path of the symmetric representation of sigma(k) has a central peak. (Cf. A237593.) - Omar E. Pol, Aug 28 2018
Union of nonzero terms of A000384 and A317303. - Omar E. Pol, Aug 29 2018

Examples

			From _Omar E. Pol_, Aug 28 2018: (Start)
Also, written as an irregular triangle in which the row lengths are the positive even numbers, the sequence begins:
   1,  2;
   6,  7,  8,  9;
  15, 16, 17, 18, 19, 20;
  28, 29, 30, 31, 32, 33, 34, 35;
  45, 46, 47, 48, 49, 50, 51, 52, 53,  54;
  66, 67, 68, 69, 70, 71, 72, 73, 74,  75,  76,  77;
  91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104;
...
Row sums give A035328, n >= 1.
Column 1 gives A000384, n >= 1.
Column 2 gives A130883, n >= 1.
Right border gives the positive terms of A014107, also the odd-indexed terms of A000096.
(End)
		

Crossrefs

Formula

Extensions

119 removed by R. J. Mathar, Jul 19 2009

A185869 (Odd,even)-polka dot array in the natural number array A000027; read by antidiagonals.

Original entry on oeis.org

2, 7, 9, 16, 18, 20, 29, 31, 33, 35, 46, 48, 50, 52, 54, 67, 69, 71, 73, 75, 77, 92, 94, 96, 98, 100, 102, 104, 121, 123, 125, 127, 129, 131, 133, 135, 154, 156, 158, 160, 162, 164, 166, 168, 170, 191, 193, 195, 197, 199, 201, 203, 205, 207, 209, 232, 234, 236, 238, 240, 242, 244, 246, 248, 250, 252, 277, 279, 281, 283, 285, 287, 289, 291, 293, 295, 297, 299, 326, 328, 330, 332, 334, 336, 338, 340, 342, 344, 346, 348, 350, 379, 381, 383, 385, 387, 389, 391, 393, 395, 397, 399, 401, 403, 405
Offset: 1

Views

Author

Clark Kimberling, Feb 05 2011

Keywords

Comments

This is the second of four polka dot arrays; see A185868.
row 1: A130883;
row 2: A100037;
row 3: A100038;
row 4: A100039;
col 1: A014107;
col 2: A033537;
col 3: A100040;
col 4: A100041;
diag (2,18,...): A077591;
diag (7,31,...): A157914;
diag (16,48,...): A035008;
diag (29,69,...): A108928;
antidiagonal sums: A033431;
antidiagonal sums: 2*(1^3, 2^3, 3^3, 4^3,...) = 2*A000578.
A060432(n) + n is odd if and only if n is in this sequence. - Peter Kagey, Feb 03 2016

Examples

			Northwest corner:
  2....7....16...29...46
  9....18...31...48...69
  20...33...50...71...96
  35...52...73...98...127
		

Crossrefs

Cf. A000027 (as an array), A060432, A185868, A185870, A185871.

Programs

  • Haskell
    a185869 n = a185869_list !! (n - 1)
    a185869_list = scanl (+) 2 $ a' 1
      where  a' n = 2 * n + 3 : replicate n 2 ++ a' (n + 1)
    -- Peter Kagey, Sep 02 2016
    
  • Mathematica
    f[n_,k_]:=2n-1+(2n+2k-3)(n+k-1);
    TableForm[Table[f[n,k],{n,1,10},{k,1,15}]]
    Table[f[n-k+1,k],{n,14},{k,n,1,-1}]//Flatten
  • Python
    from math import isqrt, comb
    def A185869(n):
        a = (m:=isqrt(k:=n<<1))+(k>m*(m+1))
        x = n-comb(a,2)
        y = a-x+1
        return y*((y+(c:=x<<1)<<1)-5)+x*(c-3)+2 # Chai Wah Wu, Jun 18 2025

Formula

T(n,k) = 2n-1+(n+k-1)*(2n+2k-3), k>=1, n>=1.

A211394 T(n,k) = (k+n)*(k+n-1)/2-(k+n-1)*(-1)^(k+n)-k+2; n , k > 0, read by antidiagonals.

Original entry on oeis.org

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

Views

Author

Boris Putievskiy, Feb 08 2013

Keywords

Comments

Permutation of the natural numbers.
a(n) is a pairing function: a function that reversibly maps Z^{+} x Z^{+} onto Z^{+}, where Z^{+} is the set of integer positive numbers.
Enumeration table T(n,k). The order of the list:
T(1,1)=1;
T(1,3), T(2,2), T(3,1);
T(1,2), T(2,1);
. . .
T(1,n), T(2,n-1), T(3,n-2), ... T(n,1);
T(1,n-1), T(2,n-3), T(3,n-4),...T(n-1,1);
. . .
First row matches with the elements antidiagonal {T(1,n), ... T(n,1)},
second row matches with the elements antidiagonal {T(1,n-1), ... T(n-1,1)}.
Table contains:
row 1 is alternation of elements A130883 and A096376,
row 2 accommodates elements A033816 in even places,
row 3 accommodates elements A100037 in odd places,
row 5 accommodates elements A100038 in odd places;
column 1 is alternation of elements A084849 and A000384,
column 2 is alternation of elements A014106 and A014105,
column 3 is alternation of elements A014107 and A091823,
column 4 is alternation of elements A071355 and |A168244|,
column 5 accommodates elements A033537 in even places,
column 7 is alternation of elements A100040 and A130861,
column 9 accommodates elements A100041 in even places;
the main diagonal is A058331,
diagonal 1, located above the main diagonal is A001844,
diagonal 2, located above the main diagonal is A001105,
diagonal 3, located above the main diagonal is A046092,
diagonal 4, located above the main diagonal is A056220,
diagonal 5, located above the main diagonal is A142463,
diagonal 6, located above the main diagonal is A054000,
diagonal 7, located above the main diagonal is A090288,
diagonal 9, located above the main diagonal is A059993,
diagonal 10, located above the main diagonal is |A147973|,
diagonal 11, located above the main diagonal is A139570;
diagonal 1, located under the main diagonal is A051890,
diagonal 2, located under the main diagonal is A005893,
diagonal 3, located under the main diagonal is A097080,
diagonal 4, located under the main diagonal is A093328,
diagonal 5, located under the main diagonal is A137882.

Examples

			The start of the sequence as table:
  1....5...2..12...7..23..16...
  6....3..13...8..24..17..39...
  4...14...9..25..18..40..31...
  15..10..26..19..41..32..60...
  11..27..20..42..33..61..50...
  28..21..43..34..62..51..85...
  22..44..35..63..52..86..73...
  . . .
The start of the sequence as triangle array read by rows:
  1;
  5,6;
  2,3,4;
  12,13,14,15;
  7,8,9,10,11;
  23,24,25,26,27,28;
  16,17,18,19,20,21,22;
  . . .
Row number r matches with r numbers segment {(r+1)*r/2-r*(-1)^(r+1)-r+2,... (r+1)*r/2-r*(-1)^(r+1)+1}.
		

Crossrefs

Programs

  • Mathematica
    T[n_, k_] := (n+k)(n+k-1)/2 - (-1)^(n+k)(n+k-1) - k + 2;
    Table[T[n-k+1, k], {n, 1, 12}, {k, n, 1, -1}] // Flatten (* Jean-François Alcover, Dec 06 2018 *)
  • Python
    t=int((math.sqrt(8*n-7) - 1)/ 2)
    j=(t*t+3*t+4)/2-n
    result=(t+2)*(t+1)/2-(t+1)*(-1)**t-j+2

Formula

T(n,k) = (k+n)*(k+n-1)/2-(k+n-1)*(-1)^(k+n)-k+2.
As linear sequence
a(n) = A003057(n)*A002024(n)/2- A002024(n)*(-1)^A003056(n)-A004736(n)+2.
a(n) = (t+2)*(t+1)/2 - (t+1)*(-1)^t-j+2, where j=(t*t+3*t+4)/2-n and t=int((math.sqrt(8*n-7) - 1)/ 2).
Previous Showing 11-20 of 38 results. Next