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 11-20 of 26 results. Next

A249050 a(n) = number of integers 2 <= i < A247665(n) that are not yet terms of A247665.

Original entry on oeis.org

0, 0, 0, 0, 1, 2, 1, 2, 3, 6, 7, 10, 9, 14, 13, 14, 19, 22, 23, 26, 31, 36, 37, 42, 45, 46, 45, 44, 49, 52, 51, 50, 55, 62, 65, 66, 69, 70, 73, 80, 85, 88, 93, 94, 103, 104, 109, 114, 117, 118, 121, 126, 127, 136, 135, 136, 135, 138, 139, 150, 161, 164, 163, 164
Offset: 1

Views

Author

N. J. A. Sloane, Oct 30 2014

Keywords

Comments

An alternative version to A249049. The latter is the main entry.

Crossrefs

Cf. A247665. Equals A249049(n)-1.

A249556 Odd numbers n such that 2n is a term in A247665.

Original entry on oeis.org

1, 7, 61, 433, 883, 2003, 4241, 6121, 26293, 52903
Offset: 1

Views

Author

N. J. A. Sloane, Nov 01 2014

Keywords

Comments

It appears that this list only contains 1 and primes.

Crossrefs

Cf. A247665.

A249559 Same definition as A247665, except first term is 3.

Original entry on oeis.org

3, 2, 5, 7, 4, 9, 11, 13, 17, 19, 8, 23, 15, 29, 31, 37, 41, 43, 47, 49, 53, 59, 16, 61, 67, 71, 25, 27, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 121, 127, 91, 131, 137, 139, 149, 151, 32, 157, 163, 167, 173, 179, 181, 191, 85, 193, 57, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263
Offset: 1

Views

Author

N. J. A. Sloane, Nov 02 2014

Keywords

Crossrefs

Cf. A247665.

Programs

  • Python
    from itertools import count, islice
    from math import gcd
    from collections import deque
    def A249559_gen(): # generator of terms
        aset, aqueue, c, f = {3}, deque([3]), 2, True
        yield 3
        while True:
            for m in count(c):
                if m not in aset and all(gcd(m,a) == 1 for a in aqueue):
                    yield m
                    aset.add(m)
                    aqueue.append(m)
                    if f: aqueue.popleft()
                    f = not f
                    while c in aset:
                        c += 1
                    break
    A249559_list = list(islice(A249559_gen(),50)) # Chai Wah Wu, May 19 2022
  • SageMath
    # from Nadia Heninger, Oct 28 2014: s is the starting point (2 in A247665, 3 here).
    def gen(s):
        sequence = [s]
        available = range(2, 2*s)
        available.pop(available.index(s))
        yield s
        while True:
            available.extend(range(available[-1]+1, next_prime(available[-1])+1))
            for i, e in enumerate(available):
                if all([gcd(e, sequence[j])==1 for j in range(-len(sequence)/2, 0)]):
                    available.pop(i)
                    sequence.append(e)
                    yield(e)
                    break
    g = gen(3)
    [g.next() for i in range(40)] # gets first 40 terms
    

A084937 Smallest number which is coprime to the last two predecessors and has not yet appeared; a(1)=1, a(2)=2.

Original entry on oeis.org

1, 2, 3, 5, 4, 7, 9, 8, 11, 13, 6, 17, 19, 10, 21, 23, 16, 15, 29, 14, 25, 27, 22, 31, 35, 12, 37, 41, 18, 43, 47, 20, 33, 49, 26, 45, 53, 28, 39, 55, 32, 51, 59, 38, 61, 63, 34, 65, 57, 44, 67, 69, 40, 71, 73, 24, 77, 79, 30, 83, 89, 36, 85, 91, 46, 75, 97, 52, 81
Offset: 1

Views

Author

Reinhard Zumkeller, Jun 13 2003

Keywords

Comments

Equivalently, this is the lexicographically earliest sequence of positive numbers satisfying the condition that each term is relatively prime to the next two terms. - N. J. A. Sloane, Nov 03 2014
Empirically, the points lie roughly on two lines: if n == 2 mod 3 then a(n) ~= 2n/3, otherwise a(n) ~= 4n/3. See A249680-A249683 for the three trisections, and see also the Sigrist scatterplot. - N. J. A. Sloane, Nov 03 2014, Nov 04 2014
All primes and prime powers occur, and the primes occur in their natural order. For any prime p, p occurs before p^2 before p^3, ...
Empirically, this is a permutation of the natural numbers, with inverse A084933: a(A084933(n))=A084933(a(n))=n. It seems that there are no further fixed points after {1,2,3,8,33,39}. Empirically, a(n) mod 2 = A011655(n+1); ABS(a(n)-n) < n; a(3*n+1)>n; a(3*n+2)Reinhard Zumkeller, Dec 16 2007
For a(n) mod 3 see A249603. - N. J. A. Sloane, Nov 03 2014
A249694(n) = GCD(a(n),a(n+3)). - Reinhard Zumkeller, Nov 04 2014

Crossrefs

Cf. A084933 (inverse), A103683, A121216, A247665, A090252, A249603 (read mod 3), A249680, A249681, A249682, A249683 (trisections), A249694, A011655, A249684 (numbers that take a record number of steps to appear), A249685.
Indices of primes: A249602, and of prime powers: A249575.
Running counts of missing numbers: A249686, A250099, A250100; A249777, A249856, A249857.
Where a(3n)>a(3n+1): A249689.
See also A353706, A353709, A353710.

Programs

  • Haskell
    import Data.List (delete)
    a084937 n = a084937_list !! (n-1)
    a084937_list = 1 : 2 : f 2 1 [3..] where
       f x y zs = g zs where
          g (u:us) | gcd y u > 1 || gcd x u > 1 = g us
                   | otherwise = u : f u x (delete u zs)
    -- Reinhard Zumkeller, Jan 28 2012
    
  • Maple
    N:= 1000: # to get a(n) until the first entry > N
    a[1]:= 1: a[2]:= 2:
    R:= {$3..N}:
    for n from 3 while R <> {} do
      success:= false;
      for r in R do
        if igcd(r,a[n-1]) = 1 and igcd(r,a[n-2])=1 then
           a[n]:= r;
           R:= R minus {r};
           success:= true;
           break
        fi
      od:
      if not success then break fi;
    od:
    seq(a[i], i = 1 .. n-1); # Robert Israel, Dec 12 2014
  • Mathematica
    lst={1,2,3}; unused=Range[4,100]; While[n=Select[unused, CoprimeQ[#, lst[[-1]]] && CoprimeQ[#, lst[[-2]]] &, 1]; n != {}, AppendTo[lst, n[[1]]]; unused=DeleteCases[unused, n[[1]]]]; lst
    f[s_] := Block[{k = 1, l = Take[s, -2]}, While[ Union[ GCD[k, l]] != {1} || MemberQ[s, k], k++]; Append[s, k]]; Nest[f, {1, 2}, 67] (* Robert G. Wilson v, Jun 26 2011 *)
  • PARI
    taken(k,t=v[k])=for(i=3,k-1, if(v[i]==t, return(1))); 0
    step(k,g)=while(gcd(k,g)>1, k++); k
    first(n)=local(v=vector(n,i,i)); my(nxt=3,t); for(k=3,n, v[k]=step(nxt, t=v[k-1]*v[k-2]); while(taken(k), v[k]=step(v[k]+1,t)); if(v[k]==t, while(taken(k+1,t++),))); v \\ Charles R Greathouse IV, Aug 26 2016
  • Python
    from math import gcd
    A084937_list, l1, l2, s, b = [1,2], 2, 1, 3, set()
    for _ in range(10**3):
        i = s
        while True:
            if not i in b and gcd(i,l1) == 1 and gcd(i,l2) == 1:
                A084937_list.append(i)
                l2, l1 = l1, i
                b.add(i)
                while s in b:
                    b.remove(s)
                    s += 1
                break
            i += 1 # Chai Wah Wu, Dec 09 2014
    

Extensions

Entry revised by N. J. A. Sloane, Nov 04 2014

A090252 The Two-Up sequence: a(n) is the least positive number not already used that is coprime to the previous floor(n/2) terms.

Original entry on oeis.org

1, 2, 3, 5, 4, 7, 9, 11, 13, 17, 8, 19, 23, 25, 21, 29, 31, 37, 41, 43, 47, 53, 16, 59, 61, 67, 71, 73, 55, 79, 27, 49, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 26, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 85, 121, 223, 227, 57, 229
Offset: 1

Views

Author

Amarnath Murthy, Nov 27 2003

Keywords

Comments

a(n) is coprime to the next n terms. - David Wasserman, Oct 24 2005
All values up to a(1000000) are either prime powers or semiprimes; this suggests the sequence is unlikely to be a permutation of the integers.
It appears that a(n) is even iff n = 3*2^k-1 for some k (A083356). - N. J. A. Sloane, Nov 01 2014
The even terms in the present sequence are listed in A354255.
We have a(1) = 1 and a(2) = 2. At step k >= 2, the sequence is extended by adding two terms: a(2*k-1) = smallest unused number which is relatively prime to a(k), a(k+1), ..., a(2*k-2), and a(2*k) = smallest unused number which is relatively prime to a(k), a(k+1), ..., a(2*k-1). So at step k=2 we add a(3)=3, a(4)=5; at step k=3 we add a(5)=4, a(6)=7; and so on. - N. J. A. Sloane, May 21 2022
Comments from N. J. A. Sloane, May 23 2022: (Start)
Conjecture 1. A090252 is a subsequence of A354144 (prime powers and semiprimes).
Conjecture 2. The terms of A354144 that are missing from A090252 are 6, 10, 14, 15, 22, 33, 34, 35, 38, 39, 46, 51, 58, 62, 65, 69, 74, 77, 82, 86, 87, 91, 93, 94, 95, 106, 111, 115, 118, 119, 122, 123, 129, 133, 134, 141, 142, 143, 145, 146, 155, 158, 166, 177, 178, 183, 185, 187, 194, 201, 202, 203, 209, 213, 214, 215, 218, 219, 221, ...
But since there is no proof that any one of these numbers is really missing, this list cannot yet have an entry in the OEIS.
Let S_p = list of indices of terms in A090252 that are divisible by the prime p.
Conjecture 3. For a prime p, there are constants v_1, v_2, ..., v_K and c such that
S_p = { v_1, v_2, ..., v_k, lambda*2^i - 1, i >= c}.
For example, from Michael S. Branicky's 10000-term b-file, it appears that:
S_2 = { 3*2^k-1, k >= 0 } cf. A083329
S_3 = { 2^k-1, k >= 2 } cf. A000225
S_5 = { 4 then 15*2^k-1 k >= 0 } cf. A196305
S_7 = { 6, 15, then 33*2^k-1, k >= 0 }
S_11 = { 8, 29, then 61*2^k-1, k >= 0 }
S_13 = { 9, 47, 97*2^n-1, n >= 0 }
S_17 = { 10, 59, 121*2^n-1, n >= 0 }
S_19 = { 12, 63, 129*2^n-1, n >= 0 }
S_23 = { 13, 65, 133*2^n-1, n >= 0 }
S_29 = { 16, 121, 245*2^n-1, n >= 0 }
S_31 = { 17, 131, 265*2^n-1, n >= 0 }
The initial primes p and the corresponding values of lambda are:
p: 2 3 5 7 11 13 17 19 23 29 31
lambda:..3...1..15..33...61...97..121..129..133..245..265
(This sequence of lambdas does not seem to have any simpler explanation, is not in the OEIS, and cannot be since the terms shown are all conjectural.)
Conjecture 2 is a consequence of Conjecture 3. For example, 6 does not appear in A090252, since the sets S_2 and S_3 are disjoint.
Also 10 does not appear, since S_2 and S_5 are disjoint.
In fact 2*p for 3 <= p <= 11 does not appear, but 26 = 2*13 does appear since S_2 and S_13 have 47 in common.
Assuming the numbers that appear to be missing (see Conjecture 2) really are missing, the numbers that take a record number of steps to appear are 1, 2, 3, 4, 7, 8, 16, 26, 32, 64, 128, 206, 256, 478, 512, 933, ..., and the indices where they appear are 1, 2, 3, 5, 6, 11, 23, 47, 95, 191, 383, 767, 1535, 3071, 6143, 8191, .... These two sequences are not yet in the OEIS, and cannot be added since the terms are all conjectural.
(End)
From N. J. A. Sloane, Jun 06 2022 (Start)
Theorem: (a) a(n) <= prime(n-1) for all n >= 2 (cf. A354154).
(b) A stronger upper bound is the following. Let c(n) = A354166(n) denote the number of nonprime terms among a(1) .. a(n). Note c(1)=1. Then a(n) <= prime(n-c(n)) for n <> 7 and 14.
It appears that a(n) = prime(n-c(n)) for almost all n. That is, this is the equation to the line in the graph that contains most of the terms.
For example, a(34886) = 408710 (see the b-file) = prime(34886 - A354166(34886)) = prime(34886 - 374) = prime(34512) = 408710.
Another example: Consider Russ Cox's table of the first N = 5764982 terms. We see that a(5764982) = 99999989 = prime(5761455) = prime(N - 3527) which agrees with c(N) = 3527 (from the first Russ Cox link).
(End)
If we consider the May 23 2022 comment, note the conjectured indices show near complete overlap with terms of A081026: 1, 2, 3, 5, 6, 11, 23, 47, 95, 191, 383, 767, 1535, 3071, 6143, 8191. - Bill McEachen, Aug 09 2024

Crossrefs

See A247665 for the case when the numbers are required to be at least 2. A353730 is another version.
For a squarefree analog, see A354790, A354791, A354792.

Programs

Extensions

More terms from David Wasserman, Oct 24 2005

A354790 a(n) is the least positive squarefree number not already used that is coprime to the previous floor(n/2) terms.

Original entry on oeis.org

1, 2, 3, 5, 7, 11, 6, 13, 17, 19, 23, 29, 31, 35, 22, 37, 39, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 85, 89, 14, 97, 101, 103, 33, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 65, 233
Offset: 1

Views

Author

Keywords

Comments

A version of the Two-Up sequence A090252 that is restricted to squarefree numbers.

Crossrefs

See A354791 and A354792 for the nonprime terms.
See A355895 for the even terms.

Programs

  • C
    // See Links section.
  • Maple
    # A354790 = Squarefree version of the Two-Up sequence A090252
    # This produces 2*M terms in the array a
    # Assumes b117 is a list of sufficiently many squarefree numbers A005117
    # Test if u is relatively prime to all of a[i], i = i1..i2
    perpq:=proc(u,i1,i2) local i; global a;
    for i from i1 to i2 do if igcd(u,a[i])>1 then return(-1); fi; od: 1; end;
    a:=Array(1..10000,-1);
    hit:=Array(1..10000,-1); # 1 if i has appeared
    a[1]:=1; a[2]:=2; hit[1]:=1; hit[2]:=1;
    M:=100; M1 := 1000;
    for p from 2 to M do
    # step 1 want a[2p-1] relatively prime to a[p] ... a[2p-2]
    sw1:=-1;
    for j from 1 to M1 do
    c:=b117[j];
    if hit[c] = -1 and perpq(c,p,2*p-2) = 1 then a[2*p-1]:=c; hit[c]:=1; sw1:=1; break; fi;
    od: # od j
    if sw1 = -1 then error("no luck, step 1, p =",p ); fi;
    # step 2 want a[2p] relatively prime to a[p] ... a[2p-1]
    sw2:=-1;
    for j from 1 to M1 do
    c:=b117[j];
    if hit[c] = -1 and perpq(c,p,2*p-1) = 1 then a[2*p]:=c; hit[c]:=1; sw2:=1; break; fi;
    od: # od j
    if sw2 = -1 then error("no luck, step 2, p =",p ); fi;
    od: # od p
    [seq(a[i],i=1..2*M)];
  • Mathematica
    nn = 60; pp[] = 1; k = r = 1; c[] = False; a[1] = 1; Do[Set[m, SelectFirst[Union@ Append[Times @@ # & /@ Subsets[#, {2, Infinity}], Prime[r]] &[Prime@ Select[Range[If[k == 1, r, k + 1]], p[Prime[#]] < n &]], ! c[#] &]]; Set[a[n], m]; (c[m] = True; If[PrimeQ[m], r++]; If[n > 1, Map[(Set[p[#], 2 n]; pp[#]++) &, #]]) &@ FactorInteger[m][[All, 1]]; While[pp[Prime[k]] > 2, k++], {n, 2, nn}]; Array[a, nn] (* Michael De Vlieger, Sep 06 2022 *)
  • PARI
    \\ See Links section.
    
  • Python
    from math import lcm, gcd
    from itertools import count, islice
    from collections import deque
    from sympy import factorint
    def A354790_gen(): # generator of terms
        aset, aqueue, c, b, f = {1}, deque([1]), 2, 1, True
        yield 1
        while True:
            for m in count(c):
                if m not in aset and gcd(m,b) == 1 and all(map(lambda n:n<=1,factorint(m).values())):
                    yield m
                    aset.add(m)
                    aqueue.append(m)
                    if f: aqueue.popleft()
                    b = lcm(*aqueue)
                    f = not f
                    while c in aset:
                        c += 1
                    break
    A354790_list = list(islice(A354790_gen(),30)) # Chai Wah Wu, Jul 17 2022
    

Extensions

More terms from Rémy Sigrist, Jul 17 2022

A353730 a(1)=2; thereafter a(n) is the smallest positive number not yet used which is compatible with the condition that a(n) is relatively prime to the next n terms.

Original entry on oeis.org

2, 1, 3, 4, 5, 7, 9, 11, 8, 13, 17, 19, 23, 25, 21, 29, 31, 37, 16, 41, 43, 47, 53, 59, 61, 67, 71, 73, 55, 79, 27, 49, 83, 89, 97, 101, 103, 107, 26, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 85, 121, 223
Offset: 1

Views

Author

N. J. A. Sloane, May 16 2022

Keywords

Comments

Similar to A247665, which is obtained if the condition "smallest positive number" is changed to "smallest number >= 2".
It would be nice to have a proof that the numbers 6, 10, 12, 14, 15, 18, 20, 22, ... are missing from this sequence. It appears that the missing numbers are 6, 10, 12, 14, 15, 18, 20, 22, 24, 28, 30, 33, 34, 35, 36, 38, 39, 40, 42, 44, ..., but since there is no proof that any one of these is really missing, this sequence cannot yet be added to the OEIS.

Examples

			a(1) = 2 must be rel. prime to a(2), so a(2)=1.
a(2) = 1 must be rel. prime to a(3) and a(4), so we can take them to be 3 and 4.
a(3) = 3 must be rel. prime to a(5), a(6), so we can take them to be 5 and 7.
a(4) = 4 must be rel. prime to a(7), a(8), so we can take them to be 9 and 11.
At each step after the first, we must choose two new numbers, and we must make sure that not only are they rel. prime to a(n), they are also rel. prime to all a(i), i>n, that have been already chosen.
		

Crossrefs

Cf. A247665; A353734 (powers of 2).
For the even terms, see A354146.

Programs

  • Python
    from itertools import count, islice
    from math import gcd
    from collections import deque
    def A353730_gen(): # generator of terms
        aset, aqueue, c, f = {2}, deque([2]), 1, True
        yield 2
        while True:
            for m in count(c):
                if m not in aset and all(gcd(m,a) == 1 for a in aqueue):
                    yield m
                    aset.add(m)
                    aqueue.append(m)
                    if f: aqueue.popleft()
                    f = not f
                    while c in aset:
                        c += 1
                    break
    A353730_list = list(islice(A353730_gen(),30)) # Chai Wah Wu, May 18-19 2022

A249064 Lexically first sequence of distinct positive integers such that a(n) is coprime to the next a(n) elements.

Original entry on oeis.org

1, 2, 3, 5, 4, 7, 9, 11, 13, 8, 17, 19, 23, 25, 29, 31, 21, 37, 16, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 22, 109, 113, 27, 35, 127, 131, 137, 139, 149, 151, 157, 163, 167, 169, 173, 179, 181, 191, 193, 197, 199, 211, 32, 121, 223, 227, 229, 233, 239, 241, 51, 251, 257, 263, 269, 271, 277, 281, 283, 49, 95
Offset: 1

Views

Author

Hugo van der Sanden, Oct 20 2014

Keywords

Comments

Described in this form, A090252 would be "lexically first sequence of positive integers such that a(n) is coprime to the next n elements".
(And A247665 would be "lexically first sequence of integers >= 2 such that a(n) is coprime to the next n elements". - N. J. A. Sloane, Nov 01 2014)
All values up to a(1000000) are either prime powers or semiprimes, except when n is in (868, 947, 993, 1069, 1205, 1431, 854300) with values respectively (172, 45, 75, 135, 225, 375, 9475). This suggests the sequence is unlikely to be a permutation of the integers.
If, mimicking A247665, one starts with a(1)=2 and uses the same rule (always using distinct numbers >= 2) one obtains A249064 again, without the leading 1. - N. J. A. Sloane, Nov 01 2014

Crossrefs

Extensions

Added "distinct" to the definition. - Hugo van der Sanden, Oct 28 2014

A354146 Even numbers in A353730 in order of appearance.

Original entry on oeis.org

2, 4, 8, 16, 26, 32, 64, 128, 206, 256, 454, 446, 512, 1024, 2048, 3142
Offset: 1

Views

Author

N. J. A. Sloane, May 21 2022

Keywords

Comments

A090252(1535) = 256 and A090252(3071) = 478 are also even terms in A090252; the latter breaks the correspondence with this sequence. - Michael S. Branicky, May 21 2022

Crossrefs

Extensions

Deleted an incorrect comment. - N. J. A. Sloane, May 25 2022

A354255 Even numbers in A090252 in order of appearance.

Original entry on oeis.org

2, 4, 8, 16, 26, 32, 64, 128, 206, 256, 478, 512, 998, 1024, 2048, 3134, 4096, 6514, 8192, 13942, 16384, 28894, 32768, 60518, 65536, 126634, 131072, 261398, 262144
Offset: 1

Views

Author

Michael S. Branicky, May 21 2022

Keywords

Comments

The n-th even term in A090252 appears at index k <= A083329(n).
Conjecture: The indices of even numbers in A090252 are precisely the numbers {A083329(n), n >= 1}. See A090252 for discussion. - N. J. A. Sloane, May 22 2022
Taking logs to base 2 of these terms produces 1., 2., 3., 4., 4.700439718, 5., 6., 7., 7.686500527, 8., 8.900866807, 9., 9.962896004, 10., 11., 11.61378946, 12., 12.66932800, 13., 13.76714991, 14. - N. J. A. Sloane, Jun 01 2022

Crossrefs

Programs

  • Python
    from math import gcd, prod
    from itertools import count, islice
    def agen(): # generator of terms
        alst, aset, mink = [1], {1}, 2
        for n in count(2):
            k, s = mink, n - n//2
            prodall = prod(alst[n-n//2-1:n-1])
            while k in aset or gcd(prodall, k) != 1: k += 1
            alst.append(k); aset.add(k)
            if k%2 == 0: yield k
            while mink in aset: mink += 1
    print(list(islice(agen(), 9))) # Michael S. Branicky, May 23 2022

Extensions

a(14) from Michael S. Branicky, May 26 2022
a(15)-a(21) from Michael S. Branicky, Jun 01 2022 using gzipped b-file in A090252
a(22)-a(26) from Hugo van der Sanden, Jun 14 2022
a(27)-a(29) from Jinyuan Wang, Jul 15 2022
Previous Showing 11-20 of 26 results. Next