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.

Previous Showing 31-40 of 127 results. Next

A347984 Variation of the Enots Wolley sequence A336957: earliest infinite sequence of distinct positive integers such that a(n) has a common factor with a(n-1) but not with a(n-2), and has a different number of divisors than a(n-1).

Original entry on oeis.org

1, 2, 6, 45, 35, 28, 22, 99, 15, 20, 14, 63, 33, 44, 10, 75, 21, 56, 26, 117, 51, 68, 38, 171, 39, 52, 34, 153, 57, 76, 40, 55, 231, 12, 46, 575, 65, 78, 58, 725, 85, 102, 62, 775, 95, 114, 69, 805, 50, 24, 87, 1015, 77, 66, 60, 115, 1127, 42, 74, 925, 105, 18, 82, 1025, 135, 36, 86, 1075, 145
Offset: 1

Views

Author

Scott R. Shannon, Sep 27 2021

Keywords

Comments

This sequence uses the same rules as A336957 except with the additional restriction that a(n) must have a different number of divisors than a(n-1). This leads to the terms showing a greater variation in value. For example in the first 5000 terms the maximum is a(3915) = 228569, compared to a maximum of a(3225) = 11053 for A336957 in the same range. Like A336957 is it likely all positive integers other than the prime-powers eventually appear.

Examples

			a(4) = 45, as a(4) must share a factor with a(3) = 6, have a prime factor not in 6, have no common factor with a(2) = 2, and not have tau(6) = 4 divisors. The smallest positive integer satisfying these conditions is 45. Note that A336957(4) = 15, but 15 has four divisors thus cannot be chosen here.
		

Crossrefs

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

A360519 Let C consist of 1 together with all numbers with at least two distinct prime factors; this is the lexicographically earliest infinite sequence {a(n)} of distinct elements of C such that, for n>2, a(n) has a common factor with a(n-1) but not with a(n-2).

Original entry on oeis.org

1, 6, 10, 35, 21, 12, 20, 55, 33, 18, 14, 77, 99, 15, 40, 22, 143, 39, 24, 28, 91, 65, 30, 34, 119, 63, 36, 26, 221, 51, 42, 38, 95, 45, 48, 44, 187, 85, 50, 46, 69, 57, 76, 52, 117, 75, 70, 58, 87, 93, 62, 56, 105, 111, 74, 68, 153, 123, 82, 80, 115, 161, 84, 60, 145, 203, 98, 54, 129, 215, 100, 66, 141
Offset: 1

Views

Author

Keywords

Comments

In other words, C contains all positive numbers except powers of primes p^k, k>=1.
This is a modified version of the Enots Wolley sequence A336957. The modification ensures that the sequence does not contain the prime 2.
Let Ker(k), the kernel of k, denote the set of primes dividing k. Thus Ker(36) = {2,3}, Ker(1) = {}.
Theorem: a(1)=1, a(2)=6; thereafter, a(n) is the smallest number m not yet in the sequence such that
(i) Ker(m) intersect Ker(a(n-1)) is nonempty,
(ii) Ker(m) intersect Ker(a(n-2)) is empty, and
(iii) The set Ker(m) \ Ker(a(n-1)) is nonempty.
Conjecture: The sequence is a permutation of C.

Crossrefs

For a number of sequences related to this, see A361102 (the sequence C) and the following entries.

Programs

  • Maple
    with(numtheory);
    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]):
    A[1]:=1; A[2]:=6;
    for n from 3 do
      for k from 10 to N do
        if B[k] = 0 and igcd(k, A[n-1]) > 1 and igcd(k, A[n-2]) = 1 then
              if nops(factorset(k) minus factorset(A[n-1])) > 0 then
           A[n]:= k;
           B[k]:= 1;
           break;
              fi;
        fi
      od:
      if k > N then break; fi;
    od:
    s1:=[seq(A[i], i=1..n-1)];
  • Mathematica
    nn = 2^12; c[_] = False;
    f[x_] := f[x] = Times @@ FactorInteger[x][[All, 1]];
    MapIndexed[
     Set[{a[First[#2]], c[#1]}, {#1, True}] &, {1, 6}];
     u = 10; i = a[1]; j = a[2];
    Do[k = u;
      While[Nand[! PrimePowerQ[k], ! c[k],
        CoprimeQ[i, k], ! CoprimeQ[j, k], ! Divisible[j, f[k]]], k++];
      Set[{a[n], c[k], i, j}, {k, True, j, f[k]}];
      If[k == u, While[Or[c[u], PrimePowerQ[u]], u++]]
      , {n, 3, nn}];
    Array[a, nn] (* Michael De Vlieger, Mar 03 2023 *)

A347113 a(1)=1; for n > 1, a(n) is the smallest unused positive number k such that k != j and gcd(k,j) != 1, where j = a(n-1) + 1.

Original entry on oeis.org

1, 4, 10, 22, 46, 94, 5, 2, 6, 14, 3, 8, 12, 26, 9, 15, 18, 38, 13, 7, 16, 34, 20, 24, 30, 62, 21, 11, 27, 32, 36, 74, 25, 28, 58, 118, 17, 33, 40, 82, 166, 334, 35, 39, 42, 86, 29, 44, 48, 56, 19, 45, 23, 50, 54, 60, 122, 41, 49, 52, 106, 214, 43, 55, 63, 66
Offset: 1

Views

Author

Grant Olson, Aug 18 2021

Keywords

Comments

Alternative definition: Lexicographically earliest sequence of distinct positive numbers such that a(n) != a(n-1)+1 and gcd(a(n-1)+1,a(n)) > 1. This makes it a cousin of the EKG sequence A064413, the Yellowstone permutation A098550, the Enots Wolley sequence A336957, and others. - N. J. A. Sloane, Sep 01 2021; revised Nov 08 2021.
The successive gcd's are listed in A347309.

Examples

			a(1) = 1, by definition.
a(2) = 4; it cannot be 2, because 2 = a(1) + 1, and it cannot be 3, because gcd(a(1) + 1, 3) = 1.
a(3) = 10, because gcd(a(3), a(2) + 1) cannot equal 1. a(2) + 1 = 5, so a(3) must be a multiple of 5. It cannot be equal to 5, so it must be 10, the next available multiple of 5.
a(4) = 22, because 22 is the smallest positive integer not equal to 11 and not coprime to 11.
		

Crossrefs

See A347306 for the inverse, A347307, A347308 for the records, A347309 for the gcd values, A347312 for the parity of a(n), A347314 for the fixed points, and A348780 for partial sums.
For the main diagonal see (A348787(k), A348788(k)).

Programs

  • Maple
    b:= proc() true end:
    a:= proc(n) option remember; local j, k; j:= a(n-1)+1;
          for k from 2 do if b(k) and k<>j and igcd(k, j)>1
            then b(k):= false; return k fi od
        end: a(1):= 1:
    seq(a(n), n=1..100);  # Alois P. Heinz, Sep 02 2021
  • Mathematica
    Block[{a = {1}, c, k, m = 2}, Do[If[IntegerQ@Log2[i], While[IntegerQ[c[m]], m++]]; Set[k, m]; While[Or[IntegerQ[c[k]], k == # + 1, GCD[k, # + 1] == 1], k++] &[a[[-1]]]; AppendTo[a, k]; Set[c[k], i], {i, 65}]; a] (* Michael De Vlieger, Aug 18 2021 *)
  • PARI
    find(va, x) = {my(k=1, s=Set(va)); while ((k==x) || (gcd(k, x) == 1) || setsearch(s, k), k++); k;}
    lista(nn) = {my(va = vector(nn)); va[1] = 1; for (n=2, nn, va[n] = find(va, va[n-1]+1);); va;} \\ Michel Marcus, Aug 21 2021
    
  • Python
    from math import gcd
    A347113_list, nset, m = [1], {1}, 2
    for _ in range(100):
        j = A347113_list[-1]+1
        k = m
        while k == j or gcd(k,j) == 1 or k in nset:
            k += 1
        A347113_list.append(k)
        nset.add(k)
        while m in nset:
            m += 1 # Chai Wah Wu, Sep 01 2021

Extensions

Comments edited (including deletion of incorrect comments) by N. J. A. Sloane, Sep 05 2021
For the moment I am withdrawing my claim that this is a permutation of the positive integers. - N. J. A. Sloane, Sep 05 2022

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

A337136 a(1) = 1, a(2) = 2; for n > 1, a(n) = smallest positive number which has not yet appeared which has a common factor with a(n-2) + a(n-1).

Original entry on oeis.org

1, 2, 3, 5, 4, 6, 8, 7, 9, 10, 19, 29, 12, 41, 53, 14, 67, 15, 16, 31, 47, 13, 18, 62, 20, 22, 21, 43, 24, 134, 26, 25, 17, 27, 11, 28, 30, 32, 34, 33, 201, 36, 39, 35, 37, 38, 40, 42, 44, 46, 45, 49, 48, 97, 50, 51, 101, 52, 54, 56, 55, 57, 58, 23, 60, 83, 65
Offset: 1

Views

Author

Scott R. Shannon, Aug 18 2020

Keywords

Comments

Conjecture: This is a permutation of the natural numbers. Up to 1 million terms the only fixed points are 1,2,3,6,9,10, and it is likely that there are no others.

Examples

			a(5) = 4 as a(3) + a(4) = 3 + 5 = 8, and 4 is the smallest number that shares a common factor with 8 that has not yet appeared.
a(11) = 19 as a(9) + a(10) = 9 + 10 = 19, and as 19 is prime, a(11) must be the smallest multiple of 19 that has not yet appeared, being 19 in this case.
		

Crossrefs

Programs

  • Mathematica
    nn = 120;
    c[_] := False;
    Array[Set[{a[#], c[#]}, {#, True}] &, 2]; Set[{i, j, u},
     Range[3]]; s = i + j;
    Do[k = u;
     While[Or[c[k], CoprimeQ[s, k]], k++];
     Set[{a[n], c[k], i, j, s}, {k, True, j, k, j + k}];
     If[k == u, While[c[u], u++]], {n, 3, nn}];
    Array[a, nn] (* Michael De Vlieger, Oct 26 2023 *)
  • PARI
    lista(nn) = v=[1, 2]; for(n=3, nn, t=1; while(prod(X=1, n-1, v[X]-t)==0 || gcd(v[n-2]+v[n-1], t)==1, t++); v=concat(v, t); ); v; \\ Yifan Xie, May 18 2023

A352187 a(1)=1, a(2)=2; thereafter, a(n) is the smallest number m not yet in the sequence such that gcd(m,a(n-1)) > 1 and gcd(m,a(n-2))=1, except that the second condition is ignored if it would imply that no choice for m were possible.

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Mar 12 2022

Keywords

Comments

This is an intermediate sequence between the EKG sequence A064413 (which only involves the first condition) and the Enots Wolley sequence A336957 (which involves both conditions).
By ignoring the second condition when necessary we guarantee that a(n) always exists (because it always exists for the EKG sequence), and so no backtracking is needed in this sequence.
The second condition is ignored precisely when every prime that divides a(n-1) also divides a(n-2).
Conjecture 1: Every positive number appears.
Conjecture 2: The primes are the slowest numbers to appear. That is, when a prime p appears here, all numbers less than p have already appeared. To put this another way, the record high points in A352188 ("when does n appear") are exactly the primes (and 1).
Conjecture 3: When a prime p first divides some term, that term is 2*p, which is followed by p then 3p. [It seems possible that we could see 2*a, 6*b, 3*p, p, 2*p. This does not happen in the first 10000 terms, but I can't prove it never happens. I can prove that every prime divides some term, and that the primes appear in increasing order. Conjecture 3 might be refuted by a more extensive calculation.]

Crossrefs

Cf. A064413, A336957, A352188 (when n appears), A352189, A352190.
Records: A352191, A352192.

Programs

  • Maple
    # To produce the first 1000 terms:
    with(numtheory):
    omega := proc(n) nops(numtheory[factorset](n)) end proc:
    hit:=Array(1..100000,0);
    M:=100000;
    a:=[1,2]; K:=1; L:=2; hit[1]:=1; hit[2]:=2;
    for n from 3 to 1000 do
    sw1:=0;
    # find a[n]
    if factorset(L) subset factorset(K) then
    # use EKG rule
      for i from 1 to M do
        if hit[i]=0 and igcd(i,L)>1 then a:=[op(a),i]; K:=L; L:=i; hit[i]:=n; sw1:=1; break; fi;
      od:
      if sw1=0 then error("failed EKG, n, i =", n,i); fi;
    else
    # use Enots Wolley rule
      for i from 1 to M do
        if hit[i]=0 and igcd(i,L)>1 and igcd(i,K)=1 then a:=[op(a),i]; K:=L; L:=i; hit[i]:=n; sw1:=1; break; fi;
      od:
      if sw1=0 then error("failed WOLLEY, n, i =", n,i); fi;
    fi:
    od:
    a;
  • Python
    from math import gcd
    from itertools import count, islice
    from sympy import primefactors
    def A352187_gen(): # generator of terms
        bset, blist, mmax = {1,2}, [1,2], 3
        yield from blist
        while True:
            for m in count(mmax):
                if gcd(m,blist[-1]) > 1 and m not in bset:
                    if all(blist[-2] % p == 0 for p in primefactors(blist[-1])) or gcd(m,blist[-2]) == 1:
                        yield m
                        blist = [blist[-1],m]
                        bset.add(m)
                        while mmax in bset:
                            mmax += 1
                        break
    A352187_list = list(islice(A352187_gen(),20)) # Chai Wah Wu, Mar 14 2022

A270139 a(n)=n when n<=3, otherwise a(n) is the smallest unused positive integer which is not coprime to the two previous terms.

Original entry on oeis.org

1, 2, 3, 6, 9, 12, 15, 10, 5, 20, 25, 30, 35, 14, 7, 21, 28, 18, 4, 8, 16, 22, 24, 26, 32, 34, 36, 38, 40, 42, 44, 33, 11, 55, 66, 45, 27, 39, 48, 51, 54, 57, 60, 63, 56, 49, 70, 77, 84, 88, 46, 50, 52, 58, 62, 64, 68, 72, 74, 76, 78, 80, 65, 75, 85, 90, 95, 100, 105, 96
Offset: 1

Views

Author

Ivan Neretin, Mar 11 2016

Keywords

Comments

Other possible conditions on a(n) with respect to its common factors with a(n-2) and a(n-1) lead to the following:
Coprime to both: A084937.
Coprime to the latter and not the former: A098550.
Coprime to the former and not the latter: with any initial conditions, the sequence "paints itself into a corner", i.e., is finite. With the added condition of a(n) having an extra prime factor not contained in a(n-1), it is A336957.
Coprime to the latter, regardless of the former: simply A000027.
Coprime to the former, regardless of the latter: A121216.
Non-coprime to the latter, regardless of the former: A064413.
Non-coprime to the former, regardless of the latter: A121217.

Examples

			a(12) = 30, a(13) = 35, so a(14) must have common factors (possibly different) with 30 and 35, and the smallest unused number with that property turns out to be 14, so a(14) = 14.
		

Crossrefs

Programs

  • Mathematica
    a = {1, 2, 3}; Do[k = 1; While[(MemberQ[a, k] || GCD[a[[-1]], k] == 1 || GCD[a[[-2]], k] == 1), k++]; AppendTo[a, k], {n, 2, 68}]; a

A351001 a(0) = 0, a(1) = 1; for n > 1, a(n) is the smallest positive number which has not appeared which has a common factor with a(n-2) + a(n-1) but does not equal a(n-2) + a(n-1).

Original entry on oeis.org

0, 1, 2, 6, 4, 5, 3, 10, 26, 8, 12, 14, 13, 9, 11, 15, 16, 62, 18, 20, 19, 21, 22, 86, 24, 25, 7, 28, 30, 29, 118, 27, 35, 31, 32, 33, 39, 34, 146, 36, 38, 37, 40, 42, 41, 166, 23, 45, 17, 44, 122, 46, 48, 47, 50, 194, 52, 51, 206, 514, 54, 56, 55, 57, 49, 53, 58, 60, 59, 63, 61, 64
Offset: 0

Views

Author

Scott R. Shannon, Jan 28 2022

Keywords

Comments

This is a permutation of the natural numbers. Up to 500000 terms the fixed points are 0, 1, 2, 4, 5, 15, 16, 18, 21, 22, 24, 25, 29, and it is likely no more exist.

Examples

			a(3) = 6 as a(1)+a(2) = 3, 6 does not equal 3, and gcd(3,6) > 1.
a(4) = 4 as a(2)+a(3) = 8, 4 does not equal 8, and gcd(8,4) > 1.
		

Crossrefs

Programs

A356851 a(1) = 1, a(2) = 2, a(3) = 4; for n > 3, a(n) is the smallest positive number not occurring earlier such that a(n) shares a factor with the previous Omega(a(n)) terms.

Original entry on oeis.org

1, 2, 4, 6, 3, 9, 12, 15, 5, 10, 20, 14, 7, 21, 28, 35, 30, 25, 40, 45, 50, 18, 22, 8, 16, 24, 26, 13, 39, 52, 65, 78, 60, 33, 11, 44, 55, 66, 70, 34, 17, 51, 68, 85, 102, 90, 38, 19, 57, 76, 95, 114, 110, 46, 23, 69, 92, 115, 138, 130, 58, 29, 87, 116, 145, 174, 150, 62, 31, 93, 124, 155, 186
Offset: 1

Views

Author

Scott R. Shannon, Aug 31 2022

Keywords

Comments

For n > 250 the terms are concentrated along seven lines, see the linked images. Unlike the other six lines, numbers along the second lowest line are somewhat spread out, and these terms contain all numbers with Omega(a(n)) > 1. The lowest line contains all the primes, while the upper five lines contain terms with Omega(a(n)) = 2, 3, and 4. The primes up to n=100000 occur in their natural order except for 11 and 13 which are switched. The only fixed point beyond the first two terms is 10, and it is likely no more exist. The sequence is conjectured to be a permutation of the positive integers.

Examples

			a(8) = 15 as Omega(15) = A001222(15) = 2, and 15 shares a factor with the previous two terms, namely a(6) = 9 and a(7) = 12.
		

Crossrefs

Cf. A064413, A356850 (coprime to previous Omega(a(n)) terms), A001222, A093714, A336957, A000040
Previous Showing 31-40 of 127 results. Next