login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

a(n+2) = abs(a(n+1)) - a(n), a(0)=0, a(1)=1.
0

%I #15 Jan 01 2024 11:05:19

%S 0,1,1,0,-1,1,2,1,-1,0,1,1,0,-1,1,2,1,-1,0,1,1,0,-1,1,2,1,-1,0,1,1,0,

%T -1,1,2,1,-1,0,1,1,0,-1,1,2,1,-1,0,1,1,0,-1,1,2,1,-1,0,1,1,0,-1,1,2,1,

%U -1,0,1,1,0,-1,1,2,1,-1,0,1,1,0,-1,1,2,1,-1,0,1,1,0,-1,1,2,1,-1,0,1,1,0,-1,1,2,1,-1,0

%N a(n+2) = abs(a(n+1)) - a(n), a(0)=0, a(1)=1.

%H M. Brown and J. F. Slifker, <a href="http://www.jstor.org/stable/2322886">Solution to Problem 6439</a>, Amer. Math. Monthly, 92 (1985), p. 218.

%H M. Crampin, <a href="http://www.jstor.org/stable/3618372">Piecewise linear recurrence relations</a>, Math. Gaz., November 1992, p. 355.

%H <a href="/index/Rec#order_09">Index entries for linear recurrences with constant coefficients</a>, signature (0, 0, 0, 0, 0, 0, 0, 0, 1).

%F a(n) = a(n-9), with a(0)=0, a(1)=1, a(2)=1, a(3)=0, a(4)=-1, a(5)=1, a(6)=2, a(7)=1, a(8)=-1. - _Harvey P. Dale_, May 23 2014

%t RecurrenceTable[{a[0]==0,a[1]==1,a[n]==Abs[a[n-1]]-a[n-2]},a,{n,100}] (* or *) LinearRecurrence[{0,0,0,0,0,0,0,0,1},{0,1,1,0,-1,1,2,1,-1},100] (* or *) PadRight[{},100,{0,1,1,0,-1,1,2,1,-1}] (* _Harvey P. Dale_, May 23 2014 *)

%K sign,easy

%O 0,7

%A Antonio G. Astudillo (afg_astudillo(AT)hotmail.com), Nov 07 2002