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.

A002789 Number of integer points in a certain quadrilateral scaled by a factor of n.

Original entry on oeis.org

2, 4, 7, 11, 16, 21, 28, 35, 43, 52, 62, 72, 84, 96, 109, 123, 138, 153, 170, 187, 205, 224, 244, 264, 286, 308, 331, 355, 380, 405, 432, 459, 487, 516, 546, 576, 608, 640, 673, 707, 742, 777, 814, 851, 889, 928, 968, 1008, 1050, 1092, 1135, 1179, 1224, 1269
Offset: 1

Views

Author

Keywords

Comments

The quadrilateral is given by four vertices [(1/2, 1/3), (0, 1), (0, 0), (1, 0)] as an example on page 22 of Ehrhart 1967. Here the closed line segment from (1/2, 1/3) to (0, 1) is not included but the rest of the boundary is. The sequence is denoted by d(n). - Michael Somos, May 22 2014

Examples

			G.f. = 2*x + 4*x^2 + 7*x^3 + 11*x^4 + 16*x^5 + 21*x^6 + 28*x^7 + 35*x^8 + ...
		

References

  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Mathematica
    a[ n_] := Quotient[ 7 + 12 n + 5 n^2, 12]; (* Michael Somos, May 22 2014 *)
    a[ n_] := Length @ With[{o = Boole[ 0 < n], c = Boole[ 0 >= n], m = Abs@n}, FindInstance[ 0 < o + x && 0 < o + y && (2 x < o + m && 4 x + 3 y < c + 3 m || m < c + 2 x && 2 x + 3 y < o + 2 m), {x, y}, Integers, 10^9]]; (* Michael Somos, May 22 2014 *)
  • PARI
    {a(n) = (7 + 12*n + 5*n^2) \ 12}; /* Michael Somos, May 22 2014 */
    
  • PARI
    {a(n) = if( n<0, polcoeff( x^3 * (1 + x + x^2 + 2*x^4) / ((1 - x)^2 * (1 - x^6)) + x * O(x^-n), -n), polcoeff( x * (2 + x^2 + x^3 + x^4) / ((1 - x)^2 * (1 - x^6)) + x * O(x^n), n))}; /* Michael Somos, May 22 2014 */

Formula

G.f.: x * (2 + 2*x + x^2) / (1 - x - x^2 + x^4 + x^5 - x^6) = (2*x + x^3 + x^4 + x^5) / ((1 - x)^2 * (1 - x^6)). - Michael Somos, May 22 2014
a(n) = floor( A168668(n+1) / 12), a(n) = A242771(-n), a(n) - a(n-1) = A242774(n) for all n in Z. - Michael Somos, May 22 2014