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!)
A176076 Sequence defined by the recursion a(n)=(1+a(n-1-(n mod a(n-1)))-(-1)^n*a(n-1)) mod n, with a(1)=0. 3
0, 1, 2, 0, 1, 1, 3, 1, 5, 7, 0, 1, 2, 13, 1, 1, 3, 17, 2, 2, 5, 21, 4, 23, 3, 2, 5, 0, 1, 1, 3, 1, 5, 31, 0, 1, 2, 37, 1, 1, 3, 41, 2, 2, 5, 45, 4, 47, 3, 2, 5, 0, 1, 1, 3, 1, 5, 55, 0, 1, 2, 61, 1, 1, 3, 65, 2, 2, 5, 69, 4, 2, 7, 72, 0, 1, 2, 1, 4, 1, 6, 78, 80, 6, 2, 79, 84, 11, 3, 82, 70, 0, 1, 1, 3 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,3
COMMENTS
Erratic behavior with 0<=a(n)<n (see linked picture).
Similar sequence with a(1)=1.
REFERENCES
G. Balzarotti and P. P. Lava, 103 curiosità matematiche, Hoepli, 2010, p. 275.
LINKS
John A. Pelesko, Generalizing the Conway-Hofstadter $10,000 Sequence, Journal of Integer Sequences, Vol. 7 (2004), Article 04.3.5.
Klaus Pinn, A Chaotic Cousin Of Conway's Recursive Sequence, arXiv:cond-mat/9808031, 1998.
FORMULA
a(n) = (1+a(n-1-(n mod a(n-1)))-(-1)^n*a(n-1)) mod n, with a(1)=0.
EXAMPLE
a(1)=0.
a(2)=(1+a(1-(2 mod 1))) mod 2=(1+0) mod 2=1.
a(3)=(1+a(2-(3 mod (1+1)))+1) mod 3=(1+a(1)+1) mod 3=2 mod 3=2.
a(4)=(1+a(3-(4 mod (1+2)))-2) mod 4=(1+a(2)-2) mod 4=0.
MAPLE
P:=proc(i) local a, n; a:=array(1..50000); a[1]:=0; print(a[1]); for n from 2 by 1 to i do a[n]:=(1+a[n-1-(n mod (1+a[n-1]))]-(-1)^n*a[n-1]) mod n; print(a[n]); od; end: P(10000);
MATHEMATICA
a[1]=0; a[n_] := a[n] = Mod[-(-1)^n*a[n-1] + a[n-Mod[n, a[n-1]+1]-1]+1, n];
Array[a, 100] (* Jean-François Alcover, Dec 13 2017 *)
CROSSREFS
Sequence in context: A140129 A029347 A303427 * A058725 A068446 A253830
KEYWORD
nonn
AUTHOR
EXTENSIONS
Offset corrected by Arkadiusz Wesolowski, Jun 07 2011
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 April 23 06:58 EDT 2024. Contains 371906 sequences. (Running on oeis4.)