cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-7 of 7 results.

A098550 The Yellowstone permutation: a(n) = n if n <= 3, otherwise the smallest number not occurring earlier having at least one common factor with a(n-2), but none with a(n-1).

Original entry on oeis.org

1, 2, 3, 4, 9, 8, 15, 14, 5, 6, 25, 12, 35, 16, 7, 10, 21, 20, 27, 22, 39, 11, 13, 33, 26, 45, 28, 51, 32, 17, 18, 85, 24, 55, 34, 65, 36, 91, 30, 49, 38, 63, 19, 42, 95, 44, 57, 40, 69, 50, 23, 48, 115, 52, 75, 46, 81, 56, 87, 62, 29, 31, 58, 93, 64, 99, 68, 77, 54, 119, 60
Offset: 1

Views

Author

Reinhard Zumkeller, Sep 14 2004

Keywords

Comments

For n > 3, gcd(a(n), a(n-1)) = 1 and gcd(a(n), a(n-2)) > 1. (This is just a restatement of the definition.)
This is now known to be a permutation of the natural numbers: see the 2015 article by Applegate, Havermann, Selcoe, Shevelev, Sloane, and Zumkeller.
From N. J. A. Sloane, Nov 28 2014: (Start)
Some of the known properties (but see the above-mentioned article for a fuller treatment):
1. The sequence is infinite. Proof: We can always take a(n) = a(n-2)*p, where p is a prime that is larger than any prime dividing a(1), ..., a(n-1). QED
2. At least one-third of the terms are composite. Proof: The sequence cannot contain three consecutive primes. So at least one term in three is composite. QED
3. For any prime p, there is a term that is divisible by p. Proof: Suppose not. (i) No prime q > p can divide any term. For if a(n)=kq is the first multiple of q to appear, then we could have used kp < kq instead, a contradiction. So every term a(n) is a product of primes < p. (ii) Choose N such that a(n) > p^2 for all n > N. For n > N, let a(n)=bg, a(n+1)=c, a(n+2)=dg, where g=gcd(a(n),a(n+2)). Let q be the largest prime factor of g. We know q < p, so qp < p^2 < dg, so we could have used qp instead of dg, a contradiction. QED
3a. Let a(n_p) be the first term that is divisible by p (this is A251541). Then a(n_p) = q*p where q is a prime less than p. If p < r are primes then n_p < n_r. Proof: Immediate consequences of the definition.
4. (From David Applegate, Nov 27 2014) There are infinitely many even terms. Proof:
Suppose not. Then let 2x be the maximum even entry. Because the sequence is infinite, there exists an N such that for any n > N, a(n) is odd, and a(n) > x^2.
In addition, there must be some n > N such that a(n) < a(n+2). For that n, let g = gcd(a(n),a(n+2)), a(n) = bg, a(n+1)=c, a(n+2)=dg, with all of b,c,d,g relatively prime, and odd.
Since dg > bg, d > b >= 1, so d >= 3. Also, g >= 3.
Since a(n) = bg > x^2, one of b or g is > x.
Case 1: b > x. Then 2b > 2x, so 2b has not yet occurred in the sequence. And gcd(bg,2b)=b > x > 1, gcd(2b,c)=1, and since g >= 3, 2b < bg < dg. So a(n+2) should have been 2b instead of dg.
Case 2: g > x. Then 2g > 2x, so 2g has not yet occurred in the sequence. And gcd(bg,2g)=g > 1, gcd(2g,c)=1, and since d >= 3, 2g < dg. So a(n+2) should have been 2g instead of dg.
In either case, we derive a contradiction. QED
Conjectures:
5. For any prime p > 97, the first time we see p, it is in the subsequence a(n) = 2b, a(n+2) = 2p, a(n+4) = p for some n, b, where n is about 2.14*p and gcd(b,p)=1.
6. The value of |{k=1,..,n: a(k)<=k}|/n tends to 1/2. - Jon Perry, Nov 22 2014 [Comment edited by N. J. A. Sloane, Nov 23 2014 and Dec 26 2014]
7. Based on the first 250000 terms, I conjectured on Nov 30 2014 that a(n)/n <= (Pi/2)*log n.
8. The primes in the sequence appear in their natural order. This conjecture is very plausible but as yet there is no proof. - N. J. A. Sloane, Jan 29 2015
(End)
The only fixed points seem to be {1, 2, 3, 4, 12, 50, 86} - see A251411. Checked up to n=10^4. - L. Edson Jeffery, Nov 30 2014. No further terms up to 10^5 - M. F. Hasler, Dec 01 2014; up to 250000 - Reinhard Zumkeller; up to 300000 (see graph) - Hans Havermann, Dec 01 2014; up to 10^6 - Chai Wah Wu, Dec 06 2014; up to 10^8 - David Applegate, Dec 08 2014.
From N. J. A. Sloane, Dec 04 2014: (Start)
The first 250000 points lie on about 8 roughly straight lines, whose slopes are approximately 0.467, 0.957, 1.15, 1.43, 2.40, 3.38, 5.25 and 6.20.
The first six lines seem well-established, but the two lines with highest slope at present are rather sparse. Presumably as the number of points increases, there will be more and more lines of ever-increasing slopes.
These lines can be seen in the Havermann link. See the "slopes" link for a list of the first 250000 terms sorted according to slope (the four columns in the table give n, a(n), the slope a(n)/n, and the number of divisors of a(n), respectively).
The primes (with two divisors) all lie on the lowest line, and the lines of slopes 1.43 and higher essentially consist of the products of two primes (with four divisors).
(End)
The eight roughly straight lines mentioned above are actually curves. A good fit for the "line" with slope ~= 1.15 is a(n)~=n(1+1.0/log(n/24.2)), and a good fit for the other "lines" is a(n)~= (c/2)*n(1-0.5/log(n/3.67)), for c = 1,2,3,5,7,11,13. The first of these curves consists of most of the odd terms in the sequence. The second family consists of the primes (c=1), even terms (c=2), and c*prime (c=3,5,7,11,13,...). This functional form for the fit is motivated by the observed pattern (after the first 204 terms) of alternating even and odd terms, except for the sequence pattern 2*p, odd, p, even, q*p when reaching a prime (with q a prime < p). - Jon E. Schoenfield and David Applegate, Dec 15 2014
For a generalization, see the sequence of monomials of primes in the comment in A247225. - Vladimir Shevelev, Jan 19 2015
From Vladimir Shevelev, Feb 24 2015: (Start)
Let P be prime. Denote by S_P*P the first multiple of P appearing in the sequence. Then
1) For P >= 5, S_P is prime.
Indeed, let
a(n-2)=v, a(n-1)=w, a(n)=S_P*P. (*)
Note that gcd(v,P)=1. Therefore, by the definition of the sequence, S_P*P should be the smallest number such that gcd(v,S_P) > 1.
So S_P is the smallest prime factor of v.
2) The first multiples of all primes appear in the natural order.
Suppose not. Then there is a pair of primes P < Q such that S_Q*Q appears earlier than S_P*P. Let
a(m-2)=v_1, a(m-1)=w_1, a(m)=S_Q*Q. (**)
Then, as in (*), S_Q is the smallest prime factor of v_1. But this does not depend on Q. So S_Q*P is a smaller candidate in (**), a contradiction.
3) S_P < P.
Indeed, from (*) it follows that the first multiple of S_P appears earlier than the first multiple of P. So, by 2), S_P < P.
(End)
For any given set S of primes, the subsequence consisting of numbers whose prime factors are exactly the primes in S appears in increasing order. For example, if S = {2,3}, 6 appears first, in due course followed by 12, 18, 24, 36, 48, 54, 72, etc. The smallest numbers in each subsequence (i.e., those that appear first) are the squarefree numbers A005117(n), n > 1. - Bob Selcoe, Mar 06 2015

Crossrefs

Cf. A098548, A098551, A249943 (first time all 1..n appear), A251553.
The inverse permutation is in A098551.
A098552(n) = a(a(n)).
A251102(n) = GCD(a(n+2),a(n)).
Cf. A251101 (smallest prime factor), A251103 (largest prime factor), A251138 (number of distinct prime factors), A251140 (total number of prime factors), A251045 (squarefree part), A251089 (squarefree kernel), A250127 and A251415 (records for a(n)/n), A251411 (fixed points), A248647 (records).
Cf. also A251412 (trajectory of 11), A251556 (finite cycles), A251413 and A251414 (variant involving odd numbers), A249357 ("Fibonacci" variant).
Smallest missing numbers: A251416, A251417, A251546-A251552, A247253. See also A251557, A241558, A251559.
Indices of some pertinent subsequences: A251237 (even numbers), A251238 (odd numbers), A251391 (squarefree), A251541 and A251239 (primes), A251240 (squares of primes), A251241 (prime powers), A251393 (powers of 2), A251392 (nonprimes), A253297 (primes p for which some multiple k*p > 2*p precedes p).
Three arrays concerning the occurrences of multiples of primes: A251637, A251715, A251716.
Two sequences related to the numbers which immediately follow a prime: A253048, A253049. Seven sequences related to the numbers that appear two steps after primes: A251542, A251543, A251544, A251545, A253052, A253053, A253054. See also A253055 and A253056.
Other starting values: A251554, A251555.
See also A064413 (EKG sequence), A255582, A121216 (similar sequences), A257112 (two-dimensional analog).
See also A253765 and A253766 (bisections), A250299 (parity), A253768 (partial sums).
See A336957 for a variation.

Programs

  • Haskell
    import Data.List (delete)
    a098550 n = a098550_list !! (n-1)
    a098550_list = 1 : 2 : 3 : f 2 3 [4..] 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, Nov 21 2014
    
  • Maple
    N:= 10^4: # to get a(1) to a(n) where a(n+1) is the first term > N
    B:= Vector(N,datatype=integer[4]):
    for n from 1 to 3 do A[n]:= n: od:
    for n from 4 do
      for k from 4 to N do
        if B[k] = 0 and igcd(k,A[n-1]) = 1 and igcd(k,A[n-2]) > 1 then
           A[n]:= k;
           B[k]:= 1;
           break
        fi
      od:
      if k > N then break fi
    od:
    seq(A[i],i=1..n-1); # Robert Israel, Nov 21 2014
  • Mathematica
    f[lst_List] := Block[{k = 4}, While[ GCD[ lst[[-2]], k] == 1 || GCD[ lst[[-1]], k] > 1 || MemberQ[lst, k], k++]; Append[lst, k]]; Nest[f, {1, 2, 3}, 68] (* Robert G. Wilson v, Nov 21 2014 *)
    NN = Range[4, 1000]; a098550 = {1, 2, 3}; g = {-1}; While[g[[1]] != 0, g = Flatten[{FirstPosition[NN, v_ /; GCD[a098550[[-1]], v] == 1 && GCD[a098550[[-2]], v] > 1, 0]}]; If[g[[1]] != 0, d = NN[[g]]; a098550 = Flatten[Append[a098550, d[[1]]]]; NN = Delete[NN, g[[1]]]]]; Table[a098550[[n]], {n, 71}] (* L. Edson Jeffery, Jan 01 2015 *)
  • PARI
    a(n, show=1, a=3, o=2, u=[])={n<3&&return(n); show&&print1("1, 2"); for(i=4,n, show&&print1(","a); u=setunion(u, Set(a)); while(#u>1 && u[2]==u[1]+1, u=vecextract(u,"^1")); for(k=u[1]+1, 9e9, gcd(k,o)>1||next; setsearch(u,k)&&next; gcd(k,a)==1||next; o=a; a=k; break)); a} \\ Replace "show" by "a+1==i" in the main loop to print only fixed points. - M. F. Hasler, Dec 01 2014
    
  • Python
    from math import gcd
    A098550_list, l1, l2, s, b = [1,2,3], 3, 2, 4, {}
    for _ in range(1,10**6):
        i = s
        while True:
            if not i in b and gcd(i,l1) == 1 and gcd(i,l2) > 1:
                A098550_list.append(i)
                l2, l1, b[i] = l1, i, 1
                while s in b:
                    b.pop(s)
                    s += 1
                break
            i += 1 # Chai Wah Wu, Dec 04 2014

A373390 a(n) = n for n <= 3; for n > 3, a(n) is the smallest unused positive number that is coprime to a(n-1) but has a common factor with at least one of a(1)...a(n-2).

Original entry on oeis.org

1, 2, 3, 4, 9, 8, 15, 14, 5, 6, 7, 10, 21, 16, 25, 12, 35, 18, 49, 20, 27, 22, 39, 11, 13, 24, 55, 26, 33, 28, 45, 32, 51, 38, 17, 19, 30, 77, 34, 57, 40, 63, 44, 65, 36, 85, 42, 95, 46, 75, 23, 48, 91, 50, 69, 52, 81, 56, 87, 62, 29, 31, 54, 115, 58, 93, 64, 99, 68, 105, 74, 117, 37, 60, 119, 66
Offset: 1

Views

Author

Scott R. Shannon, Jun 03 2024

Keywords

Comments

The sequence uses a criterion for selecting the next term similar to those that define A098550 and A247942, but here all terms prior to a(n-1) can be checked for a common factor with a(n).
Comment from N. J. A. Sloane, Jun 19 2024 (Start)
Theorem: This is a permutation of the positive integers.
Proof: This follows from arguments similar to those used to prove that other "lexicographically earliest" sequences are permutations. Here is a sketch of the steps.
1. Sequence is infinite. (Easy: a(n-2) times a giant prime is always a candidate for a(n).)
2. Let w(n) = index of n when it appears, or -1 if n never appears. Let W(n) = max {w(1), ..., w(n)}. Then i > W(n) implies a(i) > n. [In words, the rules imply that there is a threshold W(n) such that if n has not appeared by the time you have looked at the first W(n) terms, then n will never appear.]
3. For any prime p, there is an n with p | a(n). For if not, no prime q > p can divide any term either, or we could have used p instead of q. So all terms are a product of primes < p. Now consider a term a(m) with m > W(p!), and let q < p be the smallest prime factor of a(m). Then q*p < p! < a(m) is a smaller candidate for a(m). Contradiction.
4. For any prime p there are infinitely many terms divisible by p. For if not, choose a power of p, p^r say, that is greater than any multiple of p in the sequence, and then choose a prime Q > p^r. Look at the first term, k*Q say, that is divisible by Q. But then k*p^r would have been a smaller choice than k*Q. Contradiction.
5. For any prime p, there is a term a(n) = p. In words, every prime appears naked. Proof: Choose a giant multiple of p, G*p say. Then p would have been a smaller choice than G*p. Contradiction.
6. (This is the only tricky step.) Every number appears. Suppose k = p1*p2*p3 (say) never appears (we know from 5 that we can assume k is not itself a prime). Find a giant multiple of p1, a(n) = G*p1. Then k is a candidate for a(n+2), unless gcd(k,a(n+1)) > 1. So gcd(k, a(n+1)) > 1 is forced. But then, equally, gcd(k, a(n+2)) > 1 is forced, or else we could set a(n+3) = k. And so on. So every term after a(n) must have a common factor with k. This is impossible by 5.
This completes the proof. (End)
A373790 has several as-yet unproved conjectures related to this sequence. - N. J. A. Sloane, Jun 23 2024
The terms appear to follow a pattern similar to the EKG sequence A064413, i.e., the terms are concentrated along just three lines of different gradient, and the lower line consists only of primes. Prime powers appear in the upper two lines, with the powers of 2 greater than 32 falling on the middle line while all others fall on the top line. See the attached image for the first 1000 terms. For the first 100000 terms the primes appear in their natural order, implying that is likely true for all n.
The fixed points are 1, 2, 3, 4, 18, 20, 22, 32, 98, and it is likely that no more exist. Given that A098550 and A247942 are permutations of the positive integers, it is almost certainly true that this sequence is also. [This is true - see the above Theorem. - N. J. A. Sloane, Jun 20 2024]
From Michael De Vlieger, Jun 07 2024: (Start)
A scatterplot of the sequence shows 3 trajectories as follows:
"Alpha" is a trajectory of odd composite numbers (highest slope).
"Gamma" is a trajectory of even composite numbers.
"Beta" is the trajectory of primes and the number 1 (lowest slope). (End) [The points on the three trajectories are listed in A372080 and A372081 (alpha), A373786 and A373787 (gamma), and A372073 (beta). - N. J. A. Sloane, Jun 20 2024]

Examples

			a(11) = 7 as 7 is coprime to a(10) = 6 while sharing a factor with a(8) = 14. This is the first term to differ from A098550.
a(38) = 77 as 77 is coprime to a(37) = 30 while sharing a factor with a(30) = 28. This is the first term to differ from A247942.
		

Crossrefs

Programs

  • Mathematica
    c[] := False; p[] := False; nn = 120;
    Array[Set[{a[#], c[#], p[#]}, {#, True, True}] &, 3];
    i = a[2]; j = a[3]; u = 4;
    Do[k = u;
     While[Or[c[k], ! CoprimeQ[j, k],
       NoneTrue[Set[s, #], p] &@FactorInteger[k][[All, 1]]], k++];
     Map[Set[p[#], True] &, s];
     Set[{a[n], c[k], i, j}, {k, True, j, k}];
     If[k == u, While[c[u], u++]], {n, 4, nn}];
    Array[a, nn] (* Michael De Vlieger, Jun 06 2024 *)
  • Python
    from math import gcd, lcm
    from itertools import count, islice
    def agen(): # generator of terms
        yield from [1, 2, 3]
        aset, an, LCM, mink = {1, 2, 3}, 3, 6, 4
        while True:
            an = next(k for k in count(mink) if k not in aset and gcd(k, an) == 1 and gcd(k, LCM) > 1)
            LCM = lcm(LCM, an)
            aset.add(an)
            while mink in aset: mink += 1
            yield an
    print(list(islice(agen(), 76))) # Michael S. Branicky, Jun 18 2024

A254077 a(n) = n if n <= 3, otherwise the smallest number not occurring earlier such that gcd(a(n),a(n-2)) > gcd(a(n),a(n-1)).

Original entry on oeis.org

1, 2, 3, 4, 6, 8, 9, 10, 12, 5, 14, 15, 7, 18, 21, 16, 27, 20, 33, 24, 11, 26, 22, 13, 28, 39, 32, 30, 44, 25, 34, 35, 17, 40, 51, 36, 68, 42, 52, 45, 38, 48, 19, 46, 57, 23, 54, 69, 50, 63, 55, 49, 60, 56, 65, 58, 70, 29, 62, 87, 31, 66, 93, 64, 75, 72, 85, 74, 80, 37, 76, 111
Offset: 1

Views

Author

Vladimir Shevelev, Jan 25 2015

Keywords

Comments

Conjecture: The sequence is infinite (that is, a(n) always exists).
Ray Chandler reports that the sequence certainly exists for 10^7 terms, Apr 02 2015. John P. Linderman confirms this, and has extended the sequence to 12.9 million terms, Apr 09 2015. Extended to 50 million terms by John Mason Apr 21 2015. John P. Linderman reached 150 million terms on May 04 2015, 2.5 billion terms on Jun 29 2015, and 5 billion terms on Apr 07 2017 (see attached letter).
Note that if a(n) ever divides a(n+1), the sequence will terminate. This has not happened in the first 2.5 billion terms (see the Linderman links), but there have been some close calls. For example, at n=9671, a(9671) = 4973 = a prime p, and a(9672) = 9947 = 2p+1. Conversely, if a(n) never divides a(n+1), the sequence is infinite. - N. J. A. Sloane, Mar 22 2015 and Jun 06 2015
Conjecture: The sequence is a permutation of the natural numbers.
Conjectures: 1) For k>=3, except for k=5, if a(n) = prime(k), then a(n-2) = 2*prime(k) and a(n+2) = 3*prime(k). This conjecture was verified by Peter J. C. Moses for n <= 5000. - Vladimir Shevelev, Feb 09 2015. This conjecture verified for n <= 10^7. - Ray Chandler, Apr 02 2015. Extended to n <= 10^9. - John Mason, Jun 08 2016
2) For k>=3, except for k=4, if a(n)=prime(k)^2, then a(n-2) = prime(k)^2 + prime(k). This conjecture was verified by Peter J. C. Moses for n <= 35000. - Vladimir Shevelev, Feb 12 2015. This conjecture verified for n <= 394349. - Ray Chandler, Mar 07 2015. This conjecture is false - for n = 4488245, a(n) = 2137^2, but a(n-2) = 2137^2 + 2*2137. - Ray Chandler, Mar 30 2015. Next are n = 30655601, a(n) = 5581^2, but a(n-2) = 5581^2 + 2*5581, and n = 922447261, a(n) = 30577^2, but a(n-2) = 30577^2 + 2*30577. - John Mason, Sep 15 2016
Theorem: a(n) does not divide a(n-1). For suppose a(n-2)=x, a(n-1)=b*c, a(n)=c. Then gcd(x,c) <= c, and gcd(b*c,c) = c, which contradicts the definition of a(n). - N. J. A. Sloane, Mar 22 2015
Theorem: If a(n-2) is prime AND a(n) EXISTS then a(n) is a multiple of a(n-2). For: by sequence definition, assuming a(n-2) = p, prime, then gcd(a(n),p) > gcd(a(n),a(n-1)); hence gcd(a(n),p) > 1; but p is prime and has only 1 and itself as divisors; so gcd(a(n),p)=p, and so a(n) is a multiple of p. (Weaker than the similar conjecture above.) - John Mason, Apr 15 2015 [WORDS IN CAPS ADDED BY N. J. A. Sloane, Apr 16 2015]
Theorem: If a(n) EXISTS AND a(n) > a(n-2)/2 then a(n) is composite. For: suppose instead that a(n)=p, prime; then by sequence definition, gcd(p,a(n-2)) > gcd(p,a(n-1)); hence gcd(p,a(n-2))>1; hence a(n-2) is a multiple of p; but a(n-2) < 2p so we have a contradiction; hence a(n) is composite. This theorem improves the efficiency of some sequence generation algorithms. - John Mason, Apr 15 2015 [WORDS IN CAPS ADDED BY N. J. A. Sloane, Apr 16 2015] [Further corrected by John Mason, May 28 2017]
Theorem: If a(n-2)=mp for some prime p, and m divides a(n-1), then a(n), if it exists, is a multiple of p (generalization of previous theorem, which is the special case of m=1). See for example a(33)=17, a(35)=51, a(37)=68; a(37) is a multiple of 17 because a(36) is a multiple of 3, which is "m" in a(35). (It follows that if a(n-2) / gcd(a(n-2), a(n-1)) is p, prime, then a(n), if it exists, is a multiple of p. - John Mason, May 19 2015)
Proof: consider consecutive terms mp,y,z for prime p, and m dividing y. By sequence definition gcd(z,mp)>gcd(z,y). Suppose that z is not a multiple of p. Then gcd(z,mp)=gcd(z,m), and so gcd(z,m)>gcd(z,y). Since m divides y, then gcd(z,m)>gcd(z,mq) for q = y/m, but this is clearly impossible. Hence z is a multiple of p. - John Mason, Apr 17 2015
Theorem: The first occurrences of the primes as factors of terms of the sequence are in ascending order, and without gaps (that is, 2 precedes 3, 3 precedes 5 (factor of 10), 5 precedes 7 (factor of 14), ...).
Proof: Suppose a(n)=mp is the first term having p as a factor. Then the theory states that q, prime and gcd(mp,a(n-1)). As a(n) is the first to have p as a factor, p does not divide a(n-2) and a(n-1), and neither does q. Hence gcd(mp,a(n-2))=gcd(m,a(n-2)) and gcd(mp,a(n-1))= gcd(m,a(n-1)). Hence gcd(m,a(n-2)) > gcd(m,a(n-1)). Hence gcd(mq,a(n-2)) > gcd(mq,a(n-1)). Hence mq, < mp, would have satisfied the conditions of the sequence for a(n), which is a contradiction. Hence no such prime q exists. - John Mason, Apr 17 2015
Theorem: The first occurrence of a prime p as a factor of a term in the sequence is in a term that is not equal to p itself.
Proof: Suppose a(n)=p, prime, the first term having p as a factor. Then gcd(p,a(n-2))=1, and therefore cannot be greater than gcd(p,a(n-1)), a contradiction of the rules of sequence construction. - John Mason, Apr 17 2015
Conjecture. The primes exist as elementary terms of the sequence in ascending order. - John Mason, Apr 17 2015
John Mason reports that each prime p seems to appear at a term n which is approaching 2p, as p increases. See A256213. - N. J. A. Sloane, Apr 16 2015
Conjecture. For any n > 4, the lowest value x missing from a(1) thru a(n) is prime. - John Mason, Apr 29 2015. In fact, taking into account that, apparently, prime p appears in the sequence at position circa 2p, we may conjecture that the lowest k values missing from a(1) thru a(n) are prime, where k = pi(n)-pi(n/2) - see A000720. - John Mason, Jun 03 2015
Theorem: if a(n) = p for some prime p > 3, then a(n-2) is a multiple of p. As a direct consequence, if all prime factors of a(n-2) are already present in the sequence, then a(n), if it exists, is composite.
Proof: by sequence definition, unless p=2 or 3, gcd(p,a(n-2)) > gcd(p,a(n-1)), and hence gcd(p,a(n-2))>1, and hence a(n-2) is a multiple of p. - John Mason, May 19 2015
First differs from A255582 at a(29). - Omar E. Pol, May 21 2015
Conjecture. For n > 778, if a(n) < n, then a(n) is prime. This has been confirmed for n through 10^9. - John Mason, Jun 03 2015 [Corrected, following suggestion by John P. Linderman, by John Mason, May 28 2017]
Conjecture. As for "Conjecture 1" above, which is its mirror image, except for n=2,3,21, corresponding to primes 2,3,11, if a(n-2)=mp is the first occurrence of prime p as a factor in the sequence, then m=2 and a(n)=p. Also, if a(n-2)=mp is the first occurrence of prime p as a factor in the sequence, then p does not divide a(n-1). - John Mason, May 31 2016
Theorem 1: If a(n) is the first term having p (prime) as a factor, then a(n+1), if it exists, is not a multiple of p. For proof, see links. - John Mason, Jul 26 2016
Theorem 2: If a(n)=cp is the first occurrence of prime p as a factor (n >3), than c has exactly one distinct prime factor. In other words, c may be expressed as k^i for some prime k, and i > 0.
Corollary. If a(n)=cp is the first occurrence of prime p as a factor (n >3), and as a consequence c= k^i for some prime k, and i > 0, then k^i divides a(n-2) and k^(i-1) is the maximum power of k that divides a(n-1).
Theorem 3 . If a(n) = 2p is the first term having p (prime) as a factor, then a(n-1) is odd and a(n-2) is even.
Theorem 4. If a(n) = 2p is the first term having p (prime) as a factor, then a(n+2), if it exists, is either p or 2u for some integer u such that 2u < p. (Note that it is conjectured to be always p, and observation confirms the conjecture.)
Theorem 5, generalization of Theorem 4. If a(n) = cp is the first term having p (prime) as a factor (n >3), and as a consequence c=k^i for prime k and i>0, then a(n+2), if it exists, is either p or ku for some integer u such that ku < p. (Note that it is conjectured to be always p, and observation confirms the conjecture.)
Theorem 6. If a(n) = cp is first term having p, prime, as a factor (n >3), and a(n+2)=p, then a(n+3) exists, and is not a multiple of p, and so does not terminate the sequence.
Theorem 7. If a(n) = cp is first term having p, prime, as a factor (n >3), and a(n+2)=p, then a(n+4) exists and is 2p or 3p. Also, a(n+5) exists.
For proofs, see links. - John Mason, Aug 03 2016
Theorem 8: If the sequence is infinite, it is a permutation of the positive integers. For proof, see link. - John Mason, Sep 14 2016
Conjecture: After 2 and 3, no two primes are consecutive terms. This conjecture is derivable from the previous conjecture : "For k>=3, except for k=5, if a(n) = prime(k), then a(n-2) = 2*prime(k) ...". For, if sequence has terms z,2p,2q,p,q for primes p & q, then gcd(2q,z)>gcd(2q,2p)=2. Hence q divides z. So terms are mq,2p,2q,p,q. So we could have used q in place of 2q. - John Mason, May 28 2017

Crossrefs

For indices of primes see A256213. Sequence mod 2 is A257585.
Changing > in definition to >= produces A255582 (which DOES exist).
Cf. A256528 (partial sums).

Programs

  • Haskell
    a254077 n = a254077_list !! (n-1)
    a254077_list = 1 : 2 : 3 : f 2 3 [4..] where
       f u v ws = g ws where
         g (x:xs) = if gcd x u > gcd x v then x : f v x (delete x ws) else g xs
    -- Reinhard Zumkeller, May 05 2015
  • Mathematica
    f[n_] := Block[{s = Range@ n, j, k}, For[k = 4, k <= n, k++, j = 4; While[Nand[GCD[j, s[[k - 2]]] > GCD[j, s[[k - 1]]], !MemberQ[Take[s, k - 1], j]], j++]; s[[k]] = j]; s]; f@ 72 (* Michael De Vlieger, Apr 15 2015 *)

Extensions

More terms from Peter J. C. Moses, Jan 25 2015

A247225 a(n) = n if n <= 3, a(4)=5, otherwise the smallest number not occurring earlier having at least one common factor with a(n-3), but none with a(n-1)*a(n-2).

Original entry on oeis.org

1, 2, 3, 5, 4, 9, 25, 8, 21, 55, 16, 7, 11, 6, 35, 121, 12, 49, 143, 10, 63, 13, 20, 27, 91, 22, 15, 119, 26, 33, 17, 14, 39, 85, 28, 57, 65, 32, 19, 45, 34, 133, 69, 40, 77, 23, 18, 175, 253, 24, 95, 161, 36, 125, 203, 38, 75, 29, 44, 51, 145, 46, 81, 155, 52
Offset: 1

Views

Author

Vladimir Shevelev, Jan 11 2015

Keywords

Comments

Conjecturally the sequence is a permutation of the positive integers. However, to prove this we need more subtle arguments than were used to prove the corresponding property for A098550. - Vladimir Shevelev, Jan 14 2015
For n <= 2000, a(3n-1) is even and both a(3n) and a(3n-2) are odd numbers. I conjecture that this is true for all positive integers n. This conjecture is true iff for all positive integers n, a(3n-1) is even. - Farideh Firoozbakht, Jan 14 2015
From Vladimir Shevelev, Jan 19 2015: (Start)
A generalization of A098550 and A247225.
Let p_n=prime(n). Define the following sequence
a(1)=1, a(2)=p_1,...,a(k+2)=p_(k+1), otherwise the smallest number not occurring earlier having at least one common factor with a(n-(k+1)), but none with a(n-1)*a(n-2)*...*a(n-k).
The sequence begins
1, p_1, p_2, ..., p_(k+1), p_1^2, p_2^2, ..., p_(k+1)^2, p_1^3, ... (*)
[ p_1^3 is followed by p_2*p_(k+2), k<=2,
p_2^3, k>=3, etc.]
In particular, if k=1, it is A098550, if k=2, it is A247225.
Conjecturally for every k>=2, as in the case k=1, the sequence (*) is a permutation of the positive integers. For k>=3, at first glance, already the appearance of the number 6 seems problematic. However, at the author's request, Peter J. C. Moses found that the positions of 6 are 83, 157, 1190, 206, ... in cases k=3,4,5,6,... respectively (A254003).
Note also that for every k>=2, every even term is followed by k odd terms. This is explained by the minimal growth of even numbers (2n) relatively with one of the numbers with the smallest prime divisor p>=3 (asymptotically 6n, 15n, 105n/4, 385n/8, ... for p = 3,5,7,11,... respectively (cf. A084967 - A084970)).
(End)

Crossrefs

Programs

  • Mathematica
    a[n_ /; n <= 3] := n; a[4]=5; a[n_] := a[n] = For[aa = Table[a[j], {j, 1, n-1}]; k=4, True, k++, If[FreeQ[aa, k] && !CoprimeQ[k, a[n-3]] && CoprimeQ[k, a[n-1]*a[n-2]], Return[k]]]; Table[ a[n], {n, 1, 65}] (* Jean-François Alcover, Jan 12 2015 *)

Extensions

More terms from Peter J. C. Moses, Jan 12 2015

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.

Original entry on oeis.org

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
Offset: 1

Views

Author

Vladimir Shevelev, Feb 24 2015

Keywords

Comments

By definition, in contrast to A098550, in this sequence there is a priority for appearance of the primes.

Crossrefs

Programs

  • 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 *)

Extensions

More terms from Peter J. C. Moses, Feb 24 2015

A374612 a(n) = n for n <= 3; for n > 3, a(n) is the smallest unused positive number that is coprime to a(n-1) but has a common factor with any other previous term that is also coprime to a(n-1).

Original entry on oeis.org

1, 2, 3, 4, 9, 8, 15, 14, 5, 6, 25, 7, 10, 21, 16, 27, 20, 33, 26, 11, 12, 35, 13, 18, 49, 22, 39, 28, 45, 32, 51, 38, 17, 19, 24, 55, 34, 57, 40, 63, 44, 65, 36, 77, 30, 91, 46, 75, 23, 42, 85, 48, 95, 52, 69, 50, 81, 56, 87, 62, 29, 31, 54, 115, 58, 93, 64, 99, 68, 105, 74, 117, 37, 60, 119, 66
Offset: 1

Views

Author

Scott R. Shannon, Jul 14 2024

Keywords

Comments

The terms appear to follow a pattern similar to the A064413 and A373390, i.e., the terms are concentrated along just three lines of different gradient, and the lower line consists only of primes. In the first 10000 terms the primes appear in their natural order, and the fixed points are 1, 2, 3, 4, 28, 98; it is likely no more exist. The sequence is conjectured to be a permutation of the positive integers.

Examples

			a(11) = 25 as 25 is coprime to a(10) = 6 while sharing a factor with a(9) = 5, which is itself coprime to a(10) = 6. Note that all other previous terms, other than a(1) = 1, do share a factor with a(10) = 6. This is the first term to differ from A373390.
		

Crossrefs

A374645 a(1) = 1, a(2) = 6, a(3) = 2; for n > 3, a(n) is the smallest unused positive number that is coprime to a(n-1) but has a common factor with any other previous term that has a common factor with a(n-1).

Original entry on oeis.org

1, 6, 2, 3, 4, 9, 8, 15, 14, 27, 5, 12, 7, 10, 21, 16, 25, 18, 35, 22, 39, 20, 11, 24, 13, 30, 49, 26, 33, 28, 45, 32, 51, 38, 55, 34, 19, 36, 17, 40, 57, 44, 63, 46, 65, 42, 23, 48, 77, 50, 69, 52, 75, 56, 81, 58, 85, 54, 29, 60, 91, 62, 87, 64, 31, 66, 95, 68, 93, 70, 99, 74, 105, 76, 37
Offset: 1

Views

Author

Scott R. Shannon, Jul 15 2024

Keywords

Comments

The terms appear to follow a pattern similar to the A064413 and A373390, i.e., the terms are concentrated along just three lines of different gradient, and the lower line consists only of primes. In the first 10000 terms the primes appear in their natural order except for a(37) = 19 and a(39) = 17 which are reversed. Many fixed points exist, 2228 in the first 10000 terms, these beginning 1, 12, 16, 18, 24, 32, 40, 48, ... . The sequence is conjectured to be a permutation of the positive integers.

Examples

			a(11) = 5 as 5 is coprime to a(10) = 27 while sharing a factor with a(8) = 15, which itself shares a factor with a(10) = 27. This is also the first term that uses a term other than a(2) = 6 as the previous term with which is shares a factor with.
		

Crossrefs

Showing 1-7 of 7 results.