OFFSET
0,3
COMMENTS
Equivalently, numbers that are congruent to {0, 1, 2} mod 9.
Also numbers m such that floor(m/3) = 3*floor(m/9).
The n-th term is 3*n, 3*n-2 or 3*n-4.
For n > 0, numbers k such that 3 | floor(k/3). - Wesley Ivan Hurt, Dec 01 2020
LINKS
Bruno Berselli, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (1,0,1,-1).
FORMULA
G.f.: x*(1 + x + 7*x^2)/((1 - x)^2*(1 + x + x^2)).
a(n) = a(n-1) + a(n-3) - a(n-4).
a(n) = 3*n - 2*(n mod 3). In general, n + 3*h*floor(n/3) = (h+1)*n - h*(n mod 3).
a(n) + a(n+s) = a(2*n+s-1) + 1, where s is nonnegative and not divisible by 3. Example: for s=14, a(n) + a(n+14) = a(2*n+13) + 1; for n=3, a(3) + a(17) = a(19) + 1 = 9 + 47 = 55 + 1 = 56.
a(6*k+r) = 18*k + a(r), where 0 <= r <= 5.
MAPLE
MATHEMATICA
Table[n + 6 Floor[n/3], {n, 0, 70}]
LinearRecurrence[{1, 0, 1, -1}, {0, 1, 2, 9}, 90] (* Harvey P. Dale, Feb 25 2018 *)
PROG
(PARI) a(n)=n\3*6 + n \\ Charles R Greathouse IV, Feb 07 2017
(Python) [n+6*int(n/3) for n in range(70)]
(Sage) [n+6*floor(n/3) for n in range(70)]
(Maxima) makelist(n+6*floor(n/3), n, 0, 70);
(Magma) [n+6*(n div 3): n in [0..70]];
CROSSREFS
Cf. A002264.
The first differences are in A105395.
Cf. similar sequences with formula n+i*floor(n/3): A004773 (i=1), A047217 (i=2), A047240 (i=3), A047354 (i=4), A047469 (i=5), this sequence (i=6).
Cf. numbers that are congruent to {0, 1, 2} mod j: the sequences are listed in the previous row for j = 4..9, respectively.
KEYWORD
nonn,easy
AUTHOR
Bruno Berselli, Feb 06 2017
STATUS
approved