|
| |
|
|
A084937
|
|
Smallest number which is coprime to the last two predecessors and not occurring earlier; a(1)=1, a(2)=2.
|
|
9
| |
|
|
1, 2, 3, 5, 4, 7, 9, 8, 11, 13, 6, 17, 19, 10, 21, 23, 16, 15, 29, 14, 25, 27, 22, 31, 35, 12, 37, 41, 18, 43, 47, 20, 33, 49, 26, 45, 53, 28, 39, 55, 32, 51, 59, 38, 61, 63, 34, 65, 57, 44, 67, 69, 40, 71, 73, 24, 77, 79, 30, 83, 89, 36, 85, 91, 46, 75, 97, 52, 81
(list; graph; refs; listen; history; internal format)
|
|
|
|
OFFSET
| 1,2
|
|
|
COMMENTS
| Permutation of natural numbers with inverse A084933: a(A084933(n))=A084933(a(n))=n;
primes occur in natural order;
it seems that there are no more fixed points than {1,2,3,8,33,39}.
a(n) mod 2 = A011655(n+1); ABS(a(n)-n) < n; a(3*n+1)>n; a(3*n+2)<n. - Reinhard Zumkeller (reinhard.zumkeller(AT)gmail.com), Dec 16 2007
|
|
|
LINKS
| R. Zumkeller, Table of n, a(n) for n = 1..10000
Index entries for sequences that are permutations of the natural numbers
|
|
|
MATHEMATICA
| lst={1, 2, 3}; unused=Range[4, 100]; While[n=Select[unused, CoprimeQ[#, lst[[-1]]] && CoprimeQ[#, lst[[-2]]] &, 1]; n != {}, AppendTo[lst, n[[1]]]; unused=DeleteCases[unused, n[[1]]]]; lst
f[s_] := Block[{k = 1, l = Take[s, -2]}, While[ Union[ GCD[k, l]] != {1} || MemberQ[s, k], k++]; Append[s, k]]; Nest[f, {1, 2}, 67] (* Robert G. Wilson v, June 26 2011 *)
|
|
|
PROG
| (Haskell)
import Data.List (delete)
a084937 n = a084937_list !! (n-1)
a084937_list = 1 : 2 : f 2 1 [3..] where
f x y zs = g zs where
g (u:us) | gcd y u > 1 || gcd x u > 1 = g us
| otherwise = u : f u x (delete u zs)
-- Reinhard Zumkeller, Jan 28 2012
|
|
|
CROSSREFS
| Cf. A103683.
Sequence in context: A127521 A102399 A118318 * A081994 A090252 A140140
Adjacent sequences: A084934 A084935 A084936 * A084938 A084939 A084940
|
|
|
KEYWORD
| nonn,nice
|
|
|
AUTHOR
| Reinhard Zumkeller (reinhard.zumkeller(AT)gmail.com), Jun 13 2003
|
| |
|
|