A254077 a(n) = n if n <= 3, otherwise the smallest number not occurring earlier such that gcd(a(n),a(n-2)) > gcd(a(n),a(n-1)).
1, 2, 3, 4, 6, 8, 9, 10, 12, 5, 14, 15, 7, 18, 21, 16, 27, 20, 33, 24, 11, 26, 22, 13, 28, 39, 32, 30, 44, 25, 34, 35, 17, 40, 51, 36, 68, 42, 52, 45, 38, 48, 19, 46, 57, 23, 54, 69, 50, 63, 55, 49, 60, 56, 65, 58, 70, 29, 62, 87, 31, 66, 93, 64, 75, 72, 85, 74, 80, 37, 76, 111
Offset: 1
Keywords
Links
- Peter J. C. Moses and Ray Chandler, Table of n, a(n) for n = 1..10000 (first 1000 terms from Peter J. C. Moses)
- David L. Applegate, Hans Havermann, Bob Selcoe, Vladimir Shevelev, N. J. A. Sloane, and Reinhard Zumkeller, The Yellowstone Permutation, arXiv preprint arXiv:1501.01669 [math.NT], 2015.
- John P. Linderman, Table of n, a(n) for n = 1..1000000 (about 13MB)
- John P. Linderman, Table of n, a(n) for n = 1..12940331 (about 61MB)
- John P. Linderman, Go program [Revised Jun 29 2015]
- John P. Linderman, Notes on computation of first 5 billion terms
- John Mason, Some observations
- John Mason, Some proofs
- John Mason, Proof of theorem: If the sequence is infinite, it is a permutation of the positive integers
Crossrefs
Programs
-
Haskell
a254077 n = a254077_list !! (n-1) a254077_list = 1 : 2 : 3 : f 2 3 [4..] where f u v ws = g ws where g (x:xs) = if gcd x u > gcd x v then x : f v x (delete x ws) else g xs -- Reinhard Zumkeller, May 05 2015
-
Mathematica
f[n_] := Block[{s = Range@ n, j, k}, For[k = 4, k <= n, k++, j = 4; While[Nand[GCD[j, s[[k - 2]]] > GCD[j, s[[k - 1]]], !MemberQ[Take[s, k - 1], j]], j++]; s[[k]] = j]; s]; f@ 72 (* Michael De Vlieger, Apr 15 2015 *)
Extensions
More terms from Peter J. C. Moses, Jan 25 2015
Comments
gcd(mp,a(n-1)). As a(n) is the first to have p as a factor, p does not divide a(n-2) and a(n-1), and neither does q. Hence gcd(mp,a(n-2))=gcd(m,a(n-2)) and gcd(mp,a(n-1))= gcd(m,a(n-1)). Hence gcd(m,a(n-2)) > gcd(m,a(n-1)). Hence gcd(mq,a(n-2)) > gcd(mq,a(n-1)). Hence mq, < mp, would have satisfied the conditions of the sequence for a(n), which is a contradiction. Hence no such prime q exists. - John Mason, Apr 17 2015