OFFSET
0,2
COMMENTS
Sequence found by reading the line from 0, in the direction 0, 6, ..., in the square spiral whose vertices are the generalized octagonal numbers A001082. - Omar E. Pol, Sep 18 2011
a(n) is the number of walks on a cubic lattice of n dimensions that return to the origin, not necessarily for the first time, after 4 steps. - Shel Kaphan, Mar 20 2023
LINKS
Ivan Panchenko, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (3,-3,1).
FORMULA
a(n) = a(n-1) + 24*n - 18 (with a(0)=0). - Vincenzo Librandi, Nov 26 2010
From G. C. Greubel, Sep 01 2018: (Start)
G.f.: 6*x*(1+3*x)/(1-x)^3.
E.g.f.: 6*x*(1+2*x)*exp(x). (End)
From Amiram Eldar, Mar 30 2023: (Start)
Sum_{n>=1} 1/a(n) = log(2)/3.
Sum_{n>=1} (-1)^(n+1)/a(n) = Pi/12 - log(2)/6. (End)
MATHEMATICA
6*PolygonalNumber[6, Range[0, 40]] (* The program uses the PolygonalNumber function from Mathematica version 10 *) (* Harvey P. Dale, Mar 04 2016 *)
LinearRecurrence[{3, -3, 1}, {0, 6, 36}, 50] (* or *) Table[6*n*(2*n-1), {n, 0, 50}] (* G. C. Greubel, Sep 01 2018 *)
PROG
(PARI) a(n)=6*n*(2*n-1) \\ Charles R Greathouse IV, Jun 17 2017
(Magma) [6*n*(2*n-1): n in [0..50]]; // G. C. Greubel, Sep 01 2018
CROSSREFS
KEYWORD
easy,nonn,walk
AUTHOR
Omar E. Pol, Dec 12 2008
STATUS
approved