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

A014105 Second hexagonal numbers: a(n) = n*(2*n + 1).

Original entry on oeis.org

0, 3, 10, 21, 36, 55, 78, 105, 136, 171, 210, 253, 300, 351, 406, 465, 528, 595, 666, 741, 820, 903, 990, 1081, 1176, 1275, 1378, 1485, 1596, 1711, 1830, 1953, 2080, 2211, 2346, 2485, 2628, 2775, 2926, 3081, 3240, 3403, 3570, 3741, 3916, 4095, 4278
Offset: 0

Views

Author

N. J. A. Sloane, Jun 14 1998

Keywords

Comments

Note that when starting from a(n)^2, equality holds between series of first n+1 and next n consecutive squares: a(n)^2 + (a(n) + 1)^2 + ... + (a(n) + n)^2 = (a(n) + n + 1)^2 + (a(n) + n + 2)^2 + ... + (a(n) + 2*n)^2; e.g., 10^2 + 11^2 + 12^2 = 13^2 + 14^2. - Henry Bottomley, Jan 22 2001; with typos fixed by Zak Seidov, Sep 10 2015
a(n) = sum of second set of n consecutive even numbers - sum of the first set of n consecutive odd numbers: a(1) = 4-1, a(3) = (8+10+12) - (1+3+5) = 21. - Amarnath Murthy, Nov 07 2002
Partial sums of odd numbers 3 mod 4, that is, 3, 3+7, 3+7+11, ... See A001107. - Jon Perry, Dec 18 2004
If Y is a fixed 3-subset of a (2n+1)-set X then a(n) is the number of (2n-1)-subsets of X intersecting Y. - Milan Janjic, Oct 28 2007
More generally (see the first comment), for n > 0, let b(n,k) = a(n) + k*(4*n + 1). Then b(n,k)^2 + (b(n,k) + 1)^2 + ... + (b(n,k) + n)^2 = (b(n,k) + n + 1 + 2*k)^2 + ... + (b(n,k) + 2*n + 2*k)^2 + k^2; e.g., if n = 3 and k = 2, then b(n,k) = 47 and 47^2 + ... + 50^2 = 55^2 + ... + 57^2 + 2^2. - Charlie Marion, Jan 01 2011
Sequence found by reading the line from 0, in the direction 0, 10, ..., and the line from 3, in the direction 3, 21, ..., in the square spiral whose vertices are the triangular numbers A000217. - Omar E. Pol, Nov 09 2011
a(n) is the number of positions of a domino in a pyramidal board with base 2n+1. - César Eliud Lozada, Sep 26 2012
Differences of row sums of two consecutive rows of triangle A120070, i.e., first differences of A016061. - J. M. Bergot, Jun 14 2013 [In other words, the partial sums of this sequence give A016061. - Leo Tavares, Nov 23 2021]
a(n)*Pi is the total length of half circle spiral after n rotations. See illustration in links. - Kival Ngaokrajang, Nov 05 2013
For corresponding sums in first comment by Henry Bottomley, see A059255. - Zak Seidov, Sep 10 2015
a(n) also gives the dimension of the simple Lie algebras B_n (n >= 2) and C_n (n >= 3). - Wolfdieter Lang, Oct 21 2015
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 unsigned A130757, analogous to A132440 for the Pascal matrix. - Tom Copeland, Dec 13 2015
Partial sums of squares with alternating signs, ending in an even term: a(n) = 0^2 - 1^2 +- ... + (2*n)^2, cf. Example & Formula from Berselli, 2013. - M. F. Hasler, Jul 03 2018
Also numbers k with the property that in the symmetric representation of sigma(k) the smallest Dyck path has a central peak and the largest Dyck path has a central valley, n > 0. (Cf. A237593.) - Omar E. Pol, Aug 28 2018
a(n) is the area of a triangle with vertices at (0,0), (2*n+1, 2*n), and ((2*n+1)^2, 4*n^2). - Art Baker, Dec 12 2018
This sequence is the largest subsequence of A000217 such that gcd(a(n), 2*n) = a(n) mod (2*n) = n, n > 0 up to a given value of n. It is the interleave of A033585 (a(n) is even) and A033567 (a(n) is odd). - Torlach Rush, Sep 09 2019
A generalization of Hasler's Comment (Jul 03 2018) follows. Let P(k,n) be the n-th k-gonal number. Then for k > 1, partial sums of {P(k,n)} with alternating signs, ending in an even term, = n*((k-2)*n + 1). - Charlie Marion, Mar 02 2021
Let U_n(H) = {A in M_n(H): A*A^H = I_n} be the group of n X n unitary matrices over the quaternions (A^H is the conjugate transpose of A. Note that over the quaternions we still have A*A^H = I_n <=> A^H*A = I_n by mapping A and A^H to (2n) X (2n) complex matrices), then a(n) is the dimension of its Lie algebra u_n(H) = {A in M_n(H): A + A^H = 0} as a real vector space. A basis is given by {(E_{st}-E_{ts}), i*(E_{st}+E_{ts}), j*(E_{st}+E_{ts}), k*(E_{st}+E_{ts}): 1 <= s < t <= n} U {i*E_{tt}, j*E_{tt}, k*E_{tt}: t = 1..n}, where E_{st} is the matrix with all entries zero except that its (st)-entry is 1. - Jianing Song, Apr 05 2021

Examples

			For n=6, a(6) = 0^2 - 1^2 + 2^2 - 3^2 + 4^2 - 5^2 + 6^2 - 7^2 + 8^2 - 9^2 + 10^2 - 11^2 + 12^2 = 78. - _Bruno Berselli_, Aug 29 2013
		

References

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

Crossrefs

Second column of array A094416.
Equals A033586(n) divided by 4.
See Comments of A132124.
Second n-gonal numbers: A005449, A147875, A045944, A179986, A033954, A062728, A135705.
Row sums in triangle A253580.

Programs

Formula

a(n) = 3*Sum_{k=1..n} tan^2(k*Pi/(2*(n + 1))). - Ignacio Larrosa Cañestro, Apr 17 2001
a(n)^2 = n*(a(n) + 1 + a(n) + 2 + ... + a(n) + 2*n); e.g., 10^2 = 2*(11 + 12 + 13 + 14). - Charlie Marion, Jun 15 2003
From N. J. A. Sloane, Sep 13 2003: (Start)
G.f.: x*(3 + x)/(1 - x)^3.
E.g.f.: exp(x)*(3*x + 2*x^2).
a(n) = A000217(2*n) = A000384(-n). (End)
a(n) = A084849(n) - 1; A100035(a(n) + 1) = 1. - Reinhard Zumkeller, Oct 31 2004
a(n) = A126890(n, k) + A126890(n, n-k), 0 <= k <= n. - Reinhard Zumkeller, Dec 30 2006
a(2*n) = A033585(n); a(3*n) = A144314(n). - Reinhard Zumkeller, Sep 17 2008
a(n) = a(n-1) + 4*n - 1 (with a(0) = 0). - Vincenzo Librandi, Dec 24 2010
a(n) = Sum_{k=0.2*n} (-1)^k*k^2. - Bruno Berselli, Aug 29 2013
a(n) = A242342(2*n + 1). - Reinhard Zumkeller, May 11 2014
a(n) = Sum_{k=0..2} C(n-2+k, n-2) * C(n+2-k, n), for n > 1. - J. M. Bergot, Jun 14 2014
a(n) = floor(Sum_{j=(n^2 + 1)..((n+1)^2 - 1)} sqrt(j)). Fractional portion of each sum converges to 1/6 as n -> infinity. See A247112 for a similar summation sequence on j^(3/2) and references to other such sequences. - Richard R. Forberg, Dec 02 2014
a(n) = 3*a(n-1) - 3*a(n-2) + a(n-3) for n >= 3, with a(0) = 0, a(1) = 3, and a(2) = 10. - Harvey P. Dale, Feb 10 2015
Sum_{n >= 1} 1/a(n) = 2*(1 - log(2)) = 0.61370563888010938... (A188859). - Vaclav Kotesovec, Apr 27 2016
From Wolfdieter Lang, Apr 27 2018: (Start)
a(n) = trinomial(2*n, 2) = trinomial(2*n, 2*(2*n-1)), for n >= 1, with the trinomial irregular triangle A027907; i.e., trinomial(n,k) = A027907(n,k).
a(n) = (1/Pi) * Integral_{x=0..2} (1/sqrt(4 - x^2)) * (x^2 - 1)^(2*n) * R(4*(n-1), x), for n >= 0, with the R polynomial coefficients given in A127672, and R(-m, x) = R(m, x). [See Comtet, p. 77, the integral formula for q = 3, n -> 2*n, k = 2, rewritten with x = 2*cos(phi).] (End)
a(n) = A002943(n)/2. - Ralf Steiner, Jul 23 2019
a(n) = A000290(n) + A002378(n). - Torlach Rush, Nov 02 2020
a(n) = A003215(n) - A000290(n+1). See Squared Hexagons illustration. Leo Tavares, Nov 23 2021
Sum_{n>=1} (-1)^(n+1)/a(n) = Pi/2 + log(2) - 2. - Amiram Eldar, Nov 28 2021

Extensions

Link added and minor errors corrected by Johannes W. Meijer, Feb 04 2010

A064038 Numerator of average number of swaps needed to bubble sort a string of n distinct letters.

Original entry on oeis.org

0, 1, 3, 3, 5, 15, 21, 14, 18, 45, 55, 33, 39, 91, 105, 60, 68, 153, 171, 95, 105, 231, 253, 138, 150, 325, 351, 189, 203, 435, 465, 248, 264, 561, 595, 315, 333, 703, 741, 390, 410, 861, 903, 473, 495, 1035, 1081, 564, 588, 1225, 1275, 663, 689, 1431, 1485, 770
Offset: 1

Views

Author

Antti Karttunen, Aug 23 2001

Keywords

Comments

Denominators are given by the simple periodic sequence [1, 2, 2, 1, 1, 2, 2, 1, 1, 2, 2, 1, 1, 2, 2, ...] (= A014695) thus we get an average of 1/2, 3/2, 3, 5, 15/2, 21/2, 14, 18, etc. swappings required to bubble sort a string of 2, 3, 4, 5, 6, ... letters.

References

  • E. Reingold, J. Nievergelt and N. Deo, Combinatorial Algorithms, Prentice-Hall, 1977, section 7.1, p. 287.

Crossrefs

Programs

  • Magma
    [Numerator(n*(n-1)/4): n in [1..100]]; // G. C. Greubel, Sep 21 2018
  • Maple
    [seq(numer((n*(n-1))/4), n=1..120)];
  • Mathematica
    f[n_] := Numerator[n (n - 1)/4]; Array[f, 56]
    f[n_] := n/GCD[n, 4]; Array[f[#] f[# - 1] &, 56]
    LinearRecurrence[{3,-6,10,-12,12,-10,6,-3,1},{0,1,3,3,5,15,21,14,18},80] (* Harvey P. Dale, Jan 23 2023 *)
  • PARI
    vector(100, n, numerator(n*(n-1)/4)) \\ G. C. Greubel, Sep 21 2018
    

Formula

a(n) = numerator(A001809(n)/(n!)).
a(4n) = A033991(n).
a(4n+1) = A007742(n).
a(4n+2) = A014634(n).
a(4n+3) = A033567(n+1).
a(n+1) = A061041(8*n-4). - Paul Curtz, Jan 03 2011
G.f.: -x^2*(1+4*x^3+x^6) / ( (x-1)^3*(1+x^2)^3 ). - R. J. Mathar, Jan 03 2011
a(n+1) = A060819(n)*A060819(n+1).
a(n+1) = A000217(n)/(period 4:repeat 2,1,1,2=A014695(n+2)=A130658(n+3)).
a(n) = 3*a(n-4) -3*a(n-8) +a(n-12). - Paul Curtz, Mar 04 2011
a(n) = +3*a(n-1) -6*a(n-2) +10*a(n-3) -12*a(n-4) +12*a(n-5) -10*a(n-6) +6*a(n-7) -3*a(n-8) +1*a(n-9). - Joerg Arndt, Mar 04 2011
a(n+1) = A026741(A000217(n)). - Paul Curtz, Apr 04 2011
a(n) = numerator(Sum_{k=0..n-1} k/2). - Arkadiusz Wesolowski, Aug 09 2012
a(n) = n*(n-1)*(3-i^(n*(n-1)))/8, where i=sqrt(-1). - Bruno Berselli, Oct 01 2012, corrected by Vaclav Kotesovec, Aug 09 2022
Sum_{n>=2} 1/a(n) = 4 - Pi/2. - Amiram Eldar, Aug 09 2022
E.g.f.: x^2*(3*exp(x) + cos(x) + sin(x))/8. - Stefano Spezia, Aug 23 2025

A047204 Numbers that are congruent to {3, 4} mod 5.

Original entry on oeis.org

3, 4, 8, 9, 13, 14, 18, 19, 23, 24, 28, 29, 33, 34, 38, 39, 43, 44, 48, 49, 53, 54, 58, 59, 63, 64, 68, 69, 73, 74, 78, 79, 83, 84, 88, 89, 93, 94, 98, 99, 103, 104, 108, 109, 113, 114, 118, 119, 123, 124, 128, 129, 133, 134, 138, 139, 143, 144, 148, 149
Offset: 1

Views

Author

Keywords

Comments

Also numbers that cannot be expressed as the sum of two 4th powers. - Cino Hilliard, Nov 23 2003
The sequence lists the indices of the multiples of 5 in A033567. - Bruno Berselli, Jan 05 2018

Crossrefs

Programs

Formula

a(n) = 5*n - a(n-1) - 3 for n>1, a(1)=3. - Vincenzo Librandi, Nov 18 2010
G.f.: x*(3 + x + x^2) / ((1 + x)*(x - 1)^2). - R. J. Mathar, Oct 08 2011
a(n) = floor(5*n/2) - (-1)^n. - Wesley Ivan Hurt, Sep 12 2017
Sum_{n>=1} (-1)^(n+1)/a(n) = sqrt(2-2/sqrt(5))*Pi/10 - sqrt(5)*log(phi)/5, where phi is the golden ratio (A001622). - Amiram Eldar, Dec 07 2021
E.g.f.: 1 + ((10*x - 1)*exp(x) - 3*exp(-x))/4. - David Lovler, Aug 23 2022

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

Original entry on oeis.org

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

Views

Author

Boris Putievskiy, Feb 07 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(1,2), T(2,1), T(2,2), T(3,1);
...
T(1,n), T(1,n-1), T(2,n-2), T(2,n-1), T(3,n-2), T(3,n-3)...T(n,1);
...
Descent by snake along two adjacent antidiagonal - step to the west, step to the southwest, step to the east, step to the southwest and so on. The length of each step is 1.
Table contains:
row 1 is alternation of elements A130883 and A033816,
row 2 accommodates elements A100037 in odd places;
column 1 is alternation of elements A000384 and A091823,
column 2 is alternation of elements A071355 and A014106,
column 3 accommodates elements A130861 in even places;
main diagonal accommodates elements A188135 in odd places,
diagonal 1, located above the main diagonal, is alternation of elements A033567 and A033566,
diagonal 2, located above the main diagonal, is alternation of elements A139271 and A033585.

Examples

			The start of the sequence as a table:
   1,  3,  2,   8,   7,  17,  16,  30,  29,  47,  46, ...
   4,  5,  9,  10,  18,  19,  31,  32,  48,  49,  69, ...
   6, 12, 11,  21,  20,  34,  33,  51,  50,  72,  71, ...
  13, 14, 22,  23,  35,  36,  52,  53,  73,  74,  98, ...
  15, 25, 24,  38,  37,  55,  54,  76,  75, 101, 100, ...
  26, 27, 39,  40,  56,  57,  77,  78, 102, 103, 131, ...
  28, 42, 41,  59,  58,  80,  79, 105, 104, 134, 133, ...
  43, 44, 60,  61,  81,  82, 106, 107, 135, 136, 168, ...
  45, 63, 62,  84,  83, 109, 108, 138, 137, 171, 170, ...
  64, 65, 85,  86, 110, 111, 139, 140, 172, 173, 209, ...
  66, 88, 87, 113, 112, 142, 141, 175, 174, 212, 211, ...
  ...
The start of the sequence as triangle array read by rows:
   1;
   3,  4;
   2,  5,  6;
   8,  9, 12, 13;
   7, 10, 11, 14, 15;
  17, 18, 21, 22, 25, 26;
  16, 19, 20, 23, 24, 27, 28;
  30, 31, 34, 35, 38, 39, 42, 43;
  29, 32, 33, 36, 37, 40, 41, 44, 45;
  47, 48, 51, 52, 55, 56, 59, 60, 63, 64;
  46, 49, 50, 53, 54, 57, 58, 61, 62, 65, 66;
  ...
The start of the sequence as an array read by rows, the length of row r is 4*r-3.
First 2*r-2 numbers are from row number 2*r-2 of the triangular array above.
Last  2*r-1 numbers are from row number 2*r-1 of the triangular array above.
   1;
   3,  4,  2,  5,  6;
   8,  9, 12, 13,  7, 10, 11, 14, 15;
  17, 18, 21, 22, 25, 26, 16, 19, 20, 23, 24, 27, 28;
  30, 31, 34, 35, 38, 39, 42, 43, 29, 32, 33, 36, 37, 40, 41, 44, 45;
  47, 48, 51, 52, 55, 56, 59, 60, 63, 64, 46, 49, 50, 53, 54, 57, 58, 61, 62, 65, 66;
  ...
Row number r contains permutation 4*r-3 numbers from 2*r*r-5*r+4 to 2*r*r-r:
2*r*r-5*r+5, 2*r*r-5*r+6,...2*r*r-r-4, 2*r*r-r-1, 2*r*r-r.
		

Crossrefs

Programs

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

Formula

As a table:
T(n,k) = ((k + n)^2 - 4*k + 3 + (-1)^k - (k + n - 2)*(-1)^(k + n))/2.
As a linear sequence:
a(n) = ((t + 2)^2 - 4*j + 3 + (-1)^j - t*(-1)^t)/2, where j = (t*t + 3*t + 4)/2 - n and t = int((sqrt(8*n - 7) - 1)/ 2).

A087348 a(n) = 10*n^2 - 6*n + 1.

Original entry on oeis.org

5, 29, 73, 137, 221, 325, 449, 593, 757, 941, 1145, 1369, 1613, 1877, 2161, 2465, 2789, 3133, 3497, 3881, 4285, 4709, 5153, 5617, 6101, 6605, 7129, 7673, 8237, 8821, 9425, 10049, 10693, 11357, 12041, 12745, 13469, 14213, 14977, 15761, 16565, 17389, 18233, 19097
Offset: 1

Views

Author

Charlie Marion, Oct 20 2003

Keywords

Comments

Sequence found by reading the line from 5, in the direction 5, 29, ..., in the square spiral whose vertices are the generalized heptagonal numbers A085787. - Omar E. Pol, Jul 18 2012

Examples

			a(3)=73 since 73^2 = 48^2 + 55^2 = (4*12)^2 + (48 + 7)^2. See 1st formula.
		

Crossrefs

Programs

Formula

a(n)^2 = A033579(n)^2 + A033567(n)^2 = (4*A000326(n))^2 + (A033579(n) + A056220(n-1))^2.
From Colin Barker, Jun 30 2012: (Start)
a(n) = 3*a(n-1) - 3*a(n-2) + a(n-3).
G.f.: x*(5 + 14*x + x^2)/(1-x)^3. (End)
a(n) = 1 + A153784(n). - Omar E. Pol, Jul 18 2012
E.g.f.: exp(x)*(10*x^2 + 4*x + 1) - 1. - Elmo R. Oliveira, Oct 31 2024

Extensions

More terms from Ray Chandler, Oct 22 2003

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

Original entry on oeis.org

1, 7, 29, 67, 121, 191, 277, 379, 497, 631, 781, 947, 1129, 1327, 1541, 1771, 2017, 2279, 2557, 2851, 3161, 3487, 3829, 4187, 4561, 4951, 5357, 5779, 6217, 6671, 7141, 7627, 8129, 8647, 9181, 9731, 10297, 10879, 11477, 12091, 12721, 13367, 14029, 14707, 15401, 16111, 16837, 17579
Offset: 0

Views

Author

Paul Curtz, Feb 03 2011

Keywords

Comments

Odd numbers (A005408) written clockwise as a square spiral:
.
41--43--45--47--49--51
| |
39 13--15--17--19 53
| | | |
37 11 1---3 21 55
| | | | |
35 9---7---5 23 57
| | |
33--31--29--27--25 59
|
71--69--67--65--63--61
.
Walking in straight lines away from the center:
1, 17, 49, ... = A069129(n+1) = 1 - 8*n + 8*n^2,
1, 3, 21, ... = A033567(n) = 1 - 6*n + 8*n^2,
1, 15, 45, ... = A014634(n) = 1 + 6*n + 8*n^2,
1, 5, 25, ... = A080856(n) = 1 - 4*n + 8*n^2,
1, 13, 41, ... = A102083(n) = 1 + 4*n + 8*n^2,
1, 7, 29, ... = a(n) = 1 - 2*n + 8*n^2,
1, 11, 37, ... = A188135(n) = 1 + 2*n + 8*n^2,
1, 9, 33, ... = A081585(n) = 1 + 8*n^2,
5, 29, 69, ... = A108928(n+1) = -3 + 8*n^2,
7, 31, 71, ... = A157914(n+1) = -1 + 8*n^2,
9, 35, 77, ... = A033566(n+1) = -1 + 2*n + 8*n^2.
All are quadrisections of sequences in A181407(n) (example: A014634(n) and A033567(n) in A064038(n+1)) or of this family (?): a(n) is a quadrisection of f(n) = 1,1,1,1,2,7,11,8,11,29,37,23,28,67,79,46,... f(n) is just before A064038(n+1) (fifth vertical) in A181407(n). The companion to a(n) is A188135(n), another quadrisection of f(n). Two last quadrisections of f(n) are A054552(n) and A033951(n).
For n >= 1, bisection of A193867. - Omar E. Pol, Aug 16 2011
Also the sequence may be obtained by starting with the segment (1, 7) followed by the line from 7 in the direction 7, 29, ... in the square spiral whose vertices are the generalized hexagonal numbers (A000217). - Omar E. Pol, Aug 01 2016

Crossrefs

Programs

Formula

a(n) = a(n-1) + 16*n - 10 (n > 0).
a(n) = 2*a(n-1) - a(n-2) + 16 (n > 1).
a(n) = 3*(n-1) - 3*a(n-2) + a(n-3) (n > 2).
G.f.: (-1 - 4*x - 11*x^2)/(x-1)^3. - R. J. Mathar, Feb 03 2011
a(n) = A014635(n) + 1. - Bruno Berselli, Apr 09 2011
E.g.f.: exp(x)*(1 + 6*x + 8*x^2). - Elmo R. Oliveira, Nov 17 2024

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

Original entry on oeis.org

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

Views

Author

Boris Putievskiy, Feb 14 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(1,2), T(2,1), T(3,1);
. . .
T(1,n), T(2,n-1), T(1,n-1), T(2,n-2), T(3,n-2), T(4,n-3)...T(n,1);
...
Descent by snake along two adjacent antidiagonals - step to the southwest, step to the north, step to the southwest, step to the south and so on. The length of each step is 1. Phase four steps is rotated 90 degrees counterclockwise and the mirror of the phase A211377.
Table contains the following:
row 1 is alternation of elements A130883 and A100037,
row 2 accommodates elements A033816 in even places;
column 1 is alternation of elements A000384 and A014106,
column 2 is alternation of elements A091823 and A071355,
column 4 accommodates elements A130861 in odd places;
main diagonal is alternation of elements A188135 and A033567,
diagonal 1, located above the main diagonal, accommodates elements A033585 in even places,
diagonal 2, located above the main diagonal, accommodates elements A139271 in odd places,
diagonal 3, located above the main diagonal, is alternation of elements A033566 and A194431.

Examples

			The start of the sequence as a table:
   1   4   2   9   7   8  16 ...
   5   3  10   8  19  17  32 ...
   6  13  11  22  20  35  33 ...
  14  12  23  21  36  34  53 ...
  15  26  24  39  37  56  54 ...
  27  25  40  38  57  55  78 ...
  28  43  41  60  58  81  79 ...
  ...
The start of the sequence as a triangle array read by rows:
   1
   4  5
   2  3  6
   9 10 13 14
   7  8 11 12 15
  18 19 22 23 26 27
  16 17 20 21 24 25 28
  ...
The start of the sequence as array read by rows, the length of row r is 4*r-3.
First 2*r-2 numbers are from the row number 2*r-2 of triangle array, located above.
Last 2*r-1 numbers are from the row number 2*r-1 of triangle array, located above.
   1
   4  5  2  3  6
   9 10 13 14  7  8 11 12 15
  18 19 22 23 26 27 16 17 20 21 24 25 28
  ...
Row number r contains permutation 4*r-3 numbers from 2*r*r-5*r+4 to 2*r*r-r:
2*r*r-5*r+6, 2*r*r-5*r+7, ..., 2*r*r-r-4, 2*r*r-r-3, 2*r*r-r.
		

Crossrefs

Programs

  • Maple
    T:=(n,k)->((k+n)^2-4*k+3-(-1)^n-(k+n)*(-1)^(k+n))/2: seq(seq(T(k,n-k),k=1..n-1),n=1..13); # Muniru A Asiru, Dec 06 2018
  • Mathematica
    T[n_, k_] := ((n+k)^2 - 4k + 3 - (-1)^n - (-1)^(n+k)(n+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)
    i=n-t*(t+1)/2
    j=(t*t+3*t+4)/2-n
    result=((t+2)**2-4*j+3-(-1)**i-(t+2)*(-1)**t)/2

Formula

As a table:
T(n,k) = ((k+n)^2-4*k+3-(-1)^n-(k+n)*(-1)^(k+n))/2.
As a linear sequence:
a(n) = (A003057(n)^2-4*A004736(n)+3-(-1)^A002260(n)-A003057(n)*(-1)^A003056(n))/2;
a(n) = ((t+2)^2-4*j+3-(-1)^i-(t+2)*(-1)^t)/2, where i=n-t*(t+1)/2, j=(t*t+3*t+4)/2-n, t=floor((-1+sqrt(8*n-7))/2).

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

Original entry on oeis.org

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

Views

Author

Boris Putievskiy, Feb 15 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(2,1), T(1,2), T(3,1);
. . .
T(1,2*n+1), T(2,2*n), T(2,2*n-1), T(1,2*n), ...T(2*n-1,3), T(2*n,2), T(2*n,1), T(2*n-1,2), T(2*n+1,1);
. . .
Movement along two adjacent antidiagonals - step to the southwest, step to the west, step to the northeast, 2 steps to the south, step to the west and so on. The length of each step is 1.
Table contains:
row 1 accommodates elements A130883 in odd places,
row 2 is alternation of elements A100037 and A033816;
column 1 is alternation of elements A000384 and A091823,
column 2 is alternation of elements A014106 and A071355,
column 3 accommodates elements A130861 in even places;
main diagonal is alternation of elements A188135 and A033567,
diagonal 1, located above the main diagonal accommodates elements A033566 in even places,
diagonal 2, located above the main diagonal is alternation of elements A139271 and A024847,
diagonal 3, located above the main diagonal accommodates of elements A033585.

Examples

			The start of the sequence as table:
1....5...2..10...7..19..16...
4....3...9...8..18..17..31...
6...14..11..23..20..36..33...
13..12..22..21..35..34..52...
15..27..24..40..37..57..54...
26..25..39..38..56..55..77...
28..44..41..61..58..82..79...
. . .
The start of the sequence as triangle array read by rows:
1;
5,4;
2,3,6;
10,9,14,13;
7,8,11,12,15;
19,18,23,22,27,26;
16,17,20,21,24,25,28;
. . .
The start of the sequence as array read by rows, the length of row r is 4*r-3.
First 2*r-2 numbers are from the row number 2*r-2 of  triangle array, located above.
Last  2*r-1 numbers are from the row number 2*r-1 of  triangle array, located above.
1;
5,4,2,3,6;
10,9,14,13,7,8,11,12,15;
19,18,23,22,27,26,16,17,20,21,24,25,28;
. . .
Row number r contains permutation 4*r-3 numbers from 2*r*r-5*r+4 to 2*r*r-r:
2*r*r-5*r+7, 2*r*r-5*r+6,...2*r*r-r-4, 2*r*r-r-3, 2*r*r-r.
		

Crossrefs

Programs

  • Maple
    T:=(n,k)->((k+n)^2-4*k+3+(-1)^k-2*(-1)^n-(k+n)*(-1)^(k+n))/2: seq(seq(T(k,n-k),k=1..n-1),n=1..13); # Muniru A Asiru, Dec 06 2018
  • Mathematica
    T[n_, k_] := ((n+k)^2 - 4k + 3 + (-1)^k - 2(-1)^n - (n+k)(-1)^(n+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)
    i=n-t*(t+1)/2
    j=(t*t+3*t+4)/2-n
    result=((t+2)**2-4*j+3+(-1)**j-2*(-1)**i-(t+2)*(-1)**t)/2

Formula

As table
T(n,k) = ((k+n)^2-4*k+3+(-1)^k-2*(-1)^n-(k+n)*(-1)^(k+n))/2.
As linear sequence
a(n) = (A003057(n)^2-4*A004736(n)+3+(-1)^A004736(n)-2*(-1)^A002260(n)-A003057(n)*(-1)^A003056(n))/2;
a(n) = ((t+2)^2-4*j+3+(-1)^j-2*(-1)^i-(t+2)*(-1)^t)/2, where i=n-t*(t+1)/2, j=(t*t+3*t+4)/2-n, t=floor((-1+sqrt(8*n-7))/2).

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

Original entry on oeis.org

1, 3, 11, 21, 37, 55, 79, 105, 137, 171, 211, 253, 301, 351, 407, 465, 529, 595, 667, 741, 821, 903, 991, 1081, 1177, 1275, 1379, 1485, 1597, 1711, 1831, 1953, 2081, 2211, 2347, 2485, 2629, 2775, 2927, 3081, 3241, 3403, 3571, 3741, 3917, 4095, 4279, 4465, 4657
Offset: 0

Views

Author

Stefano Spezia, Jan 22 2019

Keywords

Comments

For n > 0, first differences of A304487.
All the terms of this sequence are odd numbers.

Crossrefs

Cf. A306362 (prime numbers subsequence).

Programs

  • GAP
    Flat(List([0..50], n->(1/2)*(1 + (-1)^n + 2*n + 4*n^2)));
    
  • Magma
    [(1/2)*(1+(-1)^n+2*n+4*n^2): n in [0..50]];
    
  • Maple
    a:=n->(1/2)*(1 + (-1)^n + 2*n + 4*n^2): seq(a(n), n=0..50);
  • Mathematica
    a[n_]:=(1/2)*(1 + (-1)^n + 2*n + 4*n^2); Array[a, 50, 0]
  • Maxima
    makelist((1/2)*(1+(-1)^n+2*n+4*n^2), n, 0, 50);
    
  • PARI
    a(n) = (1/2)*(1+(-1)^n+2*n+4*n^2);
    
  • Python
    [(1+(-1)**n+2*n+4*n**2)/2 for n in range(0,50)]

Formula

a(n) = (1/2)*(A033999(n) + A005408(n) + 4*A000290(n)).
a(n) = 2*a(n-1) - 2*a(n-3) + a(n-4) for n > 3.
a(2*n) = A188135(n).
a(2*n-1) = A033567(n), for n > 0.
O.g.f.: -(1 + x + 5*x^2 + x^3)/(-1 + x)^3*(1 + x).
E.g.f.: (1/2)*exp(-x)*(1 + exp(2*x)*(1 + 6*x + 4*x^2)).
Sum_{n>0} 1/a(n) = (1/4)*(Pi - log(4)) + i*(polygamma(0, 1/8 - i*sqrt(7)/8) - polygamma(0, 1/8 + i*sqrt(7)/8))/(2*sqrt(7)) = 1.603596691017309384564895..., where i is the imaginary unit. - Stefano Spezia, Feb 10 2019
a(n) = 1 + 2*(n^2 + floor(n/2)). - Stefano Spezia, Dec 08 2021

A143218 Triangle read by rows, A127775 * A000012 * A127775; 1<=k<=n.

Original entry on oeis.org

1, 3, 9, 5, 15, 25, 7, 21, 35, 49, 9, 27, 45, 63, 81, 11, 33, 55, 77, 99, 121, 13, 39, 65, 91, 117, 143, 169, 15, 45, 75, 105, 135, 165, 195, 225, 17, 51, 85, 119, 153, 187, 221, 255, 289, 19, 57, 95, 133, 171, 209, 247, 285, 323, 361, 21, 63, 105, 147, 189, 231, 273, 315, 357, 399, 441
Offset: 1

Views

Author

Gary W. Adamson, Jul 30 2008

Keywords

Examples

			First few rows of the triangle =
   1;
   3,  9;
   5, 15, 25;
   7, 21, 35, 49;
   9, 27, 45, 63,  81;
  11, 33, 55, 77,  99, 121;
  13, 39, 65, 91, 117, 143, 169;
  ...
T(5,3) = 45 = 9*5 = (2*5 - 1) * (2*3 - 1).
		

Crossrefs

Programs

  • Magma
    [(2*n-1)*(2*k-1): k in [1..n], n in [1..12]]; // G. C. Greubel, Jul 12 2022
    
  • Mathematica
    Table[(2*k-1)*(2*n-1), {n,12}, {k,n}]//Flatten (* G. C. Greubel, Jul 12 2022 *)
  • SageMath
    flatten([[(2*n-1)*(2*k-1) for k in (1..n)] for n in (1..12)]) # G. C. Greubel, Jul 12 2022

Formula

Triangle read by rows, A127775 * A000012 * A127775.
T(n, k) = (2*n - 1) * (2*k - 1), 1<=k<=n.
Sum_{k=1..n} T(n, k) = A015237(n) = n^2 * (2*n-1).
From G. C. Greubel, Jul 12 2022: (Start)
T(n, k) = A131507(n,k) * A127775(n,k).
T(n, n) = A016754(n-1) = (2*n-1)^2, n >= 1.
T(2*n-1, n) = A014634(n-1), n >= 1.
T(2*n-2, n-1) = A033567(n-1), n >= 2.
Sum_{k=1..floor((n+1)/2)} T(n-k+1, k) = A024598(n), n >= 1. (End)
Showing 1-10 of 14 results. Next