login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A061800 a(n) = n + (-1)^(n mod 3). 3

%I #21 Sep 08 2022 08:45:03

%S 1,0,3,4,3,6,7,6,9,10,9,12,13,12,15,16,15,18,19,18,21,22,21,24,25,24,

%T 27,28,27,30,31,30,33,34,33,36,37,36,39,40,39,42,43,42,45,46,45,48,49,

%U 48,51,52,51,54,55,54,57,58,57,60,61,60,63,64,63,66,67,66,69,70,69,72

%N a(n) = n + (-1)^(n mod 3).

%C The arithmetic function v_3(n,3) as defined in A289187. - _Robert Price_, Aug 22 2017

%H Harry J. Smith, <a href="/A061800/b061800.txt">Table of n, a(n) for n=0..1000</a>

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

%F O.g.f.: (1-x+3*x^2)/((-1+x)^2*(1+x+x^2)). - _R. J. Mathar_, Apr 02 2008

%F a(n) = (3*n + 1 - 4*cos(2*(n+2)*Pi/3))/3. - _Wesley Ivan Hurt_, Sep 26 2017

%F a(n) = a(n-1) + a(n-3) - a(n-4) for n > 3. - _Wesley Ivan Hurt_, Oct 07 2017

%e a(4) = 4 + (-1)^1 = 3.

%p A061800:=n->n+(-1)^(n mod 3): seq(A061800(n), n=0..150); # _Wesley Ivan Hurt_, Oct 07 2017

%t Table[n + (-1)^Mod[n, 3], {n, 0, 80}] (* _Vincenzo Librandi_, Aug 23 2017 *)

%o (PARI) { for (n=0, 1000, write("b061800.txt", n, " ", n + (-1)^(n%3)) ) } \\ _Harry J. Smith_, Jul 28 2009

%o (Magma) [n+(-1)^(n mod 3): n in [0..80]]; // _Vincenzo Librandi_, Aug 23 2017

%Y Cf. A004442, A014681, A289187.

%K easy,nonn

%O 0,3

%A _Olivier GĂ©rard_, Jun 22 2001

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 11 13:00 EDT 2024. Contains 372409 sequences. (Running on oeis4.)