login
A072222
a(n) = (abs(n-1-a(n-2)) mod n) + (abs(n-1-a(n-1)) mod (n-1)), a(0) = 1, a(1) = 1.
1
1, 1, 0, 1, 5, 4, 1, 7, 6, 3, 9, 8, 5, 11, 10, 7, 13, 12, 9, 15, 14, 11, 17, 16, 13, 19, 18, 15, 21, 20, 17, 23, 22, 19, 25, 24, 21, 27, 26, 23, 29, 28, 25, 31, 30, 27, 33, 32, 29, 35, 34, 31, 37, 36, 33, 39, 38, 35, 41, 40, 37, 43, 42, 39, 45, 44, 41, 47, 46, 43, 49, 48, 45, 51
OFFSET
0,5
COMMENTS
Proof of the formula from Ralf Stephan: If a(n) is in a suitable range, it is possible to omit the abs and the mod function. So for n > 6, a(n) simplifies to a(n) = 2*n-2 - a(n-1) - a(n-2). Substituting a(n-1), we get a(n) = 2*n - 2 - (2*(n-1) - 2 - a(n-2) - a(n-3)) - a(n-2) = a(n-3) + 2. - Lambert Herrgesell (zero815(AT)googlemail.com), Jan 18 2007
LINKS
Clifford A. Pickover, The Crying of Fractal Batrachion, Chapter 19 in Chaos and Fractals, A Computer Graphical Journey, 1998, Pages 127-131
FORMULA
For n > 6, a(n) = a(n-3) + 2. - Ralf Stephan, May 09 2004
MATHEMATICA
f[n_] := f[n] = Mod[ Abs[n - 1 - f[n - 2]], n] + Mod[ Abs[n - 1 - f[n - 1]], n - 1]; f[0] = 1; f[1] = 1; Table[ f[n], {n, 0, 75}]
CROSSREFS
Sequence in context: A195297 A336284 A258639 * A197001 A374955 A308714
KEYWORD
nonn,easy
AUTHOR
Roger L. Bagula, Jul 04 2002
EXTENSIONS
Edited by Robert G. Wilson v, Jul 15 2002
STATUS
approved