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

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

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

A257083 Partial sums of A257088.

Original entry on oeis.org

1, 2, 6, 9, 17, 22, 34, 41, 57, 66, 86, 97, 121, 134, 162, 177, 209, 226, 262, 281, 321, 342, 386, 409, 457, 482, 534, 561, 617, 646, 706, 737, 801, 834, 902, 937, 1009, 1046, 1122, 1161, 1241, 1282, 1366, 1409, 1497, 1542, 1634, 1681, 1777, 1826, 1926, 1977
Offset: 0

Views

Author

Reinhard Zumkeller, Apr 17 2015

Keywords

Comments

Equivalently, numbers of the form m*(3*m+2)+1, where m = 0, -1, 1, -2, 2, -3, 3, ... - Bruno Berselli, Jan 05 2016
Also, numbers k such that 3*k-2 is a square. - Bruno Berselli, Jan 30 2018

Crossrefs

Cf. A246695 (partial sums), A257088.
Cf. A056109: numbers of the form m*(3*m+2)+1 for nonnegative m.

Programs

  • Haskell
    a257083 n = a257083_list !! n
    a257083_list = scanl1 (+) a257088_list
    
  • Magma
    [(6*n*(n+1) + (2*n+1)*(-1)^n + 7)/8 : n in [0..60]]; // Wesley Ivan Hurt, Oct 30 2022
  • Mathematica
    Table[(6 n (n + 1) + (2 n + 1) (-1)^n + 7)/8, {n, 0, 60}] (* Bruno Berselli, Jan 05 2016 *)
  • PARI
    vector(60, n, n--; (6*n*(n+1)+(2*n+1)*(-1)^n+7)/8) \\ Bruno Berselli, Jan 05 2016
    

Formula

From Bruno Berselli, Jan 05 2016: (Start)
G.f.: (1 + x + 2*x^2 + x^3 + x^4)/((1 + x)^2*(1 - x)^3).
a(n) = (6*n*(n+1) + (2*n+1)*(-1)^n + 7)/8. (End)
a(n) = a(n-1) + 2*a(n-2) - 2*a(n-3) - a(n-4) + a(n-5). - Wesley Ivan Hurt, Oct 30 2022

A246705 Position of first n in A246694 (read as sequence with offset changed to 1); complement of A246706.

Original entry on oeis.org

1, 3, 4, 6, 8, 10, 11, 13, 15, 17, 19, 21, 22, 24, 26, 28, 30, 32, 34, 36, 37, 39, 41, 43, 45, 47, 49, 51, 53, 55, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 79, 81, 83, 85, 87, 89, 91, 93, 95, 97, 99, 101, 103, 105, 106, 108, 110, 112, 114, 116, 118
Offset: 1

Views

Author

Clark Kimberling, Sep 02 2014

Keywords

Examples

			A246694 begins with 1, 1, 2, 3, 2, 4, 3, 5, 4, 6, 7, 5, 8, 6, 9, 7, so that, for a(n) = position of first n and b(n) = position of last n, we have a = (1,3,4,6,8,10,...) and b = (2,5,7,9,12,...).
Note, however, that A246694 has offset 0, so the values here are off by 1 from the positions as given by the indices (b-file or list) in that sequence. - _M. F. Hasler_, Nov 17 2014
		

Crossrefs

Programs

  • 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;
    u = Flatten[Table[t[n, k], {n, 0, z}, {k, 0, n}]]; (*A246694*)
    w[n_] := Flatten[Position[u, n]]; A246705 = Table[First[w[n]], {n, 1, 3*z}]

A246706 Position of last n in A246694 (read as a sequence, with offset changed to 1); complement of A246705.

Original entry on oeis.org

2, 5, 7, 9, 12, 14, 16, 18, 20, 23, 25, 27, 29, 31, 33, 35, 38, 40, 42, 44, 46, 48, 50, 52, 54, 57, 59, 61, 63, 65, 67, 69, 71, 73, 75, 77, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100, 102, 104, 107, 109, 111, 113, 115, 117, 119, 121, 123, 125, 127, 129, 131
Offset: 1

Views

Author

Clark Kimberling, Sep 02 2014

Keywords

Comments

Note that A246694 has offset 0, so the values here are off by 1 from the positions as given by the indices (b-file or list) in that sequence. - M. F. Hasler, Nov 17 2014

Examples

			A246694 begins with 1, 1, 2, 3, 2, 4, 3, 5, 4, 6, 7, 5, 8, 6, 9, 7, so that, for a(n) = position of first n and b(n) = position of last n, we have a = (1,3,4,6,8,10,...) and b = (2,5,7,9,12,...).
		

Crossrefs

Programs

  • 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;
    u = Flatten[Table[t[n, k], {n, 0, z}, {k, 0, n}]]; (*A246694*)
    w[n_] := Flatten[Position[u, n]]; A246706 = Table[Last[w[n]], {n, 1, 3*z}]

A257088 a(2*n) = 4*n if n>0, a(2*n + 1) = 2*n + 1, a(0) = 1.

Original entry on oeis.org

1, 1, 4, 3, 8, 5, 12, 7, 16, 9, 20, 11, 24, 13, 28, 15, 32, 17, 36, 19, 40, 21, 44, 23, 48, 25, 52, 27, 56, 29, 60, 31, 64, 33, 68, 35, 72, 37, 76, 39, 80, 41, 84, 43, 88, 45, 92, 47, 96, 49, 100, 51, 104, 53, 108, 55, 112, 57, 116, 59, 120, 61, 124, 63, 128
Offset: 0

Views

Author

Michael Somos, Apr 16 2015

Keywords

Examples

			G.f. = 1 + x + 4*x^2 + 3*x^3 + 8*x^4 + 5*x^5 + 12*x^6 + 7*x^7 + 16*x^8 + ...
		

Crossrefs

CF. A257083 (partial sums), A246695.

Programs

  • Haskell
    import Data.List (transpose)
    a257088 n = a257088_list !! n
    a257088_list = concat $ transpose [a008574_list, a005408_list]
    -- Reinhard Zumkeller, Apr 17 2015
  • Mathematica
    a[ n_] := Which[ n < 1, Boole[n == 0], OddQ[n], n, True, 2 n];
    a[ n_] := SeriesCoefficient[ (1 + x + 2*x^2 + x^3 + x^4) / (1 - 2*x^2 + x^4), {x, 0, n}];
  • PARI
    {a(n) = if( n<1, n==0, n%2, n, 2*n)};
    
  • PARI
    {a(n) = if( n<0, 0, polcoeff( (1 + x + 2*x^2 + x^3 + x^4) / (1 - 2*x^2 + x^4) + x * O(x^n), n))};
    

Formula

Euler transform of length 4 sequence [ 1, 3, -1, -1].
a(n) is multiplicative with a(2^e) = 2^(e+1) if e>0, otherwise a(p^e) = p^e.
G.f.: (1 + x + 2*x^2 + x^3 + x^4) / (1 - 2*x^2 + x^4).
G.f.: (1 - x^3) * (1 - x^4) / ((1 - x) * (1 - x^2)^3).
MOBIUS transform of A215947 is [1, 4, 3, 8, 5, ...].
a(n) = n * A040001(n) if n>0.
a(n) + a(n-1) = A007310(n) if n>0.
a(n) = A001082(n+1) - A001082(n) if n>0.
Binomial transform with a(0)=0 is A128543 if n>0.
a(2*n) = A008574(n). a(2*n + 1) = A005408(n).
a(n) = A022998(n) if n>0. - R. J. Mathar, Apr 19 2015
From Amiram Eldar, Jan 28 2025: (Start)
Dirichlet g.f.: (1+2^(1-s)) * zeta(s-1).
Sum_{k=1..n} a(k) ~ (3/4) * n^2. (End)
a(n) = gcd(n^n, 2*n). - Mia Boudreau, Jun 27 2025
Showing 1-6 of 6 results.