A056106 Second spoke of a hexagonal spiral.
1, 3, 11, 25, 45, 71, 103, 141, 185, 235, 291, 353, 421, 495, 575, 661, 753, 851, 955, 1065, 1181, 1303, 1431, 1565, 1705, 1851, 2003, 2161, 2325, 2495, 2671, 2853, 3041, 3235, 3435, 3641, 3853, 4071, 4295, 4525, 4761, 5003, 5251, 5505, 5765, 6031, 6303
Offset: 0
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).
Crossrefs
Programs
-
Haskell
a056106 n = n * (3 * n - 1) + 1 -- Reinhard Zumkeller, Dec 13 2014
-
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
-
Mathematica
Table[3*n^2 - n + 1, {n,0,50}] (* G. C. Greubel, Jul 19 2017 *)
-
PARI
a(n) = 3*n^2-n+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
Comments