login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A147534
a(n) is congruent to (1,1,2) mod 3.
1
1, 1, 2, 4, 4, 5, 7, 7, 8, 10, 10, 11, 13, 13, 14, 16, 16, 17, 19, 19, 20, 22, 22, 23, 25, 25, 26, 28, 28, 29, 31, 31, 32, 34, 34, 35, 37, 37, 38, 40, 40, 41, 43, 43, 44, 46, 46, 47, 49, 49, 50, 52, 52, 53, 55, 55, 56, 58, 58, 59, 61, 61, 62, 64, 64, 65, 67, 67, 68, 70, 70, 71
OFFSET
1,3
FORMULA
a(n) = a(n-3)+3 = n-2/3-A131713(n)/3. G.f.: x*(1+x^2+x^3)/((1-x)^2*(1+x+x^2)). [R. J. Mathar, Nov 07 2008]
a(1)=1, a(2)=1, a(3)=2, a(4)=4, a(n)=a(n-1)+a(n-3)-a(n-4) for n>4. - Harvey P. Dale, Dec 09 2012
a(n) = (3*n - 2 - cos(2*n*Pi/3) + sqrt(3)*sin(2*n*Pi/3))/3. - Wesley Ivan Hurt, Jul 24 2016
a(n) = 1 + floor((n-1)/3) + floor(2*(n-1)/3). - Wesley Ivan Hurt, Jul 25 2016
a(n) = n - sign((n-1) mod 3). - Wesley Ivan Hurt, Sep 25 2017
MAPLE
a:=n->add(chrem( [n, j], [1, 3] ), j=1..n): seq(a(n)+1, n=-1..70); # Zerinvary Lajos, Apr 08 2009
MATHEMATICA
LinearRecurrence[{1, 0, 1, -1}, {1, 1, 2, 4}, 80] (* Harvey P. Dale, Dec 09 2012 *)
PROG
(Magma) I:=[1, 1, 2]; [n le 3 select I[n] else Self(n-3)+3: n in [1..70]]; // Vincenzo Librandi, Jul 25 2016
CROSSREFS
Cf. A004396 for a(n) congruent to (0, 1, 1) mod 2.
Cf. A131713.
Sequence in context: A058679 A058568 A339769 * A118001 A182414 A256984
KEYWORD
easy,nonn
AUTHOR
Giovanni Teofilatto, Nov 06 2008
STATUS
approved