OFFSET
0,2
COMMENTS
From Klaus Brockhaus, May 31 2010: (Start)
Periodic sequence: Repeat 1, 3, 3, 1.
Continued fraction expansion of (7 + 5*sqrt(29))/26.
Decimal expansion of 121/909.
a(n) = A165207(n+1) - 1.
First differences of A047538.
Binomial transform of A084102. (End)
From Wolfdieter Lang, Feb 09 2012: (Start)
For general Modd n (not to be confused with mod n) see a comment on A203571. The nonnegative members of the five residue classes Modd 5, called [m] for m=0,1,...,4, are shown in the array A090298 if there the last row is taken as class [0] after inclusion of 0.
(End)
LINKS
Guenther Schrack, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (1, -1, 1).
FORMULA
a(n) = binomial(3, n mod 4). - Paul Barry, May 25 2003
From Klaus Brockhaus, May 31 2010: (Start)
a(n) = a(n-4) for n > 3; a(0) = a(3) = 1, a(1) = a(2) = 3.
a(n) = (4 - (1+i)*i^n - (1-i)*(-i)^n)/2 where i = sqrt(-1). (End)
E.g.f.: 2*exp(x) + sin(x) - cos(x). - Arkadiusz Wesolowski, Nov 04 2017
a(n) = 2 - (-1)^(n*(n+1)/2). - Guenther Schrack, Feb 26 2019
EXAMPLE
From Wolfdieter Lang, Feb 09 2012: (Start)
Modd 5 of nonnegative odd numbers restricted mod 5:
A045572: 1, 3, 7, 9, 11, 13, 17, 19, 21, 23, ...
Modd 5: 1, 3, 3, 1, 1, 3, 3, 1, 1, 3, ...
(End)
MATHEMATICA
CoefficientList[Series[(1+x)^2/((1-x)(1+x^2)), {x, 0, 110}], x] (* or *) PadRight[{}, 110, {1, 3, 3, 1}] (* Harvey P. Dale, Nov 21 2012 *)
PROG
(PARI) x='x+O('x^100); Vec((1+x)^2/((1-x)*(1+x^2))) \\ Altug Alkan, Dec 24 2015
(Magma) R<x>:=PowerSeriesRing(Integers(), 100); Coefficients(R!( (1+x)^2/((1-x)*(1+x^2)) )); // G. C. Greubel, Feb 28 2019
(Sage) ((1+x)^2/((1-x)*(1+x^2))).series(x, 100).coefficients(x, sparse=False) # G. C. Greubel, Feb 28 2019
CROSSREFS
Cf. A084102.
Cf. A010684 (repeat 1, 3), A176040 (repeat 3, 1), A178593 (decimal expansion of (7+5*sqrt(29))/26), A143432 (expansion of (1+x^4)/((1-x)*(1+x^2))), A021913 (repeat 0, 0, 1, 1), A133872 (repeat 1, 1, 0, 0), A165207 (repeat 2, 2, 4, 4), A047538 (congruent to 0, 1, 4 or 7 mod 8), A084099 (expansion of (1+x)^2/(1+x^2)), A000749 (expansion of x^3/((1-x)^4-x^4)). - Klaus Brockhaus, May 31 2010
KEYWORD
easy,nonn
AUTHOR
Paul Barry, May 15 2003
STATUS
approved