The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
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!)
A354687 a(1) = 1; for n > 1, a(n) is the smallest positive number that has not yet appeared that shares a factor with a(n-1) and the difference | a(n) - a(n-1) | is distinct from all previous differences. 11
1, 2, 4, 8, 14, 6, 3, 12, 22, 10, 5, 20, 34, 16, 32, 52, 13, 26, 48, 15, 36, 9, 33, 44, 18, 46, 23, 69, 21, 28, 58, 24, 56, 7, 42, 78, 27, 72, 30, 55, 11, 66, 104, 38, 19, 76, 116, 29, 87, 141, 39, 91, 35, 85, 17, 102, 40, 100, 25, 90, 153, 45, 114, 50, 120, 192, 51, 68, 142, 54, 130, 208, 60 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
COMMENTS
The terms are concentrated along many different lines, although three lines contain a higher concentration of terms than the others; these are similar to the three lines seen in A064413. See the linked image. The primes do not occur in their natural order, and unlike A064413, the terms proceeding and following a prime term can be high multiples of the prime.
In the first 200000 terms the fixed points are 1,2,6,10,68. It is plausible no more exist although this is unknown. The sequence is conjectured to be a permutation of the positive integers.
See A354721 for the differences between terms.
LINKS
Michael De Vlieger, Annotated log log scatterplot of a(n), n = 1..2^14, showing records in red and local minima in blue, highlighting primes in green and fixed points in gold.
Scott R. Shannon, Image of the first 100000 terms. The green line is y = n.
EXAMPLE
a(4) = 8 as a(3) = 4, and 8 is the smallest unused number that shares a factor with 4 and whose difference from the previous term,| 8 - 4 | = 4, has not appeared. Note 6 shares a factor with 4 but | 6 - 4 | = 2, and a difference of 2 has already occurred between as | a(3) - a(2) |, so 6 cannot be chosen.
MATHEMATICA
nn = 120; c[_] = d[_] = 0; a[1] = c[1] = 1; a[2] = c[2] = j = 2; u = 3; Do[Set[k, u]; While[Nand[c[k] == 0, d[Abs[k - j]] == 0, ! CoprimeQ[j, k]], k++]; Set[{a[i], c[k], d[Abs[k - j]]}, {k, i, i}]; j = k; If[k == u, While[c[u] > 0, u++]], {i, 3, nn}]; Array[a, nn] (* Michael De Vlieger, Jun 04 2022 *)
PROG
(Python)
from math import gcd
from sympy import isprime, nextprime
from itertools import count, islice
def agen(): # generator of terms
aset, diffset, an, mink = {1, 2}, {1}, 2, 3
yield from [1, 2]
for n in count(3):
k = mink
while k in aset or abs(an-k) in diffset or gcd(an, k) == 1: k += 1
aset.add(k); diffset.add(abs(k-an)); an = k; yield an
while mink in aset: mink += 1
print(list(islice(agen(), 73))) # Michael S. Branicky, Jun 04 2022
CROSSREFS
Sequence in context: A026665 A369704 A174540 * A253766 A368490 A076380
KEYWORD
nonn
AUTHOR
Scott R. Shannon, Jun 03 2022
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 May 21 10:20 EDT 2024. Contains 372735 sequences. (Running on oeis4.)