login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 


A079356
a(1)=1; a(n) = a(n-1) - 2 if n is already in the sequence, a(n) = a(n-1) + 3 otherwise.
1
1, 4, 7, 5, 3, 6, 4, 7, 10, 8, 11, 14, 17, 15, 13, 16, 14, 17, 20, 18, 21, 24, 27, 25, 23, 26, 24, 27, 30, 28, 31, 34, 37, 35, 33, 36, 34, 37, 40, 38, 41, 44, 47, 45, 43, 46, 44, 47, 50, 48, 51, 54, 57, 55, 53, 56, 54, 57, 60, 58, 61, 64, 67, 65, 63, 66, 64, 67, 70, 68, 71, 74
OFFSET
1,2
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
Sequence in context: A175348 A335590 A329363 * A146539 A360060 A322580
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

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified September 23 12:13 EDT 2024. Contains 376164 sequences. (Running on oeis4.)