A247225 a(n) = n if n <= 3, a(4)=5, otherwise the smallest number not occurring earlier having at least one common factor with a(n-3), but none with a(n-1)*a(n-2).
1, 2, 3, 5, 4, 9, 25, 8, 21, 55, 16, 7, 11, 6, 35, 121, 12, 49, 143, 10, 63, 13, 20, 27, 91, 22, 15, 119, 26, 33, 17, 14, 39, 85, 28, 57, 65, 32, 19, 45, 34, 133, 69, 40, 77, 23, 18, 175, 253, 24, 95, 161, 36, 125, 203, 38, 75, 29, 44, 51, 145, 46, 81, 155, 52
Offset: 1
Keywords
Links
- Peter J. C. Moses, Table of n, a(n) for n = 1..2000
- David L. Applegate, Hans Havermann, Bob Selcoe, Vladimir Shevelev, N. J. A. Sloane, and Reinhard Zumkeller, The Yellowstone Permutation, arXiv preprint arXiv:1501.01669, 2015.
Programs
-
Mathematica
a[n_ /; n <= 3] := n; a[4]=5; a[n_] := a[n] = For[aa = Table[a[j], {j, 1, n-1}]; k=4, True, k++, If[FreeQ[aa, k] && !CoprimeQ[k, a[n-3]] && CoprimeQ[k, a[n-1]*a[n-2]], Return[k]]]; Table[ a[n], {n, 1, 65}] (* Jean-François Alcover, Jan 12 2015 *)
Extensions
More terms from Peter J. C. Moses, Jan 12 2015
Comments