The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
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!)
A260316 n/3 if 3 divides n, else n-1. 2
0, 0, 1, 1, 3, 4, 2, 6, 7, 3, 9, 10, 4, 12, 13, 5, 15, 16, 6, 18, 19, 7, 21, 22, 8, 24, 25, 9, 27, 28, 10, 30, 31, 11, 33, 34, 12, 36, 37, 13, 39, 40, 14, 42, 43, 15, 45, 46, 16, 48, 49, 17, 51, 52, 18, 54, 55, 19, 57, 58, 20, 60, 61, 21, 63, 64, 22, 66, 67, 23 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,5
LINKS
FORMULA
a(3k) = k; a(3k + 1) = 3k; a(3k + 2) = 3k + 1.
a(n) = 2*a(n-3) - a(n-6) for n>5. - Colin Barker, Jul 23 2015
G.f.: x^2*(2*x^3+3*x^2+x+1) / ((x-1)^2*(x^2+x+1)^2). - Colin Barker, Jul 23 2015
EXAMPLE
a(5) = 5 - 1 = 4 because 5 is not divisible by 3.
a(12) = 12/3 = 4 because 12 is divisible by 3.
MATHEMATICA
Table[If[Mod[n, 3] == 0, n/3, n - 1], {n, 0, 69}] (* or *)
CoefficientList[Series[x^2*(2 x^3 + 3 x^2 + x + 1)/((x - 1)^2*(x^2 + x + 1)^2), {x, 0, 69}], x] (* Michael De Vlieger, Jul 23 2015 *)
LinearRecurrence[{0, 0, 2, 0, 0, -1}, {0, 0, 1, 1, 3, 4}, 80] (* Harvey P. Dale, May 20 2018 *)
PROG
(Ruby) def a(n); (n%3==0)?n/3:n-1 end
(PARI) concat([0, 0], Vec(x^2*(2*x^3+3*x^2+x+1) / ((x-1)^2*(x^2+x+1)^2) + O(x^100))) \\ Colin Barker, Jul 23 2015
CROSSREFS
A029578 is an analogous case where the divisor is 2 instead of 3.
Sequence in context: A213197 A049277 A214917 * A258742 A143052 A297104
KEYWORD
nonn,easy
AUTHOR
Peter Kagey, Jul 22 2015
STATUS
approved

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 13 07:22 EDT 2024. Contains 372498 sequences. (Running on oeis4.)