OFFSET
1,3
COMMENTS
A quasipolynomial of order 12 and degree 2. - Charles R Greathouse IV, Jul 11 2024
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 1..10000
Wikipedia, Integer-valued polynomial
Kaleb Williams, Proof that 3*n^3 + 15*n is divisible 9 by induction
Index entries for linear recurrences with constant coefficients, signature (0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,-1).
FORMULA
From Stefano Spezia, Jul 10 2024: (Start)
G.f.: x*(1 + x + 9*x^2 + 4*x^3 + 5*x^4 + 9*x^5 + 7*x^6 + 8*x^7 + 27*x^8 + 5*x^9 + 11*x^10 + 36*x^11 + 11*x^12 + 5*x^13 + 27*x^14 + 8*x^15 + 7*x^16 + 9*x^17 + 5*x^18 + 4*x^19 + 9*x^20 + x^21 + x^22)/((1 - x)^2*(1 + x)^2*(1 + x^2)^2*(1 - x + x^2)^2*(1 + x + x^2)^2*(1 - x^2 + x^4)^2).
a(n) = n/2 if n is 2 or 10 mod 12; a(n) = 3n if n is 0, 3, or 9 mod 12; a(n) = 3n/2 if n = 6 mod 12; and a(n) = n otherwise (if n is 1, 4, 5, 7, 8, or 11 mod 12). In particular, n/2 <= a(n) <= 3n. - Charles R Greathouse IV, Jul 11 2024
EXAMPLE
For n=3, the sum of 3 consecutive cubes is S(x) = x^3 + (x+1)^3 + (x+2)^3 which has S(0) = 9 and thereafter remains a multiple of 9 since S(x) - S(x-1) = 9*(x^2 + x + 1), so that the GCD of all S(x) is a(3) = 9.
PROG
(PARI) f(n, x='x)=n*x^3 + (3/2*n^2 - 3/2*n)*x^2 + (n^3 - 3/2*n^2 + 1/2*n)*x + (1/4*n^4 - 1/2*n^3 + 1/4*n^2)
Polya(P)=my(x=variable(P), D=poldegree(P), f=D!, t=0); forstep(d=D, 0, -1, my(c=polcoef(P, d, x)*d!); P-=c*binomial(x, d); t=gcd(t, c); f/=max(d, 1)); t
a(n)=Polya(f(n)) \\ Charles R Greathouse IV, Jul 09 2024
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Kaleb Williams, Jul 09 2024
EXTENSIONS
a(41)-a(61) from Charles R Greathouse IV, Jul 09 2024
STATUS
approved