The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A252865 a(n) = n if n <= 3, otherwise the smallest squarefree number not occurring earlier having at least one common factor with a(n-2), but none with a(n-1). 4
 1, 2, 3, 10, 21, 5, 6, 35, 22, 7, 11, 14, 33, 26, 15, 13, 30, 91, 34, 39, 17, 42, 85, 38, 51, 19, 66, 95, 46, 55, 23, 65, 69, 70, 57, 58, 93, 29, 31, 87, 62, 105, 74, 77, 37, 110, 111, 82, 129, 41, 43, 123, 86, 141, 106, 47, 53, 94, 159, 118, 165, 59, 78, 295 (list; graph; refs; listen; history; text; internal format)
 OFFSET 1,2 COMMENTS Similar to A098550, but the restriction to squarefree makes it more a sequence of sets of primes, represented by their product. The sequence has consecutive primes at indices 2 (2 & 3), 10 (7 & 11), 38 (29 & 31), 50 (41 & 43), and 56 (47 & 53). We conjecture that there are no further such pairs. LINKS Reinhard Zumkeller, Table of n, a(n) for n = 1..10000 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 and J. Int. Seq. 18 (2015) 15.6.7. MATHEMATICA a[n_ /; n <= 3] = n; a[n_] := a[n] = For[k = 1, True, k++, If[SquareFreeQ[k], If[FreeQ[Array[a, n-1], k], If[!CoprimeQ[k, a[n-2]] && CoprimeQ[k, a[n-1]], Return[k]]]]]; Array[a, 100] (* Jean-François Alcover, Sep 02 2018 *) PROG (PARI) invecn(v, k, x)=for(i=1, k, if(v[i]==x, return(i))); 0 alist(n)=local(v=vector(n, i, i), x); for(k=4, n, x=4; while(!issquarefree(x)||invecn(v, k-1, x)||gcd(v[k-2], x)==1||gcd(v[k-1], x)!=1, x++); v[k]=x); v (Haskell) import Data.List (delete) a252865 n = a252865_list !! (n-1) a252865_list = 1 : 2 : 3 : f 2 3 (drop 3 a005117_list) where    f u v ws = g ws where      g (x:xs) = if gcd x u > 1 && gcd x v == 1                    then x : f v x (delete x ws) else g xs -- Reinhard Zumkeller, Dec 24 2014 (Python) from fractions import gcd from sympy import factorint A252865_list, l1, l2, s, b = [1, 2, 3], 3, 2, 4, set() for _ in range(10**2): ....i = s ....while True: ........if max(factorint(i).values()) == 1: ............if not i in b and gcd(i, l1) == 1 and gcd(i, l2) > 1: ................A252865_list.append(i) ................l2, l1 = l1, i ................b.add(i) ................while s in b: ....................b.remove(s) ....................s += 1 ................break ........else: ............b.add(i) ........i += 1 # Chai Wah Wu, Dec 24 2014 CROSSREFS Cf. A098550, A005117, A252867, A252868. Cf. A251391. Sequence in context: A298135 A226356 A141050 * A252868 A225477 A079161 Adjacent sequences:  A252862 A252863 A252864 * A252866 A252867 A252868 KEYWORD nonn AUTHOR Franklin T. Adams-Watters, Dec 23 2014 STATUS approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

Last modified June 15 00:00 EDT 2021. Contains 345041 sequences. (Running on oeis4.)