OFFSET
1,2
COMMENTS
Conjecture: this sequence includes every integer greater than 1.
In the first 200000 terms the only fixed points are 2, 4, 16, 21, 95, 159, 723, 18071. - Scott R. Shannon, Oct 25 2024
LINKS
Scott R. Shannon, Table of n, a(n) for n = 1..10000
Scott R. Shannon, Image of the first 200000 terms for a(n) < 400000. The green line is a(n) = n.
EXAMPLE
a(12) must have a common factor with 12 and a(11) = 33. The first few such values are 3, 6 and 9; 3 and 6 have already been used, so a(12)=9.
MAPLE
A119018 := proc(nmin) local a, anxt ; a := [0] ; while nops(a) < nmin do anxt := 1 ; n := nops(a)+1 ; while anxt in a or gcd(n, anxt) = 1 or gcd(op(-1, a), anxt) = 1 do anxt := anxt+1 ; od ; a := [op(a), anxt]; od: RETURN(a) ; end: A119018(100) ; # R. J. Mathar, Sep 07 2007
MATHEMATICA
a = {0}; Do[k = 1; While[MemberQ[a, k] || GCD[k, n] == 1 || GCD[k, a[[-1]]] == 1, k++]; AppendTo[a, k], {n, 2, 71}]; a (* Ivan Neretin, Jul 09 2015 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Franklin T. Adams-Watters, May 08 2006
EXTENSIONS
Definition corrected by R. J. Mathar, Sep 07 2007
a(1) changed to a(1) = 1 by Scott R. Shannon, Oct 28 2024
STATUS
approved