cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A224317 a(n) = a(n-1) + 3 - a(n-1)!.

This page as a plain text file.
%I A224317 #25 Aug 05 2023 23:27:21
%S A224317 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,
%T A224317 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,
%U A224317 0,2,3,0,2,3,0,2,3,0,2,3,0,2
%N A224317 a(n) = a(n-1) + 3 - a(n-1)!.
%C A224317 a(0) is taken as 1. The sequence remains essentially the same for a(0)=0,1,2,3.
%C A224317 Even though each term is dependent on the previous term, the sequence is repetitive.
%H A224317 <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (0,0,1).
%F A224317 a(n) = a(n-1) + 3 - a(n-1)!.
%F A224317 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
%F A224317 a(n) = (floor((4*n - 1)/3) + signum(n - 1)) mod 4. - _Lechoslaw Ratajczak_, Jul 01 2023
%e A224317 For n=1, a(1) = a(1-1) + 3 - a(1-1)! = 1 + 3 - 1 = 3.
%e A224317 For n=2, a(2) = a(2-1) + 3 - a(2-1)! = 3 + 3 - 6 = 0.
%e A224317 For n=3, a(3) = a(3-1) + 3 - a(3-1)! = 0 + 3 - 1 = 2.
%t A224317 NestList[#+3-#!&,1,90] (* or *) PadRight[{1},90,{2,3,0}] (* _Harvey P. Dale_, Apr 23 2015 *)
%o A224317 (PARI) a(n)=if(n>1, [0, 2, 3][n%3+1], 1) \\ _Charles R Greathouse IV_, Apr 03 2013
%K A224317 nonn,easy
%O A224317 1,2
%A A224317 _Mihir Mathur_, Apr 03 2013