# Greetings from The On-Line Encyclopedia of Integer Sequences! http://oeis.org/ Search: id:a131380 Showing 1-1 of 1 %I A131380 #22 Sep 22 2024 02:02:29 %S A131380 0,2,1,2,4,3,4,6,5,6,8,7,8,10,9,10,12,11,12,14,13,14,16,15,16,18,17, %T A131380 18,20,19,20,22,21,22,24,23,24,26,25,26,28,27,28,30,29,30,32,31,32,34, %U A131380 33,34,36,35,36,38,37,38,40,39,40,42,41,42,44,43,44,46,45,46,48,47,48,50 %N A131380 a(3n) = 2n, a(3n+1) = 2n+2, a(3n+2) = 2n+1. %H A131380 Vincenzo Librandi, Table of n, a(n) for n = 0..2000 %H A131380 Index entries for linear recurrences with constant coefficients, signature (1,0,1,-1). %F A131380 G.f.: x*(2-x+x^2)/((x-1)^2*(1+x+x^2)); a(n) = a(n-1)+a(n-3)-a(n-4); a(n) = (-n mod 3) + 2*floor(n/3) = A080425(n) + 2*A002264(n). - _Wesley Ivan Hurt_, Aug 20 2014 %F A131380 E.g.f.: ((2*z+1)/3)*exp(z)+((5/9)*sqrt(3)*sin(sqrt(3)*z/2)-(1/3)*cos(sqrt(3)*z/2))*exp(-z/2). - _Robert Israel_, Aug 21 2014 %F A131380 a(n) = (6*n+3-6*cos(2*(n+4)*Pi/3)-4*sqrt(3)*sin(2*(n+4)*Pi/3))/9. - _Wesley Ivan Hurt_, Sep 26 2017 %p A131380 A131380:=n->(-n mod 3) + 2*floor(n/3): seq(A131380(n), n=0..100); # _Wesley Ivan Hurt_, Aug 20 2014 %t A131380 Table[Mod[-n, 3] + 2 Floor[n/3], {n, 0, 100}] (* _Wesley Ivan Hurt_, Aug 20 2014 *) %t A131380 CoefficientList[Series[x*(2 - x + x^2)/((x - 1)^2 (1 + x + x^2)), {x, 0, 100}], x] (* _Wesley Ivan Hurt_, Aug 20 2014 *) %t A131380 LinearRecurrence[{1, 0, 1, -1}, {0, 2, 1, 2}, 200] (* _Vincenzo Librandi_, Sep 27 2017 *) %o A131380 (Magma) [(-n mod 3) + 2*Floor(n/3) : n in [0..100]]; // _Wesley Ivan Hurt_, Aug 20 2014 %o A131380 (Magma) I:=[0,2,1,2]; [n le 4 select I[n] else Self(n-1)+Self(n-3)-Self(n-4): n in [1..100]]; // _Vincenzo Librandi_, Sep 27 2017 %Y A131380 Cf. A002264, A080425. %K A131380 nonn,easy %O A131380 0,2 %A A131380 _Paul Curtz_, Oct 01 2007 # Content is available under The OEIS End-User License Agreement: http://oeis.org/LICENSE