OFFSET
0,2
COMMENTS
First differences of A027444. - J. M. Bergot, Jun 04 2012
Numbers of the form ((h^2+h+1)^2+(-h^2+h+1)^2+(h^2+h-1)^2)/(h^2-h+1) for h=n-1. - Bruno Berselli, Mar 13 2013
For n > 0: 2*a(n) = A058331(n) + A001105(n) + A001844(n-1) = A251599(3*n-2) + A251599(3*n-1) + A251599(3*n). - Reinhard Zumkeller, Dec 13 2014
For all n >= 6, a(n+1) expressed in base n is "353". - Mathew Englander, Jan 06 2021
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 0..10000
Henry Bottomley, Spokes of a hexagonal spiral (illustration of initial terms).
G. Nebe and N. J. A. Sloane, Home page for hexagonal (or triangular) lattice A2.
Index entries for linear recurrences with constant coefficients, signature (3,-3,1).
FORMULA
a(n) = 3*n^2 - n + 1.
a(n) = a(n-1) + 6*n - 4 = 2*a(n-1) - a(n-2) + 6.
a(n) = 3*a(n-1) - 3*a(n-2) + a(n-3).
E.g.f.: (1+2*x+3*x^2)*exp(x). - Paul Barry, Mar 13 2003
a(n) = A096777(3*n) for n>0. - Reinhard Zumkeller, Dec 29 2007
G.f.: (1+5*x^2)/(1-3*x+3*x^2-x^3). - Colin Barker, Jan 04 2012
a(-n) = A056108(n). - Bruno Berselli, Mar 13 2013
MATHEMATICA
Table[3*n^2 - n + 1, {n, 0, 50}] (* G. C. Greubel, Jul 19 2017 *)
PROG
(Magma) I:=[1, 3]; [n le 2 select I[n] else 2*Self(n-1)-Self(n-2)+6: n in [1..50]]; // Vincenzo Librandi, Nov 14 2011
(PARI) a(n) = 3*n^2-n+1;
(Haskell)
a056106 n = n * (3 * n - 1) + 1 -- Reinhard Zumkeller, Dec 13 2014
CROSSREFS
Other spirals: A054552.
KEYWORD
nonn,easy
AUTHOR
Henry Bottomley, Jun 09 2000
STATUS
approved