OFFSET
1,2
COMMENTS
The odd-indexed entries are the sums pertaining to the corresponding magic squares.
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (2,1,-4,1,2,-1).
FORMULA
a(2n-1) = 4n^3 - 6n^2 + 4n - 1, a(2n) = 4n^3 + 2n. a(n) = (n^3 + n)/2 if n odd, n^3/2 + n if n even. a(n) = n^3/2 + n(3 + (-1)^n)/4. - Franklin T. Adams-Watters, Jul 17 2006
G.f.: x*(x^2+1)*(x^2+4*x+1) / ( (1+x)^2*(x-1)^4 ). - R. J. Mathar, Mar 07 2011
E.g.f.: x*((2 + 3*x + x^2)*cosh(x) + (3 + 3*x + x^2)*sinh(x))/2. - Stefano Spezia, May 07 2021
a(n) = n*(n^2-A000035(n))/2 + n. - Chai Wah Wu, Aug 30 2022
MATHEMATICA
LinearRecurrence[{2, 1, -4, 1, 2, -1}, {1, 6, 15, 36, 65, 114}, 50] (* Harvey P. Dale, Jun 22 2016 *)
PROG
(PARI) a(n)=n^3/2 + n*(3+(-1)^n)/4 \\ Charles R Greathouse IV, Jun 11 2015
(Python)
def A074149(n): return (n*(n**2-(n&1))>>1)+n # Chai Wah Wu, Aug 30 2022
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Amarnath Murthy, Aug 28 2002
EXTENSIONS
More terms from Franklin T. Adams-Watters, Jul 17 2006
STATUS
approved