OFFSET
3,1
COMMENTS
LINKS
Paolo Xausa, Table of n, a(n) for n = 3..10000
Wikipedia, Completing the square.
Index entries for linear recurrences with constant coefficients, signature (0,0,0,2,0,0,0,-1).
FORMULA
a(n) = 8*(n-2)/gcd(n,4)^2. - Andrew Howroyd, Nov 10 2024
From Stefano Spezia, Nov 13 2024: (Start)
G.f.: x^3*(8 + x + 24*x^2 + 8*x^3 + 24*x^4 + x^5 + 8*x^6)/(1 - x^4)^2.
E.g.f.: (4 + 32*x + 6*cos(x) + 2*(16*x - 5)*cosh(x) + 3*x*sin(x) + (5*x - 64)*sinh(x))/4. (End)
EXAMPLE
For n=7, the heptagonal numbers are h(x) = x*(5*x-3)/2 and with multiplier a(7) = 40 and offset A181318(7-4) = 9 become 40*h(x)+9 = (10*x - 3)^2.
MATHEMATICA
Table[8*(n - 2)/GCD[n, 4]^2, {n, 3, 100}] (* Paolo Xausa, Dec 07 2024 *)
PROG
(PARI) a(n) = 8*(n-2)/gcd(n, 4)^2 \\ Andrew Howroyd, Nov 10 2024
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Jonathan Dushoff, Nov 09 2024
STATUS
approved