OFFSET
1,2
COMMENTS
a(k)^m is a term iff {a(k) is odd and m is a nonnegative integer} or {m is in A004273}. - Jerzy R Borysowicz, May 08 2023
LINKS
David Lovler, Table of n, a(n) for n = 1..10000
Index entries for linear recurrences with constant coefficients, signature (1,0,1,-1).
FORMULA
From Johannes W. Meijer, Jun 07 2011: (Start)
a(n) = ceiling(n/3) + ceiling((n-1)/3) + ceiling((n-2)/3) + 3*ceiling((n-3)/3).
G.f.: x*(1+x+x^2+3*x^3)/((x-1)^2*(x^2+x+1)). (End)
a(n) = 3*floor((n-1)/3) + n. - Gary Detlefs, Dec 22 2011
From Wesley Ivan Hurt, Apr 13 2015: (Start)
a(n) = a(n-1) + a(n-3) - a(n-4) for n>4.
a(n) = 2*n-3 + ((2*n-3) mod 3). (End)
From Wesley Ivan Hurt, Jun 13 2016: (Start)
a(n) = 2*n - 2 - cos(2*n*Pi/3) + sin(2*n*Pi/3)/sqrt(3).
a(3k) = 6k-3, a(3k-1) = 6k-4, a(3k-2) = 6k-5. (End)
Sum_{n>=1} (-1)^(n+1)/a(n) = (9-2*sqrt(3))*Pi/36 + log(2+sqrt(3))/(2*sqrt(3)) - log(2)/6. - Amiram Eldar, Dec 14 2021
MAPLE
MATHEMATICA
Select[Range[0, 200], Mod[#, 6] == 1 || Mod[#, 6] == 2 || Mod[#, 6] == 3 &] (* Vladimir Joseph Stephan Orlovsky, Jul 07 2011 *)
Flatten[Table[{6n + 1, 6n + 2, 6n + 3}, {n, 0, 19}]] (* Alonso del Arte, Jul 07 2011 *)
Select[Range[0, 200], MemberQ[{1, 2, 3}, Mod[#, 6]] &] (* Vincenzo Librandi, Apr 14 2015 *)
PROG
(Magma) [2*n-3+((2*n-3) mod 3) : n in [1..100]]; // Wesley Ivan Hurt, Apr 13 2015
(PARI) a(n) = 3*floor((n-1)/3) + n; \\ David Lovler, Aug 03 2022
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
STATUS
approved