OFFSET
1,2
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..10000
Index entries for linear recurrences with constant coefficients, signature (2,-2,2,-2,2,-2,2,-2,2,-1).
FORMULA
a(n) = n-3 + b(n) where b(n) is the period-10 sequence (3, 5, 7, 4, 1, 3, 0, 2, 4, 1)
G.f.: x*(1+2*x+x^2-3*x^3+x^4-4*x^6+7*x^7-4*x^8+2*x^5+2*x^9)/ ((x^4+x^3+x^2+x+1) * ( x^4-x^3+x^2-x+1) * (x-1)^2). - Maksym Voznyy (voznyy(AT)mail.ru), Jul 27 2009
MAPLE
seq(coeff(series(x*(1+2*x+x^2-3*x^3+x^4-4*x^6+7*x^7-4*x^8+2*x^5+2*x^9)/( (1+x^2+x^4 +x^6+x^8)*(1-x)^2), x, n+1), x, n), n = 1 .. 80); # G. C. Greubel, Aug 07 2019
MATHEMATICA
LinearRecurrence[{2, -2, 2, -2, 2, -2, 2, -2, 2, -1}, {1, 4, 7, 5, 3, 6, 4, 7, 10, 8}, 80] (* G. C. Greubel, Aug 07 2019 *)
PROG
(PARI) p(x) = 1+2*x+x^2-3*x^3+x^4-4*x^6+7*x^7-4*x^8+2*x^5+2*x^9;
my(x='x+O('x^80)); Vec(x*p(x)/((1+x^2+x^4+x^6+x^8)*(1-x)^2)) \\ G. C. Greubel, Aug 07 2019
(Magma) R<x>:=PowerSeriesRing(Integers(), 80); Coefficients(R!( x*(1+2*x+x^2-3*x^3+x^4-4*x^6+7*x^7-4*x^8+2*x^5+2*x^9)/((1+x^2+x^4 +x^6+x^8)*(1-x)^2) )); // G. C. Greubel, Aug 07 2019
(Sage)
def p(x): return 1+2*x+x^2-3*x^3+x^4-4*x^6+7*x^7-4*x^8+2*x^5+2*x^9
def A079356_list(prec):
P.<x> = PowerSeriesRing(ZZ, prec)
return P(x*p(x)/((1+x^2+x^4+x^6+x^8)*(1-x)^2)).list()
a=A079356_list(80); a[1:] # G. C. Greubel, Aug 07 2019
(GAP) a:=[1, 4, 7, 5, 3, 6, 4, 7, 10, 8];; for n in [11..80] do a[n]:=2*(a[n-1]-a[n-2]+a[n-3]-a[n-4]+a[n-5]-a[n-6]+a[n-7]-a[n-8]+a[n-9])-a[n-10]; od; a; # G. C. Greubel, Aug 07 2019
CROSSREFS
KEYWORD
nonn
AUTHOR
Benoit Cloitre, Feb 14 2003
EXTENSIONS
G.f. proposed by Maksym Voznyy checked and corrected by R. J. Mathar, Sep 16 2009.
STATUS
approved