login
A Zumkeller-type sequence (cf. A098550): a(n) = n if n <= 3, otherwise the smallest number not occurring earlier having at least one common factor with a(n-2)+a(n-1), but none with a(n-1).
8

%I #30 Jul 31 2018 03:32:09

%S 1,2,3,5,4,9,13,6,19,10,29,12,41,53,8,61,15,14,87,101,16,21,37,18,11,

%T 58,23,24,47,71,20,7,27,17,22,39,122,35,157,26,33,59,28,45,73,30,103,

%U 38,51,89,25,32,57,178,55,233,34,63,97,36,49,40,267,307,42

%N A Zumkeller-type sequence (cf. A098550): a(n) = n if n <= 3, otherwise the smallest number not occurring earlier having at least one common factor with a(n-2)+a(n-1), but none with a(n-1).

%C Conjectured to be a permutation of the positive integers.

%C See also A255972 for this conjecture. - _Reinhard Zumkeller_, Mar 12 2015

%H Peter J. C. Moses, <a href="/A251604/b251604.txt">Table of n, a(n) for n = 1..5000</a>

%H David L. Applegate, Hans Havermann, Bob Selcoe, Vladimir Shevelev, N. J. A. Sloane, and Reinhard Zumkeller, <a href="http://arxiv.org/abs/1501.01669">The Yellowstone Permutation</a>, arXiv preprint arXiv:1501.01669 [math.NT], 2015 and <a href="https://cs.uwaterloo.ca/journals/JIS/VOL18/Sloane/sloane9.html">J. Int. Seq. 18 (2015) 15.6.7</a>.

%t a[n_] := a[n] = If[n <= 3, n, For[k = 1, True, k++, If[FreeQ[Array[a, n-1], k], If[!CoprimeQ[k, a[n-2]+a[n-1]] && CoprimeQ[k, a[n-1]], Return[k]]]]];

%t Array[a, 65] (* _Jean-François Alcover_, Jul 31 2018 *)

%o (Haskell)

%o import Data.List (delete)

%o a251604 n = a251604_list !! (n-1)

%o a251604_list = 1 : 2 : 3 : f 2 3 [4..] where

%o f u v ws = g ws where

%o g (x:xs) = if gcd x (u + v) > 1 && gcd x v == 1

%o then x : f v x (delete x ws) else g xs

%o -- _Reinhard Zumkeller_, Mar 12 2015

%Y Cf. A098550.

%Y Cf. A255972.

%K nonn

%O 1,2

%A _Vladimir Shevelev_, Dec 13 2014

%E More terms from _Peter J. C. Moses_, Dec 13 2014