%I #11 Sep 08 2022 08:45:08
%S 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,
%T 24,27,30,28,31,34,37,35,33,36,34,37,40,38,41,44,47,45,43,46,44,47,50,
%U 48,51,54,57,55,53,56,54,57,60,58,61,64,67,65,63,66,64,67,70,68,71,74
%N a(1)=1; a(n) = a(n-1) - 2 if n is already in the sequence, a(n) = a(n-1) + 3 otherwise.
%H G. C. Greubel, <a href="/A079356/b079356.txt">Table of n, a(n) for n = 1..10000</a>
%H <a href="/index/Rec#order_10">Index entries for linear recurrences with constant coefficients</a>, signature (2,-2,2,-2,2,-2,2,-2,2,-1).
%F a(n) = n-3 + b(n) where b(n) is the period-10 sequence (3, 5, 7, 4, 1, 3, 0, 2, 4, 1)
%F 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
%p 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
%t 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 *)
%o (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;
%o 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
%o (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
%o (Sage)
%o 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
%o def A079356_list(prec):
%o P.<x> = PowerSeriesRing(ZZ, prec)
%o return P(x*p(x)/((1+x^2+x^4+x^6+x^8)*(1-x)^2)).list()
%o a=A079356_list(80); a[1:] # _G. C. Greubel_, Aug 07 2019
%o (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
%K nonn
%O 1,2
%A _Benoit Cloitre_, Feb 14 2003
%E G.f. proposed by Maksym Voznyy checked and corrected by _R. J. Mathar_, Sep 16 2009.