This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A167380 #16 Dec 12 2023 07:44:48 %S A167380 1,2,4,5,1,-4,-5,-1,4,5,1,-4,-5,-1,4,5,1,-4,-5,-1,4,5,1,-4,-5,-1,4,5, %T A167380 1,-4,-5,-1,4,5,1,-4,-5,-1,4,5,1,-4,-5,-1,4,5,1,-4,-5,-1,4,5,1,-4,-5, %U A167380 -1,4,5,1,-4,-5,-1,4,5,1,-4,-5,-1,4,5,1,-4,-5,-1,4,5,1,-4,-5,-1,4,5,1,-4,-5 %N A167380 a(1)=1, a(2)=2, and continued periodically with 4, 5, 1, -4, -5, -1 . %H A167380 <a href="/index/Rec#order_02">Index entries for linear recurrences with constant coefficients</a>, signature (1,-1). %F A167380 a(1)=1. a(2)=2. a(6k-3)=4. a(6k-2)=5. a(6k-1)=1. a(6k)=-4. a(6k+1)=-5. a(6k+2)=-1. %F A167380 From _R. J. Mathar_, Nov 03 2009: (Start) %F A167380 a(n) = a(n-1) - a(n-2), n > 4. %F A167380 G.f.: x*(1+x)*(3*x^2+1)/(1-x+x^2). (End) %p A167380 A167380 := proc(n) if n <= 2 then n; else op(1+ (n mod 6),[-4,-5,-1,4,5,1]) ; end if; end proc: seq(A167380(n),n=1..120) ; # _R. J. Mathar_, Nov 02 2009 %t A167380 PadRight[{1,2},120,{-5,-1,4,5,1,-4}] (* or *) Join[{1,2},LinearRecurrence[ {1,-1},{4,5},120]] (* _Harvey P. Dale_, Mar 08 2015 *) %K A167380 sign,easy %O A167380 1,2 %A A167380 _Jamel Ghanouchi_, Nov 02 2009 %E A167380 Unrelated material removed, and values corrected according to definition, by _R. J. Mathar_, Nov 05 2009