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.

A045975 Take the first odd integer and multiple of 1, the next 2 even integers and multiples of 2, the next 3 odd integers and multiples of 3, the next 4 even integers and multiples of 4, ...

Original entry on oeis.org

1, 2, 4, 9, 15, 21, 24, 28, 32, 36, 45, 55, 65, 75, 85, 90, 96, 102, 108, 114, 120, 133, 147, 161, 175, 189, 203, 217, 224, 232, 240, 248, 256, 264, 272, 280, 297, 315, 333, 351, 369, 387, 405, 423, 441, 450, 460, 470, 480, 490, 500, 510, 520, 530, 540, 561, 583, 605, 627, 649, 671, 693
Offset: 1

Views

Author

Fang-kuo Huang (gsyps(AT)ms17.hinet.net)

Keywords

Comments

A generalized Connell sequence.

Examples

			Triangle begins:
    1;
    2,   4;
    9,  15,  21;
   24,  28,  32,  36;
   45,  55,  65,  75,  85;
   90,  96, 102, 108, 114, 120;
  133, 147, 161, 175, 189, 203, 217;
  ...
		

Crossrefs

Seen as a triangle read by rows: cf. A204558 (row sums), A005917 (central terms), A204556 (left edge), A204557 (right edge).

Programs

  • Haskell
    a045975 n k = a045975_tabl !! (n-1) !! (k-1)
    a045975_row n = a045975_tabl !! (n-1)
    a045975_tabl = f 1 [1..] where
       f k xs = ys : f (k+1) (dropWhile (<= last ys) xs) where
         ys | even k    = take k ms
            | otherwise = take k $ filter odd ms
         ms = filter ((== 0) . (`mod` k)) xs
    -- Reinhard Zumkeller, Jan 18 2012
  • Mathematica
    first[n_?EvenQ] := (n - 1)*n^2/2; first[n_?OddQ] := n*(n^2 - 2n + 3)/2; row[n_] := (ro = {first[n]}; next = first[n] + n; While[ Length[ro] < n, If[Mod[next , 2] == Mod[n, 2], AppendTo[ro, next]]; next = next + n]; ro); Flatten[ Table[row[n], {n, 1, 11}]](* Jean-François Alcover, Jun 08 2012 *)

Extensions

More terms from James Sellers
Keyword tabl added by Reinhard Zumkeller, Jan 18 2012

A204557 Right edge of the triangle A045975.

Original entry on oeis.org

1, 4, 21, 36, 85, 120, 217, 280, 441, 540, 781, 924, 1261, 1456, 1905, 2160, 2737, 3060, 3781, 4180, 5061, 5544, 6601, 7176, 8425, 9100, 10557, 11340, 13021, 13920, 15841, 16864, 19041, 20196, 22645, 23940, 26677, 28120, 31161, 32760, 36121, 37884, 41581
Offset: 1

Views

Author

Reinhard Zumkeller, Jan 18 2012

Keywords

Programs

  • Haskell
    a204557 = last . a045975_row
    
  • Magma
    [n*(2*n^2+(3-(-1)^n)*n-(-1)^n-3)/4: n in [1..50]]; // G. C. Greubel, Jun 15 2018
  • Mathematica
    Table[n*(2*n^2+(3-(-1)^n)*n-(-1)^n-3)/4, {n, 1, 50}] (* G. C. Greubel, Jun 15 2018 *)
    LinearRecurrence[{1,3,-3,-3,3,1,-1},{1,4,21,36,85,120,217},50] (* Harvey P. Dale, Feb 20 2021 *)
  • PARI
    Vec(-x*(-1-3*x-14*x^2-6*x^3-x^4+x^5)/((1+x)^3*(x-1)^4) + O(x^100)) \\ Colin Barker, Jan 28 2016
    

Formula

a(n) = A045975(n,n);
a(n) = A079326(n+1) * n;
a(n) = A204556(n) + A045895(n).
G.f.: -x*(-1-3*x-14*x^2-6*x^3-x^4+x^5) / ((1+x)^3*(x-1)^4). - R. J. Mathar, Aug 13 2012
From Colin Barker, Jan 28 2016: (Start)
a(n) = n*(2*n^2+(3-(-1)^n)*n-(-1)^n-3)/4.
a(n) = (n^3+n^2-2*n)/2 for n even.
a(n) = (n^3+2*n^2-n)/2 for n odd.
(End)

A031940 Length of longest legal domino snake using full set of dominoes up to [n:n].

Original entry on oeis.org

1, 3, 6, 9, 15, 19, 28, 33, 45, 51, 66, 73, 91, 99, 120, 129, 153, 163, 190, 201, 231, 243, 276, 289, 325, 339, 378, 393, 435, 451, 496, 513, 561, 579, 630, 649, 703, 723, 780, 801, 861, 883, 946, 969, 1035, 1059, 1128, 1153, 1225, 1251, 1326, 1353, 1431, 1459
Offset: 1

Views

Author

Keywords

Examples

			E.g., for n=4 [ 1:1 ][ 1:2 ][ 2:2 ][ 2:3 ][ 3:3 ][ 3:1 ][ 1:4 ][ 4:4 ][ 4:2 ].
		

Crossrefs

Programs

  • Magma
    [((-1)^n*(2 - n) + (2 + n + 2*n^2))/4: n in [1..60]]; // G. C. Greubel, Jun 15 2018
  • Mathematica
    Rest[CoefficientList[Series[x*(1 + 2*x + x^2 - x^3 + x^4)/((1 + x)^2*(1 - x)^3), {x, 0, 50}], x]] (* or *) Table[((-1)^n*(2-n) + (2+n+2*n^2))/4, {n,1, 50}] (* G. C. Greubel, Jun 15 2018 *)
  • PARI
    for(n=1, 60, print1(((-1)^n*(2 - n) + (2 + n + 2*n^2))/4, ", ")) \\ G. C. Greubel, Jun 15 2018
    
  • PARI
    Vec(-x*(1+2*x+x^2-x^3+x^4) / ( (1+x)^2*(x-1)^3 ) + O(x^60)) \\ Felix Fröhlich, Jun 18 2018
    

Formula

C(n, 2) + n if n odd, C(n, 2) + n/2 + 1 if n even. - T. D. Noe, Nov 09 2006
a(n) = A204556(n+1) / (n+1). - Reinhard Zumkeller, Jan 18 2012
G.f.: -x*(1+2*x+x^2-x^3+x^4) / ( (1+x)^2*(x-1)^3 ). - R. J. Mathar, Aug 13 2012
a(n) = ((-1)^n*(2 - n) + (2 + n + 2*n^2))/4. - G. C. Greubel, Jun 15 2018

Extensions

Corrected by T. D. Noe, Nov 09 2006
More terms from Felix Fröhlich, Jun 18 2018

A045895 Period length of pairs (a,b) where a has period 2n-2 and b has period n.

Original entry on oeis.org

0, 2, 12, 12, 40, 30, 84, 56, 144, 90, 220, 132, 312, 182, 420, 240, 544, 306, 684, 380, 840, 462, 1012, 552, 1200, 650, 1404, 756, 1624, 870, 1860, 992, 2112, 1122, 2380, 1260, 2664, 1406, 2964, 1560
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Magma
    [Lcm(2*n-2, n): n in [1..50]]; // G. C. Greubel, Jun 15 2018
  • Mathematica
    Table[ LCM[ 2*n-2, n ], {n, 40} ]
  • PARI
    for(n=1, 50, print1(lcm(2*n-2, n), ", ")) \\ G. C. Greubel, Jun 15 2018
    

Formula

a(n) = A204557(n) - A204556(n). - Reinhard Zumkeller, Jan 18 2012
From Amiram Eldar, Sep 14 2022: (Start)
a(n) = n*(n-1) for n even.
a(n) = 2*n*(n-1) for n odd.
a(n) = lcm(2*n-2, n).
a(n) = 2*A045896(n-2).
Sum_{n>=2} 1/a(n) = (log(2)+1)/2. (End)
Showing 1-4 of 4 results.