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.

A246697 Row sums of the triangular array A246696.

Original entry on oeis.org

1, 5, 16, 34, 67, 111, 178, 260, 373, 505, 676, 870, 1111, 1379, 1702, 2056, 2473, 2925, 3448, 4010, 4651, 5335, 6106, 6924, 7837, 8801, 9868, 10990, 12223, 13515, 14926, 16400, 18001, 19669, 21472, 23346, 25363, 27455, 29698, 32020, 34501, 37065, 39796
Offset: 0

Views

Author

Clark Kimberling, Sep 02 2014

Keywords

Examples

			First 5 rows of A246694 preceded by sums
sum = 1: ...... 1;
sum = 5: ...... 2 ... 3;
sum = 16: ..... 5 ... 4 ... 7;
sum = 34: ..... 6 ... 9 ... 8 ... 11;
sum = 67: ..... 13 .. 10 .. 15 .. 12 .. 17.
		

Crossrefs

Programs

  • Mathematica
    z = 25; t[0, 0] = 1; t[1, 0] = 2; t[1, 1] = 3; t[n_, 0] := t[n, 0] = If[OddQ[n], t[n - 1, n - 2] + 2, t[n - 1, n - 1] + 2]; t[n_, 1] := t[n, 1] = If[OddQ[n], t[n - 1, n - 1] + 2, t[n - 1, n - 2] + 2]
    t[n_, k_] := t[n, k] = t[n, k - 2] + 2;
    u = Flatten[Table[t[n, k], {n, 0, z}, {k, 0, n}]] (* A246696 *)
    Table[Sum[t[n, k], {k, 0, n}], {n, 0, 2*z}] (* A246697 *)

Formula

Conjectured linear recurrence: a(n) = 2*a(n-1) + a(n-2) - 4*a(n-3) + a(n-4) + 2*a(n-5) - a(n-6), with a(0) = 1, a(1) = 5, a(2) = 16, a(3) = 34, a(4) = 67, a(5) = 111, a(6) = 178.
Conjectured g.f.: (1 + 3*x + 5*x^2 + x^3 + 2*x^4)/((x - 1)^4*(x + 1)^2).
Conjecture: a(n) = (2*n^3+6*n^2+9*n+4+n*(-1)^n)/4. - Luce ETIENNE, Oct 16 2016
Conjectured e.g.f.: ((2 + 8*x + 6*x^2 + x^3)*cosh(x) + (2 + 9*x + 6*x^2 + x^3)*sinh(x))/2. - Stefano Spezia, May 10 2021

Extensions

Corrected and edited by M. F. Hasler, Nov 17 2014

A246698 Inverse of A246696 considered as a permutation of the positive integers.

Original entry on oeis.org

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

Views

Author

Clark Kimberling, Sep 02 2014

Keywords

Crossrefs

Programs

  • Mathematica
    z = 25; t[0, 0] = 1; t[1, 0] = 2; t[1, 1] = 3; t[n_, 0] := t[n, 0] = If[OddQ[n], t[n - 1, n - 2] + 2, t[n - 1, n - 1] + 2]; t[n_, 1] := t[n, 1] = If[OddQ[n], t[n - 1, n - 1] + 2, t[n - 1, n - 2] + 2]
    t[n_, k_] := t[n, k] = t[n, k - 2] + 2;
    u = Flatten[Table[t[n, k], {n, 0, z}, {k, 0, n}]] (* A246696 *)
    Flatten[Table[Position[u, n], {n, 1, 80}]]  (* A246698 *)

Extensions

Definition corrected and edited by M. F. Hasler, Nov 17 2014

A246694 Triangle read by rows: T(n,k) = T(n,k-2) + 1 if n > 1 and 2 <= k <= n; T(0,0) = 1, T(1,0) = 1, T(1,1) = 2; if n > 1 is odd, then T(n,0) = T(n-1,n-2) + 1 and T(n,1) = T(n-1,n-1) + 1; if n > 1 is even, then T(n,0) = T(n-1,n-1) + 1 and T(n,1) = T(n-1,n-2) + 1.

Original entry on oeis.org

1, 1, 2, 3, 2, 4, 3, 5, 4, 6, 7, 5, 8, 6, 9, 7, 10, 8, 11, 9, 12, 13, 10, 14, 11, 15, 12, 16, 13, 17, 14, 18, 15, 19, 16, 20, 21, 17, 22, 18, 23, 19, 24, 20, 25, 21, 26, 22, 27, 23, 28, 24, 29, 25, 30, 31, 26, 32, 27, 33, 28, 34, 29, 35, 30, 36, 31, 37, 32
Offset: 0

Views

Author

Clark Kimberling, Sep 01 2014

Keywords

Comments

As an array, for each m, row 2*m has m odd numbers and m+1 even numbers; row 2*m-1 has m odds and m evens. As a sequence, every positive integer n occurs exactly twice, separated by floor((n+1)/2) other numbers.

Examples

			First 8 rows:
  1
  1 ... 2
  3 ... 2 ... 4
  3 ... 5 ... 4 ... 6
  7 ... 5 ... 8 ... 6 ... 9
  7 .. 10 ... 8 .. 11 ... 9 .. 12
 13 .. 10 .. 14 .. 11 .. 15 .. 12 .. 16
 13 .. 17 .. 14 .. 18 .. 15 .. 19 .. 16 .. 20
		

Crossrefs

Cf. A246695 (row sums), A174114 (central terms).
Cf. A002620 (main diagonal and first subdiagonal), A377802.

Programs

  • Haskell
    a246694 n k = a246694_tabl !! n !! k
    a246694_row n = a246694_tabl !! n
    a246694_tabl = [1] : [1,2] : f 1 2 [1,2] where
       f i z xs = ys : f j (z + 1) ys where
         ys = take (z + 1) $ map (+ 1) (xs !! (z - i) : xs !! (z - j) : ys)
         j = 3 - i
    -- Reinhard Zumkeller, Sep 03 2014
  • Mathematica
    z = 25; t[0, 0] = 1; t[1, 0] = 1; t[1, 1] = 2;
    t[n_, 0] := If[OddQ[n], t[n - 1, n - 2] + 1, t[n - 1, n - 1] + 1];
    t[n_, 1] := If[OddQ[n], t[n - 1, n - 1] + 1, t[n - 1, n - 2] + 1];
    t[n_, k_] := t[n, k - 2] + 1; Flatten[Table[t[n, k], {n, 0, z}, {k, 0, n}]](*A246694*)

Formula

T(n, k) = 1 + floor(n/2) * (1+(-1)^k) / 2 + (floor(n/2))^2 + (2*k - 1 + (-1)^k) / 4 + (1-(-1)^n) * (1-(-1)^k) * n / 4. - Werner Schulte, Nov 16 2024
From Stefano Spezia, Nov 17 2024: (Start)
T(n, k) = (6 + (-1)^k + (-1)^(k+n) + 4*k + 2*n*(1 + (-1)^(k+n) + n))/8.
G.f.: (1 - x^3*y + x^7*y^3 + x^4*(1 - 2*y^2) - x^5*y*(1 - y^2))/((1 - x)^3*(1 + x)^2*(1 - x*y)^3*(1 + x*y)). (End)

Extensions

Edited by M. F. Hasler, Nov 17 2014

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

Original entry on oeis.org

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

Views

Author

Werner Schulte, Sep 14 2024

Keywords

Comments

Conjecture: This triangle seen as a sequence yields a permutation of the natural numbers.

Examples

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

Crossrefs

Main diagonal is A000982.
Column 1 is A047838(n+1).
Column 2 is 2*A033638.
Cf. A246696 (permutation by row), A246697 (row sums), A376583 (parity).

Programs

  • PARI
    T(n,k)=(2*n^2+4*n+1-(-1)^n)/4-k-(1+(-1)^k)*(n-k)

Formula

T(n, k) = T(n, k-1) - (-1)^k * (2*n - 2*k + 1) for 2 <= k <= n.
T(n, k) = T(n, k-2) + 2 * (-1)^k for 3 <= k <= n.
Row sums: Sum_{k=1..n} T(n, k) = (n^3 + n) / 2 + (n - 1) * (1 - (-1)^n) / 4.
G.f.: x*y*(1 + x + x^2*(1 - y)^2 - 3*x^5*y^2 + 2*x^6*y^3 + x^4*y*(4 + y) - x^3*(1 + 4*y + y^2))/((1 - x)^3*(1 + x)*(1 - x*y)^3*(1 + x*y)). - Stefano Spezia, Sep 16 2024
From Ruud H.G. van Tol, Sep 22 2024: (Start)
T(n, 1) = A047838(n+1).
T(n, 2) = A033638(n) * 2.
T(n, n) = A000982(n) = (T(n, 1) + T(n, 2) - 1) / 2 for n >= 2. (End)
Showing 1-4 of 4 results.