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.

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

A248387 a(n) = index of n-th prime in A247665.

Original entry on oeis.org

1, 2, 4, 5, 8, 9, 10, 11, 12, 14, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 29, 30, 33, 34, 35, 36, 37, 38, 39, 41, 42, 43, 44, 45, 46, 47, 48, 49, 51, 52, 53, 54, 56, 58, 59, 60, 61, 62, 64, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81
Offset: 1

Views

Author

Russ Cox and N. J. A. Sloane, Oct 16 2014

Keywords

Crossrefs

Subsequence of A248918.

Programs

  • Haskell
    import Data.List (elemIndex); import Data.Maybe (fromJust)
    a248387 = (+ 1) . fromJust . (`elemIndex` a247665_list) . a000040
    -- Reinhard Zumkeller, Oct 16 2014

A248388 Indices of composite terms in A247665.

Original entry on oeis.org

3, 6, 7, 13, 15, 27, 28, 31, 32, 40, 50, 55, 57, 63, 65, 82, 101, 111, 112, 115, 116, 127, 131, 132, 165, 172, 203, 204, 223, 225, 231, 233, 255, 263, 264, 278, 331, 332, 358, 407, 408, 417, 447, 448, 451, 455, 463, 467, 511, 527, 557, 661, 663, 665, 717, 761
Offset: 1

Views

Author

Russ Cox and N. J. A. Sloane, Oct 16 2014

Keywords

Crossrefs

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

A248391 Terms in A247665 which are neither primes nor prime powers, in order of appearance.

Original entry on oeis.org

15, 14, 85, 57, 161, 319, 403, 259, 451, 559, 235, 901, 177, 1159, 1541, 781, 2117, 1027, 2573, 445, 1649, 1121, 122, 707, 851, 1133, 2911, 3103, 1417, 3397, 3503, 415, 4183, 2159, 5141, 393, 2603, 244, 973, 2323, 5513, 10117, 4223, 4553, 11899, 2171, 7439, 5549, 8507, 3247, 6731, 579, 2489, 8083, 1379, 3197
Offset: 1

Views

Author

Russ Cox and N. J. A. Sloane, Oct 16 2014

Keywords

Crossrefs

A248381 Multiples of 3 in A247665 in order of appearance.

Original entry on oeis.org

9, 15, 27, 57, 81, 177, 243, 393, 579, 729, 849, 1257, 2187, 4197, 4143, 5853, 6561, 17817, 17781, 19683, 56157, 59049, 104289, 104277, 154509
Offset: 1

Views

Author

Russ Cox and N. J. A. Sloane, Oct 12 2014

Keywords

Comments

The initial multiples of 3 occur at positions 6,13,28,57,115,231, ... - conjecturally, for n > 13, A247665(n) is a multiple of 3 iff n = 29*2^k-1, k >= 0.

Examples

			Table showing index where multiples of 3 appear, the multiple of 3, and the number of different prime factors of that term:
6 9 1
13 15 2
28 27 1
57 57 2
115 81 1
231 177 2
463 243 1
927 393 2
1855 579 2
3711 729 1
7423 849 2
14847 1257 2
29695 2187 1
59391 4197 2
118783 4143 2
237567 5853 2
475135 6561 1
950271 17817 2
1900543 17781 2
3801087 19683 1
7602175 56157 2
15204351 59049 1
30408703 104289 2
60817407 104277 2
121634815 154509 2
		

Crossrefs

Cf. A247665, A248379 (multiples of 2).
Showing 1-7 of 7 results.