OFFSET
1,2
COMMENTS
Is this a permutation of the natural numbers?
There are only two fixed points: 1 and 2.
LINKS
Paul Tek, Table of n, a(n) for n = 1..10000
Paul Tek, C program for this sequence
Illustrations of the first 200 points at positions (n, a(n)) (black pixels correspond to these points, colored pixels (x,y) are aligned with two black pixels (i,a(i)) and (j,a(j))):
(1) x < i < j,
(2) i < x < j,
(3) i < j < x.
MATHEMATICA
WIDTH = 1000;
HEIGHT = 2000;
Clear[seen, aligned, a];
compute[n_] := Module[{c = 1}, While[seen[c] || aligned[n][c], c++; If[c > HEIGHT, Abort[]]]; a[n] = c; seen[a[n]] = True; For[i = 1, i < n, i++, dn = n - i; da = a[n] - a[i]; g = GCD[dn, da]; dn /= g; da /= g; nn = n; na = c; While[True, nn += dn; If[nn > WIDTH, Break[]]; na += da; If[na < 1 || na > HEIGHT, Break[]]; aligned[nn][na] = True]]; a[n]];
Array[compute, WIDTH] (* Jean-François Alcover, Apr 19 2020, translated from Paul Tek's program. *)
PROG
(C) See Link section.
CROSSREFS
KEYWORD
nonn
AUTHOR
Paul Tek, Nov 07 2013
STATUS
approved