OFFSET
0,2
COMMENTS
Squared distance from (0,0,-1) to (n,n,n) in R^3. - James R. Buddenhagen, Jun 15 2013
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 0..1000
Henry Bottomley, Illustration of initial terms
Tanya Khovanova, Recursive Sequences
G. Nebe and N. J. A. Sloane, Home page for hexagonal (or triangular) lattice A2
Leo Tavares, Triple Diamond Illustration
Index entries for linear recurrences with constant coefficients, signature (3,-3,1).
FORMULA
a(n) = 3n^2+2n+1 = a(n-1)+6n-1 = 2a(n-1)-a(n-2)+6 = 3a(n-1)-3a(n-2)+a(n-3) = A056105(n)+4n = A056106(n)+3n = A056107(n)+2n = A056108(n)+n = A003215(n)-n.
G.f.: (1+3*x+2*x^2)/(1-3*x+3*x^2-x^3). - Colin Barker, Jan 04 2012
G.f.: (1 + x) * (1 + 2*x) / (1 - x)^3. - Michael Somos, Feb 04 2012
E.g.f.: exp(x)*(1 + 5*x + 3*x^2). - Stefano Spezia, Oct 06 2018
MAPLE
seq(coeff(series(n!*(exp(x)*(3*x^2+5*x+1)), x, n+1), x, n), n = 0 .. 50); # Muniru A Asiru, Oct 07 2018
MATHEMATICA
Table[3 n^2 + 2 n + 1, {n, 0, 100}] (* Vincenzo Librandi, Mar 15 2013 *)
LinearRecurrence[{3, -3, 1}, {1, 6, 17}, 60] (* Harvey P. Dale, Mar 28 2019 *)
PROG
(PARI) {a(n) = 3*n^2 + 2*n + 1}; /* Michael Somos, Aug 03 2006 */
(PARI) Vec((1+3*x+2*x^2)/(1-3*x+3*x^2-x^3)+O(x^100)) \\ Stefano Spezia, Oct 17 2018
(Magma) [3*n^2 + 2*n + 1: n in [0..50]]; // Vincenzo Librandi, Mar 15 2013
(GAP) List([0..50], n->3*n^2+2*n+1); # Muniru A Asiru, Oct 07 2018
(Python) for n in range(0, 100): print(int(3*n**2 + 2*n + 1), end=', ') # Stefano Spezia, Oct 16 2018
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Henry Bottomley, Jun 09 2000
STATUS
approved