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

A057029 Central column of arrays in A057027 and A057028.

Original entry on oeis.org

1, 6, 12, 27, 39, 64, 82, 117, 141, 186, 216, 271, 307, 372, 414, 489, 537, 622, 676, 771, 831, 936, 1002, 1117, 1189, 1314, 1392, 1527, 1611, 1756, 1846, 2001, 2097, 2262, 2364, 2539, 2647, 2832, 2946, 3141, 3261, 3466, 3592, 3807, 3939, 4164, 4302, 4537
Offset: 1

Views

Author

Clark Kimberling, Jul 28 2000

Keywords

Crossrefs

Programs

  • Magma
    [(5-(-1)^n+2*(-4+(-1)^n)*n+8*n^2)/4 : n in [1..80]]; // Wesley Ivan Hurt, Jul 03 2016
  • Maple
    A057029:=n->(5-(-1)^n+2*(-4+(-1)^n)*n+8*n^2)/4: seq(A057029(n), n=1..80); # Wesley Ivan Hurt, Jul 03 2016
  • Mathematica
    Table[(5 - (-1)^n + 2 (-4 + (-1)^n) n + 8 n^2)/4, {n, 49}] (* or *)
    Table[If[OddQ@ n, Binomial[2 n - 1, 2] + (n + 1)/2 , Binomial[2 n, 2] - (n - 2)/2], {n, 49}] (* or *)
    Rest@ CoefficientList[Series[x (1 + 5 x + 4 x^2 + 5 x^3 + x^4)/((1 - x)^3 (1 + x)^2), {x, 0, 49}], x] (* Michael De Vlieger, Jul 03 2016 *)
  • PARI
    Vec(x*(1+5*x+4*x^2+5*x^3+x^4)/((1-x)^3*(1+x)^2) + O(x^100)) \\ Colin Barker, Jul 02 2016
    

Formula

a(n) = C(2n-1, 2)+(n+1)/2 if n is odd, else a(n) = C(2n, 2)-(n-2)/2.
From Colin Barker, Jul 02 2016: (Start)
a(n) = (5-(-1)^n+2*(-4+(-1)^n)*n+8*n^2)/4.
a(n) = (4*n^2-3*n+2)/2 for n even, a(n) = (4*n^2-5*n+3)/2 for n odd.
a(n) = a(n-1)+2*a(n-2)-2*a(n-3)-a(n-4)+a(n-5) for n>5.
G.f.: x*(1+5*x+4*x^2+5*x^3+x^4) / ((1-x)^3*(1+x)^2). (End)
E.g.f.: ((2 - x + 4*x^2)*cosh(x) + (3 + x + 4*x^2)*sinh(x) - 2)/2. - Stefano Spezia, Sep 10 2024

A064789 Inverse permutation to A057028.

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Oct 20 2001

Keywords

Examples

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

Programs

  • PARI
    a(n) = my(k=floor((sqrt(8*n)-1)/2)); my(m=2*(n-1)-k*(k+2)); k*(k+1)/2+abs(m)+(m<=0);
    for(n=1, 32,  print(n ", ", a(n))) \\ Gerhard Ramsebner, Nov 10 2024

Formula

a(n) = k*(k+1)/2 + abs(m) + [m<=0] where k=floor((sqrt(8*n)-1)/2), m=2*(n-1)-k*(k+2) and [] is the Iverson bracket. - Gerhard Ramsebner, Nov 10 2024

Extensions

More terms from David Wasserman, Aug 14 2002

A057027 Triangle T read by rows: row n consists of the numbers C(n,2)+1 to C(n+1,2); numbers in odd-numbered places form an increasing sequence and the others a decreasing sequence.

Original entry on oeis.org

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

Views

Author

Clark Kimberling, Jul 28 2000

Keywords

Comments

Arrange the quotients F(i)/F(j) of Fibonacci numbers, for 2<=i

Examples

			For n=6, the ordered quotients are 1/8, 1/5, 2/8, 1/3, 3/8, 2/5, 1/2, 3/5, 5/8, 2/3; the positions of 1/5, 2/5, 3/5 are 2, 6, 8 (first terms of diagonal T(i, i-1)).
Triangle starts:
  1;
  2, 3;
  4, 6, 5;
  7,10, 8, 9;
  ...
		

Crossrefs

Reflection of the array in A057028 about its central column, a permutation of the natural numbers.
Inverse permutation to A064578. Central column: A057029.
Column 1 is A000124, column 2 is A000217.
Row sums are A006003.

Programs

  • Mathematica
    nn= 12; t = Table[Range[Binomial[n, 2] + 1, Binomial[n + 1, 2]], {n, nn}]; Table[t[[n, If[OddQ@ k, Ceiling[k/2], -k/2] ]], {n, nn}, {k, n}] // Flatten (* Michael De Vlieger, Jul 02 2016 *)

Formula

From Werner Schulte, Sep 09 2024: (Start)
T(n, k) = (n^2 + (-1)^k * (n - k) + (3 + (-1)^k) / 2) / 2.
T(n, 1) = (n^2 - n + 2) / 2 = A000124(n).
T(n, 2) = (n^2 + n) / 2 = A000217(n) for n >= 2.
T(n, k) = T(n, k-2) - (-1)^k for 3 <= k <= n. (End)
G.f.: x*y*(1 + x*(y - 1) - x^4*(y - 1)*y^2 + x^5*y^3 + x^3*y*(y^2 - y - 1) - x^2*(y^2 + y - 1))/((1 - x)^3*(1 - x*y)^3*(1 + x*y)). - Stefano Spezia, Sep 10 2024

Extensions

Corrected and extended by Vladeta Jovovic, Oct 18 2001

A185180 Enumeration table T(n,k) by antidiagonals. The order of the list is symmetrical movement from center to edges diagonal.

Original entry on oeis.org

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

Author

Boris Putievskiy, Dec 26 2012

Keywords

Comments

The natural numbers are grouped in chunks of 1, 2, 3, 4,... as (1), (2,3), (4,5,6), (7,8,9,10), etc and each group fills a diagonal in the table. The smallest number in a group is in A000124, the largest in A000217. Numbers in a group are placed on free spots as close as possible to the middle of the diagonal, given preference to the smaller row numbers in the table if there is a draw.
The resulting array is apparently a transposed version of A064789 (if this was also written as an array).
The order of the list table T(n,k):
if n is odd:
T (floor(n+1)/2,floor(n+1)/2), T(floor(n+1)/2-1,floor(n+1)/2+1), T(floor(n+1)/2+1,floor(n+1)/2-1),...T(1,n), T(n,1)
if n is even:
T(floor(n+1)/2-1,floor(n+1)/2+1), T(floor(n+1)/2+1,floor(n+1)/2-1),...T(1,n), T(n,1).
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.

Examples

			The start of the sequence as table:
  1....2....5....9...14...20...27 ...
  3....4....7...12...18...25...33 ...
  6....8...11...16...23...31...40 ...
  10..13...17...22...29...38...48 ...
  15..19...24...30...37...46...57 ...
  21..26...32...39...47...56...67 ...
  28..34...41...49...58...68...79 ...
  ...
The start of the sequence as triangle array read by rows:
  1;
  2,   3;
  5,   4,  6;
  9,   7,  8, 10;
  14, 12, 11, 13, 15;
  20, 18, 16, 17, 19, 21;
  27, 25, 23, 22, 24, 26, 28;
. . .
Row number k (k > 1) of the triangle contains a permutation of the set of k numbers from (k^2-k+2)/2, (k^2-k+2)/2 + 1 ,...up to (k^2+k-2)/2 + 1, namely (k^2+k-2)/2, (k^2+k-2)/2 -2,...,(k^2-k+2)/2, (k^2-k+2)/2 + 2,..., (k^2+k-2)/2-1, (k^2+k-2)/2+1.
		

Programs

  • Mathematica
    a[n_] := Module[{i, j, t}, i = n - t(t+1)/2; j = (t^2 + 3t + 4)/2 - n; t = Floor[(-1 + Sqrt[8n - 7])/2]; If[j <= i, (i(i+1) + (j-1)(j + 2i - 4))/2, (i(i+1) + (j-1)(j + 2i - 4))/2 + 2(j-i) - 1]];
    Array[a, 68] (* Jean-François Alcover, Nov 21 2018, from Python *)
  • Python
    t=int((math.sqrt(8*n-7) - 1)/ 2)
    i=n-t*(t+1)/2
    j=(t*t+3*t+4)/2-n
    if j<=i:
       m=(i*(i+1) + (j-1)*(j+2*i-4))/2
    else:
       m=(i*(i+1) + (j-1)*(j+2*i-4))/2 +2*(j-i)-1

Formula

a(n) = (i*(i+1) + (j-1)*(j+2*i-4))/2, if j<=i, a(n)=(i*(i+1) + (j-1)*(j+2*i-4))/2 +2*(j-i)-1, if j>i, where i=n-t*(t+1)/2, j=(t*t+3*t+4)/2-n, t=floor[(-1+sqrt(8*n-7))/2].
Showing 1-4 of 4 results.