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

A227327 Number of non-equivalent ways to choose two points in an equilateral triangle grid of side n.

Original entry on oeis.org

0, 1, 4, 10, 22, 41, 72, 116, 180, 265, 380, 526, 714, 945, 1232, 1576, 1992, 2481, 3060, 3730, 4510, 5401, 6424, 7580, 8892, 10361, 12012, 13846, 15890, 18145, 20640, 23376, 26384, 29665, 33252, 37146, 41382, 45961, 50920, 56260, 62020, 68201, 74844
Offset: 1

Views

Author

Heinrich Ludwig, Jul 07 2013

Keywords

Comments

The sequence is an alternating composition of A178073 and A071244: a(n) = 2*A071244((n+1)/2) if n is odd, otherwise a(n) = A178073(n/2).

Examples

			for n = 3 there are the following 4 choices of 2 points (X) (rotations and reflections being ignored):
     X         X         X         .
    X .       . .       . .       X X
   . . .     X . .     . X .     . . .
		

Crossrefs

Corresponding questions about the number of ways in a square grid are treated by A083374 (2 points) and A178208 (3 points).

Programs

  • Mathematica
    Table[b = n^4 + 2*n^3 + 8*n^2; If[EvenQ[n], c = b - 8*n, c = b - 2*n - 9]; c/48, {n, 43}] (* T. D. Noe, Jul 09 2013 *)
    CoefficientList[Series[-x (x^3 - x^2 + x + 1) / ((x - 1)^5  (x + 1)^2), {x, 0, 50}], x] (* Vincenzo Librandi, Aug 02 2013 *)
    LinearRecurrence[{3,-1,-5,5,1,-3,1},{0,1,4,10,22,41,72},50] (* Harvey P. Dale, May 11 2019 *)

Formula

a(n) = (n^4 + 2*n^3 + 8*n^2 - 8*n )/48; if n even.
a(n) = (n^4 + 2*n^3 + 8*n^2 - 2*n - 9)/48; if n odd.
G.f.: -x^2*(x^3-x^2+x+1) / ((x-1)^5*(x+1)^2). - Colin Barker, Jul 12 2013

A177342 a(n) = (4*n^3-3*n^2+5*n-3)/3.

Original entry on oeis.org

1, 9, 31, 75, 149, 261, 419, 631, 905, 1249, 1671, 2179, 2781, 3485, 4299, 5231, 6289, 7481, 8815, 10299, 11941, 13749, 15731, 17895, 20249, 22801, 25559, 28531, 31725, 35149, 38811, 42719, 46881, 51305, 55999, 60971, 66229, 71781, 77635
Offset: 1

Views

Author

Bruno Berselli, May 06 2010 - Nov 27 2010

Keywords

Comments

This sequence is related to the fourth powers (A000583) by n^4 = n*a(n) - Sum_{i=1..n-1} a(i) - (n-1), with n>1.
Also, n*a(n) - Sum_{i=1..n-1} a(i) provides the first column of A162624 and the second column of A162622 (or A162623). - Bruno Berselli, revised Dec 14 2012

Crossrefs

First differences: 2*A084849.
Partial sums: A178073.

Programs

  • Magma
    [(4*n^3-3*n^2+5*n-3)/3: n in [1..39]]; // Bruno Berselli, Aug 24 2011
    
  • Magma
    I:=[1,9,31,75]; [n le 4 select I[n] else 4*Self(n-1)-6*Self(n-2)+4*Self(n-3)-Self(n-4): n in [1..50]]; // Vincenzo Librandi, Aug 19 2013
  • Mathematica
    CoefficientList[Series[(1 + 5 x + x^2 + x^3) / (1 - x)^4, {x, 0, 50}], x] (* Vincenzo Librandi, Aug 19 2013 *)
    Table[(4 n^3 - 3 n^2 + 5 n - 3)/3, {n, 1, 40}] (* Bruno Berselli, Feb 17 2015 *)
    LinearRecurrence[{4,-6,4,-1},{1,9,31,75},40] (* Harvey P. Dale, Jul 31 2021 *)
  • PARI
    a(n)=(4*n^3-3*n^2+5*n-3)/3 \\ Charles R Greathouse IV, Jun 23 2011
    

Formula

G.f.: x*(1 + 5*x + x^2 + x^3)/(1 - x)^4.
a(n) = 4*a(n-1) - 6*a(n-2) + 4*a(n-3) - a(n-4).
a(n) - a(-n) = 2*A004006(2n).
a(n) + a(-n) = -A002522(n).
a(n) = 1 + (n-1)*(4*n^2+n+6)/3 = 2*A174723(n)-1.

Extensions

Formulae added and revised by Bruno Berselli, Feb 17 2015
Showing 1-2 of 2 results.