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!)
A340783 a(n) = n if n <= 3; for n>3, a(n) = the closest number to a(n-1) that has not occurred earlier and has at least one common factor with a(n-2), but none with a(n-1). In case of a tie, choose the smaller. 5
1, 2, 3, 4, 9, 8, 15, 14, 5, 6, 25, 24, 35, 34, 45, 44, 39, 38, 33, 32, 27, 26, 21, 20, 7, 10, 49, 48, 77, 76, 63, 62, 57, 56, 51, 50, 69, 68, 75, 74, 81, 80, 87, 86, 93, 92, 99, 98, 111, 110, 117, 116, 123, 122, 129, 128, 135, 134, 141, 140, 153, 152, 147, 146, 133, 132, 119, 118, 105, 104, 95 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
COMMENTS
The sequence uses a similar selection rule to the Yellowstone permutation A098550 but instead of choosing the smallest number that has not occurred earlier that has a common factor with a(n-2) and no common factor with a(n-1), the number closest to a(n-1) that satisfies these rules is selected for a(n). If two such numbers are the same distance from a(n-1) then the smaller is chosen.
As any number n is coprime to n-1 there are many such pairs of values differing by one in the sequence. If a(n-1) is even and a(n) is odd then the only time a(n+1) will not be a(n)-1 is if a(n)-1 has already appeared in the sequence.
The majority of terms are clustered along a line with gradient approximately 1.25 . However the line is broken into smaller regions, each region having a slightly higher gradient, by the terms dropping to much smaller values before returning to the main line. See the linked image.
Excluding the first five terms, in the first 5 million terms the maximum number of consecutive terms that increase is only two. This only occurs at five places, when n=9,25,79,13705,275345. In the same range there are many regions of consecutive decreasing terms, the longest being 5997 terms starting from n=1902153.
In the first 5 million terms the only fixed points, other than the first three terms, are 4 and 313362. As the terms for larger n seem to drop below the a(n)=n line on numerous occasions it is possible more exist, although this is unknown. The smallest number not appearing is 31. It is unknown is all values eventually appear. In the same range the largest change in consecutive terms is from a(3503960)=30982 to a(3503961)=3191249, a difference of 3160267.
LINKS
Scott R. Shannon, Image of the first 5 million terms. The green line is a(n)=n.
EXAMPLE
a(5) = 9 as a(5-2) = a(3) = 3 so a(5) must have 3 as a factor, but cannot be 6 as it cannot have common factor with a(5-1) = a(4) = 2.
a(12) = 24 as a(12-2) = a(10) = 6 so a(12) must have 2 or 3 as a factor, but cannot have a factor with a(12-1) = a(11) = 25. The closest numbers to a(12-1) = a(11) = 25 which have not occurred and satisfy these criteria are 24 and 26, but 24 is chosen as it is the smaller of the two. This is the first term differing from A098550 as the later chooses the smallest number satisfying the criteria that has not occurred, namely 12.
CROSSREFS
Sequence in context: A335585 A344176 A256224 * A255509 A257862 A350359
KEYWORD
nonn,look
AUTHOR
Scott R. Shannon, Jan 21 2021
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 April 24 08:59 EDT 2024. Contains 371935 sequences. (Running on oeis4.)