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

A059029 a(n) = n if n is even, 2*n + 1 if n is odd.

Original entry on oeis.org

0, 3, 2, 7, 4, 11, 6, 15, 8, 19, 10, 23, 12, 27, 14, 31, 16, 35, 18, 39, 20, 43, 22, 47, 24, 51, 26, 55, 28, 59, 30, 63, 32, 67, 34, 71, 36, 75, 38, 79, 40, 83, 42, 87, 44, 91, 46, 95, 48, 99, 50, 103, 52, 107, 54, 111, 56, 115, 58, 119, 60, 123, 62, 127, 64, 131, 66, 135
Offset: 0

Views

Author

Asher Auel, Dec 15 2000

Keywords

Comments

a(n-1) = n^k - 1 mod 2*n, n >= 1, for any k >= 2, also for k = n. - Wolfdieter Lang, Dec 21 2011

Crossrefs

a(n) = A022998(n+1) - 1 = A043547(n+3) - 3. Partial sums in A032438.

Programs

  • Magma
    [n+((n+1)/2)*(1-(-1)^n): n in [0..70]]; // Vincenzo Librandi, Aug 14 2011
  • Maple
    B := (n,m) -> lcm(n,m)/n + lcm(n,m)/m - 1: seq(B(m+2,m),m=1..90);
  • Mathematica
    Table[n +(n+1)*(1-(-1)^n)/2, {n,0,70}] (* G. C. Greubel, Nov 08 2018 *)
    Table[If[EvenQ[n],n,2n+1],{n,0,70}] (* or *) LinearRecurrence[{0,2,0,-1},{0,3,2,7},70] (* Harvey P. Dale, Jul 23 2025 *)
  • PARI
    a(n)=if(n%2,2*n+1,n)
    

Formula

G.f.: x*(x^2 + 2*x + 3)/(1 - x^2)^2. - Ralf Stephan, Jun 10 2003
Third main diagonal of A059026: a(n) = B(n+2, n) = lcm(n+2, n)/(n+2) + lcm(n+2, n)/n - 1 for all n >= 1.
a(2*n) + a(2*n+1) = A016945(n). - Paul Curtz, Aug 29 2008
E.g.f.: 2*x*cosh(x) + (1 + x)*sinh(x). - Franck Maminirina Ramaharo, Nov 08 2018

Extensions

New description from Ralf Stephan, Jun 10 2003

A143785 Antidiagonal sums of the triangle A120070.

Original entry on oeis.org

3, 8, 20, 36, 63, 96, 144, 200, 275, 360, 468, 588, 735, 896, 1088, 1296, 1539, 1800, 2100, 2420, 2783, 3168, 3600, 4056, 4563, 5096, 5684, 6300, 6975, 7680, 8448, 9248, 10115, 11016, 11988, 12996, 14079, 15200, 16400, 17640, 18963, 20328, 21780, 23276
Offset: 1

Views

Author

Paul Curtz, Sep 01 2008

Keywords

Comments

Let b(n) be the sequence (0,0,0,3,8,20,36,...), with offset 0. Then b(n) is the number of triples (w,x,y) having all terms in {0,...,n} and w < range{w,x,y}. - Clark Kimberling, Jun 11 2012
Consider a(n) with two 0's prepended and offset 1. Call the new sequence b(n) and consider the partitions of n into two parts (p,q). Then b(n) represents the sum of all the products (p + q) * (q - p) where p <= q. - Wesley Ivan Hurt, Apr 12 2018

Examples

			First diagonal 3 = 3.
Second diagonal 8 = 8.
Third diagonal 5+15 = 20.
Fourth diagonal 24+12 = 36.
		

Crossrefs

Cf. A035006, A099721 (bisections).

Programs

  • Magma
    [(n+2)*(2*n^2+4*n-(-1)^n+1)/8: n in [1..50]]; // Vincenzo Librandi, Jan 22 2018
  • Mathematica
    Rest@ CoefficientList[Series[x (3 + 2 x + x^2)/((1 + x)^2*(x - 1)^4), {x, 0, 44}], x] (* Michael De Vlieger, Dec 22 2017 *)
    LinearRecurrence[{2, 1, -4, 1, 2, -1}, {3, 8, 20, 36, 63, 96}, 60] (* Vincenzo Librandi, Jan 22 2018 *)
  • PARI
    Vec(x*(3+2*x+x^2)/((1+x)^2*(x-1)^4) + O(x^50)) \\ Colin Barker, May 07 2016
    

Formula

a(n+1) - a(n) = A032438(n+2).
a(n) = A006918(n-2) + 2*A006918(n-1) + 3*A006918(n). - R. J. Mathar, Jul 01 2011
G.f.: x*(3+2*x+x^2) / ( (1+x)^2*(x-1)^4 ). - R. J. Mathar, Jul 01 2011
a(n) = (n+2)*(2*n^2 + 4*n - (-1)^n + 1)/8. - Ilya Gutkovskiy, May 07 2016
From Colin Barker, May 07 2016: (Start)
a(n) = (n^3 + 4*n^2 + 4*n)/4 for n even.
a(n) = (n^3 + 4*n^2 + 5*n + 2)/4 for n odd.
a(n) = 2*a(n-1) + a(n-2) - 4*a(n-3) + a(n-4) + 2*a(n-5) - a(n-6) for n > 6. (End)
a(n) = Sum_{k=1..n+1} floor((n+1)*k/2). - Wesley Ivan Hurt, Apr 01 2017
a(n) = (n+2)*floor((n+1)^2/4) ( = (n+2)*A002620(n+1) ) for n > 0. - Heinrich Ludwig, Dec 22 2017
E.g.f.: e^(-x) * (-2 + x + e^(2*x)*(2 + 19*x + 14*x^2 + 2*x^3))/8. - Iain Fox, Dec 29 2017

A272459 The total number of different isosceles trapezoids, excluding squares, that can be drawn on an n X n square grid where the corners of each individual trapezoid lie on a lattice point.

Original entry on oeis.org

0, 1, 7, 18, 40, 71, 119, 180, 264, 365, 495, 646, 832, 1043, 1295, 1576, 1904, 2265, 2679, 3130, 3640, 4191, 4807, 5468, 6200, 6981, 7839, 8750, 9744, 10795, 11935, 13136, 14432, 15793, 17255, 18786, 20424, 22135, 23959, 25860, 27880, 29981, 32207, 34518
Offset: 1

Views

Author

Christopher J. Shore, Apr 29 2016

Keywords

Comments

This is an observation from a high school mathematics investigation: How many different isosceles trapezoids can be drawn on an n X n grid such that the corners of each individual trapezoid lie on a lattice point? The sequence gives the total number of different trapezoids that can be drawn.
There are two "families" or types of trapezoids that can be drawn on a grid. The first is where the parallel sides are drawn horizontally on the grid. The second is where the parallel sides are drawn diagonally with a gradient of 1. The number in each type follow a pattern.
1 X 1 grid: No trapezoids of either type can be drawn.
2 X 2 grid: 1 trapezoid of type 2. One parallel side is drawn diagonally through 1 square (having length sqrt(2)) and the other is drawn diagonally through two squares (length 2*sqrt(2)). Thus, the non-parallel sides are drawn horizontally or vertically to join between the parallel sides (each length 1).
3 X 3 grid: 3 trapezoids of type 1 and 4 trapezoids of type 2. The 3 trapezoids of type 1 are constructed by one parallel line drawn horizontally with length 3, the other parallel line drawn with length 1 and the perpendicular heights being successively 1, 2 and 3. Type-2 trapezoids are constructed in the same way as outlined above but with varying lengths and heights.
4 X 4 grid: 8 type-1 trapezoids and 10 type-2 trapezoids.
5 X 5 grid: 20 type-1 trapezoids and 20 type-2 trapezoids.
Hence the pattern is as follows:
Type 1 Type 2 Total
1 X 1 grid 0 0 0
2 X 2 grid 0 1 1
3 X 3 grid 3 4 7
4 X 4 grid 8 10 18
5 X 5 grid 20 20 40
6 X 6 grid 36 35 71
7 X 7 grid 63 56 119

Crossrefs

Programs

  • Magma
    [(n*(-1-3*(-1)^n-12*n+10*n^2))/24 : n in [1..60]]; // Wesley Ivan Hurt, Sep 12 2016
  • Maple
    A272459:=n->(n*(-1-3*(-1)^n-12*n+10*n^2))/24: seq(A272459(n), n=1..60); # Wesley Ivan Hurt, Sep 12 2016
  • Mathematica
    CoefficientList[Series[x^2 (1 + 5 x + 3 x^2 + x^3)/((1 - x)^4 (1 + x)^2), {x, 0, 44}], x] (* Michael De Vlieger, May 08 2016 *)
  • PARI
    concat(0, Vec(x^2*(1+5*x+3*x^2+x^3)/((1-x)^4*(1+x)^2) + O(x^50))) \\ Colin Barker, May 07 2016
    

Formula

a(n) = Sum_{k=0..n} A032438(k) + A000292(n-1). (conjectured)
a(n) = A143785(n-2) + A000292(n-1). (conjectured)
From Colin Barker, May 07 2016: (Start)
a(n) = (n*(-1 - 3*(-1)^n - 12*n + 10*n^2))/24.
a(n) = (5*n^3 - 6*n^2 - 2*n)/12 for n even.
a(n) = (5*n^3 - 6*n^2 + n)/12 for n odd.
a(n) = 2*a(n-1) + a(n-2) - 4*a(n-3) + a(n-4) + 2*a(n-5) - a(n-6) for n>6.
G.f.: x^2*(1+5*x+3*x^2+x^3) / ((1-x)^4*(1+x)^2).
(End)
Showing 1-3 of 3 results.