A256189 a(n) = n if n <= 3, otherwise a(n) is the smallest number not occurring earlier such that gcd(a(n-2), a(n)) is a prime and gcd(a(n-1), a(n)) = 1.
1, 2, 3, 4, 9, 10, 21, 5, 6, 25, 8, 15, 14, 27, 7, 12, 35, 22, 45, 11, 20, 33, 26, 51, 13, 17, 39, 34, 57, 16, 19, 18, 95, 28, 55, 38, 65, 24, 85, 46, 75, 23, 36, 115, 58, 69, 29, 30, 203, 32, 49, 50, 63, 44, 87, 62, 81, 31, 42, 155, 52, 93, 70, 99, 64, 77, 54
Offset: 1
Keywords
Links
- Peter J. C. Moses, Table of n, a(n) for n = 1..1000
- 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.
Programs
-
Mathematica
a[1]=1; a[2]=2; a[3]=3; A256189 = {1, 2, 3}; a[n_] := a[n] = For[k=4, True, k++, If[FreeQ[A256189, k], If[PrimeQ[GCD[ a[n-2], k]] && GCD[a[n-1], k] == 1, AppendTo[A256189, k]; Return[k]]]]; A256189 = Array[a, 100] (* Jean-François Alcover, Aug 02 2018 *)
Extensions
More terms from Peter J. C. Moses, Mar 24 2015
Comments