This site is supported by donations to The OEIS Foundation.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A224317 a(n) = a(n-1) + 3 - a(n-1)!. 0
 1, 3, 0, 2, 3, 0, 2, 3, 0, 2, 3, 0, 2, 3, 0, 2, 3, 0, 2, 3, 0, 2, 3, 0, 2, 3, 0, 2, 3, 0, 2, 3, 0, 2, 3, 0, 2, 3, 0, 2, 3, 0, 2, 3, 0, 2, 3, 0, 2, 3, 0, 2, 3, 0, 2, 3, 0, 2, 3, 0, 2, 3, 0, 2, 3, 0, 2, 3, 0, 2, 3, 0, 2, 3, 0, 2, 3, 0, 2, 3, 0, 2 (list; graph; refs; listen; history; text; internal format)
 OFFSET 1,2 COMMENTS a(0) is taken as 1. The sequence remains essentially the same for a(0)=0,1,2,3. Even though each term is dependent on the previous term, the sequence is repetitive. LINKS Index entries for linear recurrences with constant coefficients, signature (0,0,1). FORMULA a(n) = a(n-1)+3-(a(n-1))!. For n > 1, a(n) = (5+4*cos(2*(n+1)*Pi/3)-2*sqrt(3)*sin(2*(n+1)*Pi/3))/3. - Wesley Ivan Hurt, Sep 27 2017 EXAMPLE For n=1, a(1)=a(1-1)+3-(a(1-1))!=1+3-1=3. For n=2, a(2)=a(2-1)+3-(a(2-1))!=3+3-6=0. For n=3, a(3)=a(3-1)+3-(a(3-1))!=0+3-1=2. MATHEMATICA NestList[#+3-#!&, 1, 90] (* or *) PadRight[{1}, 90, {2, 3, 0}] (* Harvey P. Dale, Apr 23 2015 *) PROG (PARI) a(n)=if(n>1, [0, 2, 3][n%3+1], 1) \\ Charles R Greathouse IV, Apr 03 2013 CROSSREFS Sequence in context: A280238 A154574 A119493 * A032531 A301430 A143394 Adjacent sequences:  A224314 A224315 A224316 * A224318 A224319 A224320 KEYWORD nonn,easy AUTHOR Mihir Mathur, Apr 03 2013 STATUS approved

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

Last modified July 16 04:26 EDT 2019. Contains 325064 sequences. (Running on oeis4.)