%I #58 Apr 19 2024 02:03:20
%S 1,2,3,4,3,2,1,2,3,4,3,2,1,2,3,4,3,2,1,2,3,4,3,2,1,2,3,4,3,2,1,2,3,4,
%T 3,2,1,2,3,4,3,2,1,2,3,4,3,2,1,2,3,4,3,2,1,2,3,4,3,2,1,2,3,4,3,2,1,2,
%U 3,4,3,2,1,2,3,4,3,2,1,2,3,4,3,2,1,2,3,4,3,2,1,2,3,4,3,2,1,2,3,4,3,2,1,2,3,4
%N Simple periodic sequence underlying clock sequence A028354.
%C From _Klaus Brockhaus_, May 15 2010: (Start)
%C Continued fraction expansion of (28+sqrt(2730))/56.
%C Decimal expansion of 1112/9009.
%C Partial sums of 1 followed by A130151.
%C First differences of A028357. (End)
%D Zdeněk Horský, "Pražský orloj" ("The Astronomical Clock of Prague", in Czech), Panorama, Prague, 1988, pp. 76-78.
%H Michal Křížek, Alena Šolcová and Lawrence Somer, <a href="https://dml.cz/handle/10338.dmlcz/119666">Construction of Šindel sequences</a>, Comment. Math. Univ. Carolin., 48 (2007), 373-388.
%H N. J. A. Sloane, <a href="http://neilsloane.com/doc/sg.txt">My favorite integer sequences</a>, in Sequences and their Applications (Proceedings of SETA '98).
%H <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (1,0,-1,1).
%F Sum of any six successive terms is 15.
%F G.f.: (1 + 2*x + 3*x^2 + 4*x^3 + 3*x^4 + 2*x^5)/(1 - x^6).
%F From _Wesley Ivan Hurt_, Jun 23 2016: (Start)
%F a(n) = a(n-1) - a(n-3) + a(n-4) for n>3.
%F a(n) = (15 - cos(n*Pi) - 8*cos(n*Pi/3))/6. (End)
%F E.g.f.: (15*exp(x) - exp(-x) - 8*cos(sqrt(3)*x/2)*(sinh(x/2) + cosh(x/2)))/6. - _Ilya Gutkovskiy_, Jun 23 2016
%F a(n) = abs(((n+3) mod 6)-3) + 1. - _Daniel Jiménez_, Jan 14 2023
%p A028356:=n->[1, 2, 3, 4, 3, 2][(n mod 6)+1]: seq(A028356(n), n=0..100); # _Wesley Ivan Hurt_, Jun 23 2016
%t CoefficientList[ Series[(1 + 2x + 3x^2 + 4x^3 + 3x^4 + 2x^5)/(1 - x^6), {x, 0, 85}], x]
%t LinearRecurrence[{1,0,-1,1},{1,2,3,4},120] (* or *) PadRight[{},120,{1,2,3,4,3,2}] (* _Harvey P. Dale_, Apr 15 2016 *)
%o (Magma) &cat [[1, 2, 3, 4, 3, 2]^^20]; // _Klaus Brockhaus_, May 15 2010
%o (Sage)
%o def A():
%o a, b, c, d = 1, 2, 3, 4
%o while True:
%o yield a
%o a, b, c, d = b, c, d, a + (d - b)
%o A028356 = A(); [next(A028356) for n in range(106)] # _Peter Luschny_, Jul 26 2014
%o (Python)
%o def A028356(n): return (1,2,3,4,3,2)[n%6] # _Chai Wah Wu_, Apr 18 2024
%Y Cf. A000034, A028354, A068073, A118382, A118383.
%Y Cf. A177924 (decimal expansion of (28+sqrt(2730))/56), A130151 (repeat 1, 1, 1, -1, -1, -1), A028357 (partial sums of A028356). - _Klaus Brockhaus_, May 15 2010
%K nonn,easy
%O 0,2
%A _N. J. A. Sloane_
%E Additional comments from _Robert G. Wilson v_, Mar 01 2002