OFFSET
0,1
COMMENTS
The sequence s(n) is a generalized Somos-4 sequence. Also, s(n) is a Laurent polynomial in the variables s(1), s(2), s(3), s(4) with only powers of s(1), s(2) appearing in the denominator.
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..5000
FORMULA
a(n) = a(n+16) - n - 8 = a(-n) for all n in Z.
G.f.: (-2 + 4*x - 3*x^2 + 2*x^3 - x^4 + x^6 - 2*x^7 + 3*x^8 - 3*x^9 + 3*x^10 - 2*x^11 + x^12 - x^14 + 2*x^15 - x^16) / ((1 - x)^2 * (1 - x^16)).
EXAMPLE
G.f. = -2 - x^2 + x^6 + 2*x^8 + x^9 + 3*x^10 + 3*x^11 + 4*x^12 + 5*x^13 + ...
Let s(1) = s1, s(2) = s2, s(3) = s3, s(4) = s4. Then s(5) = (s4*s2^3 -s3^3*s1) / s1^3 gives a(5) = 0, s(6) = s3*(s4*s2^5 -s4^2*s1^4 -s1*s2^2*s3^3) / (s2*s1^5) gives a(6) = 1, s(7) = (-s4^3*s1^3*s2 +s4*s2^3*s3^3 -s1*s3^6) / s1^6 gives a(7) = 0.
MATHEMATICA
a[ n_] := (n^2 - {1, 6, 3, 4, 5, 2, 7, 0, 7, 2, 5, 4, 3, 6, 1, 8}[[Mod[n, 16, 1]]]^2 ) / 32;
PROG
(PARI) {a(n) = (n^2 - [8, 1, 6, 3, 4, 5, 2, 7, 0, 7, 2, 5, 4, 3, 6, 1][n%16+1]^2) / 32};
(PARI) {a(n) = my(m=abs(n)); polcoeff( (-2 + 4*x - 3*x^2 + 2*x^3 - x^4 + x^6 - 2*x^7 + 3*x^8 - 3*x^9 + 3*x^10 - 2*x^11 + x^12 - x^14 + 2*x^15 - x^16) / ((1 - x)^2 * (1 - x^16)) + x * O(x^m), m)};
(Magma) m:=60; R<x>:=PowerSeriesRing(Integers(), m); Coefficients(R!((-2 +4*x-3*x^2+2*x^3-x^4+x^6-2*x^7+3*x^8-3*x^9+3*x^10-2*x^11+x^12-x^14 + 2*x^15-x^16)/((1-x)^2*(1-x^16)))); // G. C. Greubel, Jul 29 2018
CROSSREFS
KEYWORD
sign,easy
AUTHOR
Michael Somos, Apr 23 2017
STATUS
approved