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-4 of 4 results.

A249557 Indices of even terms in A249064.

Original entry on oeis.org

2, 5, 10, 19, 36, 59, 92, 139, 202, 267, 362, 485, 614, 781, 868, 1041, 1248, 1475, 1730, 1987, 2266, 2601, 2964, 3359, 3806, 4205, 4672, 5185, 5712, 6195, 6698, 7313, 7948, 8643, 9378, 10053, 10800, 11579, 12418, 13297, 14196, 15039, 15966, 16925, 17908
Offset: 1

Views

Author

N. J. A. Sloane, Nov 01 2014

Keywords

Crossrefs

Cf. A249064.

Extensions

More terms from Lars Blomberg, May 01 2019

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

A247665 a(1)=2; thereafter a(n) is the smallest number >= 2 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, 3, 4, 5, 7, 9, 8, 11, 13, 17, 19, 23, 15, 29, 14, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 25, 27, 79, 83, 16, 49, 89, 97, 101, 103, 107, 109, 113, 121, 127, 131, 137, 139, 149, 151, 157, 163, 167, 169, 173, 179, 181, 191, 85, 193, 57, 197, 199, 211, 223
Offset: 1

Views

Author

N. J. A. Sloane, Oct 06 2014 and Oct 08 2014

Keywords

Comments

It appears that a(k) is even iff k = 2^i-1 (cf. A248379). It also appears that all powers of 2 occur in the sequence. (Amarnath Murthy)
The indices of even terms and their values are [1, 2], [3, 4], [7, 8], [15, 14], [31, 16], [63, 32], [127, 64], [255, 128], [511, 122], ...
Will the numbers 6, 10, 21, 22, ... ever occur? 12, 18, 20, ... are also missing, but if 6 never appears then neither will 12, etc.
A related question: are all terms deficient? - Peter Munn, Jul 20 2017
It appears that the missing numbers are 6, 10, 12, 18, 20, 21, 22, 24, 26, 28, 30, 33, 34, 35, 36, 38, 39, 40, 42, ..., but since there is no proof that any one of these is really missing, this sequence cannot yet be added to the OEIS. - N. J. A. Sloane, May 18 2022

Examples

			a(1) = 2 must be rel. prime to a(2), so a(2)=3.
a(2) = 3 must be rel. prime to a(3) and a(4), so we can take them to be 4 and 5.
a(3) = 4 must be rel. prime to a(5), a(6), so we must take them to be 7,9.
a(4) = 5 must be rel. prime to a(7), a(8), so we must take them to be 8,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.
		

References

Crossrefs

Indices of primes and prime powers: A248387, A248918.
Lengths of runs of primes: A249033.
A090252 = similar to A247665 but start with a(1)=1. A249559 starts with a(1)=3.
A249064 is a different generalization.
A064413 is another similar sequence.

Programs

  • Haskell
    a247665 n = a247665_list !! (n-1)
    a247665_list = 2 : 3 : f [3] [4..] where
       f (x:xs) zs = ys ++ f (xs ++ ys) (zs \\ ys) where
         ys = [v, head [w | w <- vs, gcd v w == 1]]
         (v:vs) = filter (\u -> gcd u x == 1 && all ((== 1) . (gcd u)) xs) zs
    -- Reinhard Zumkeller, Oct 09 2014
    
  • PARI
    m=100; v=vector(m); u=vectorsmall(100*m); for(n=1, m, for(i=2, 10^9, if(!u[i], for(j=(n+1)\2, n-1, if(gcd(v[j], i)>1, next(2))); v[n]=i; u[i]=1; break))); v \\ Jens Kruse Andersen, Oct 08 2014
    
  • Python
    from itertools import count, islice
    from math import gcd
    from collections import deque
    def A247665_gen(): # generator of terms
        aset, aqueue, c, f = {2}, deque([2]), 3, 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
    A247665_list = list(islice(A247665_gen(),50)) # Chai Wah Wu, May 19 2022
  • Sage
    # s is the starting point (2 in A247665).
    def gen(s):
        sequence = [s]
        available = list(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(2)
    [next(g) for i in range(40)]  # (gets first 40 terms of A247665)
    # Nadia Heninger, Oct 28 2014
    

Extensions

More terms from Jens Kruse Andersen, Oct 06 2014
Further terms from Russ Cox, Oct 08 2014
Added condition a(n) >= 2 to definition. - N. J. A. Sloane, May 16 2022

A344307 a(n) is the smallest number not yet in the sequence that satisfies the following condition: if p is a prime factor of a(n), the next p terms are coprime to p.

Original entry on oeis.org

1, 2, 3, 5, 4, 7, 9, 8, 11, 13, 6, 17, 19, 10, 21, 23, 16, 29, 27, 20, 31, 37, 12, 41, 43, 14, 15, 47, 22, 53, 39, 32, 25, 49, 18, 59, 61, 34, 45, 67, 38, 71, 33, 28, 65, 73, 24, 79, 83, 46, 75, 89, 56, 97, 81, 44, 85, 101, 26, 87, 103, 62, 35, 57, 64, 107
Offset: 1

Views

Author

Sergio Pimentel, May 14 2021

Keywords

Comments

It is not clear if every positive integer is in the sequence.

Crossrefs

Programs

  • PARI
    See Links section.

Extensions

More terms from Rémy Sigrist, May 29 2021
Showing 1-4 of 4 results.