A354146 Even numbers in A353730 in order of appearance.
2, 4, 8, 16, 26, 32, 64, 128, 206, 256, 454, 446, 512, 1024, 2048, 3142
Offset: 1
Extensions
Deleted an incorrect comment. - N. J. A. Sloane, May 25 2022
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.
A353730(79) = 32, so 79 is a term.
A353730(8) = 11 = prime(5), so a(5) = 8.
nn = 120; c[] = 0; a[1] = c[1] = 1; u = 2; Do[k = u; While[Nand[c[k] == 0, AllTrue[Array[a[i - #] &, Floor[i/2]], CoprimeQ[#, k] &]], k++]; Set[{a[i], c[k]}, {k, i}]; If[k == u, While[c[u] > 0, u++]], {i, 2, nn}]; Array[a, nn] (* _Michael De Vlieger, May 21 2022 *)
A090252_first(N, U=[0], L=List())=vector(N, i, for(k=U[1]+1, oo, setsearch(U, k) && next; foreach(L,m, gcd(k,m)>1 && next(2)); bitand(i,1) || listpop(L,1); listput(L,k); if( k>U[1]+1, U=setunion(U,[k]), U[1]++; while(#U>1 && U[2]==U[1]+1, U=U[^1]));break); L[#L]) \\ M. F. Hasler, Jun 14 2022
from math import gcd, prod from itertools import count, islice def agen(): # generator of terms alst = [1]; aset = {1}; yield 1 mink = 2 for n in count(2): k, prodall = mink, 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); yield k while mink in aset: mink += 1 print(list(islice(agen(), 64))) # Michael S. Branicky, May 21 2022
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.
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
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
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
# 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
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
from itertools import count, islice def ispow2(k): return bin(k).count("1") == 1 def agen(): # generator of terms A352808lst = [0, 1]; A352808set = {0, 1} k, mink, p = 1, 2, 2 for n in count(2): if ispow2(k): yield n-1 ahalf, k = A352808lst[n//2], mink while k in A352808set or k&ahalf: k += 1 A352808lst.append(k); A352808set.add(k) while mink in A352808set: mink += 1 print(list(islice(agen(), 8))) # Michael S. Branicky, May 18 2022 (C++) See Links section.
Comments