login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A255509 a(1)=1, a(2)=2, a(3)=3; for n>=4, a(n) is the maximal prime factor P_n of a(n-2) if P_n is not already a term, otherwise a(n) is the smallest not appeared earlier positive number x such that gcd(x,a(n-2))>1, gcd(x,a(n-1))=1. 2
1, 2, 3, 4, 9, 8, 15, 14, 5, 7, 10, 21, 16, 27, 20, 33, 25, 11, 30, 77, 6, 35, 12, 49, 18, 91, 22, 13, 24, 65, 28, 39, 32, 45, 26, 51, 38, 17, 19, 34, 57, 40, 63, 44, 69, 50, 23, 36, 115, 42, 55, 46, 75, 52, 81, 56, 87, 62, 29, 31, 58, 93, 64, 99, 68, 105, 74 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
COMMENTS
By definition, in contrast to A098550, in this sequence there is a priority for appearance of the primes.
LINKS
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.
MATHEMATICA
a[n_] := a[n] = If[n <= 3, n, Module[{p = FactorInteger[a[n-2]][[-1, 1]], aa = Array[a, n-1], x}, If[FreeQ[aa, p], Return[p], For[x = 4, True, x++, If[FreeQ[aa, x] && GCD[x, a[n-2]]>1 && GCD[x, a[n-1]]==1, Return[x]]]]]];
Array[a, 100] (* Jean-François Alcover, Oct 06 2018 *)
CROSSREFS
Sequence in context: A344176 A256224 A340783 * A257862 A350359 A340807
KEYWORD
nonn
AUTHOR
Vladimir Shevelev, Feb 24 2015
EXTENSIONS
More terms from Peter J. C. Moses, Feb 24 2015
STATUS
approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified July 17 13:42 EDT 2024. Contains 374377 sequences. (Running on oeis4.)