The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A186731 a(3n) = 2n, a(3n+1) = n, a(3n+2) = n+1. 4

%I

%S 0,0,1,2,1,2,4,2,3,6,3,4,8,4,5,10,5,6,12,6,7,14,7,8,16,8,9,18,9,10,20,

%T 10,11,22,11,12,24,12,13,26,13,14,28,14,15,30,15,16,32,16,17,34,17,18,

%U 36,18,19,38,19,20,40,20,21,42,21,22,44,22,23,46,23,24,48

%N a(3n) = 2n, a(3n+1) = n, a(3n+2) = n+1.

%C Column k = 2 of triangle in A198295.

%H Robert Israel, <a href="/A186731/b186731.txt">Table of n, a(n) for n = 0..10000</a>

%H <a href="/index/Rec#order_06">Index entries for linear recurrences with constant coefficients</a>, signature (0,0,2,0,0,-1).

%F G.f.: (x*(1+x)/(1-x^3))^2.

%F a(n) = |A099254(n-2)| = |A099470(n-1)|. - _R. J. Mathar_, May 02 2013

%F From _Wesley Ivan Hurt_, Apr 28 2015: (Start)

%F a(n) = 2*a(n-3)-a(n-6).

%F a(n) = (n+1+n*0^mod(n,3)-mod(n+1,3))/3. (End)

%F E.g.f.: (4/9)*x*exp(x) - (x/9)*exp(-x/2)*cos(sqrt(3)*x/2) - (sqrt(3)/9)*(2+x)*exp(-x/2)*sin(sqrt(3)*x/2). - _Robert Israel_, Apr 01 2016

%p f:= gfun:-rectoproc({a(n)=2*a(n-3)-a(n-6), seq(a(i) = [0,0,1,2,1,2][i+1],i=0..5)},a(n),remember):

%p map(f, [\$0..100]); # _Robert Israel_, Apr 01 2016

%t CoefficientList[Series[(x*(1 + x)/(1 - x^3))^2, {x, 0, 100}], x] (* _Wesley Ivan Hurt_, Apr 28 2015 *)

%t LinearRecurrence[{0, 0, 2, 0, 0, -1}, {0, 0, 1, 2, 1, 2}, 100] (* _Vincenzo Librandi_, Apr 28 2015 *)

%o (MAGMA) I:=[0,0,1,2,1,2]; [n le 6 select I[n] else 2*Self(n-3)-Self(n-6): n in [1..80]]; // _Vincenzo Librandi_, Apr 28 2015

%o (PARI) vector(50,n,n--;(n+1+n*0^(n%3)-(n+1)%3)/3) \\ _Derek Orr_, Apr 28 2015

%Y Cf. A000027, A001477, A005843, A011655, A185395, A185292.

%K easy,nonn

%O 0,4

%A _Philippe DelĂ©ham_, Jan 21 2012

%E More terms from _Vincenzo Librandi_, Apr 28 2015

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

Last modified February 23 16:14 EST 2020. Contains 332173 sequences. (Running on oeis4.)