|
|
A086539
|
|
Beginning with 1, a(n) = smallest number > a(n-1) and coprime to the k previous terms, where k = floor(n/2).
|
|
2
|
|
|
1, 2, 3, 5, 7, 8, 9, 11, 13, 17, 19, 23, 25, 28, 29, 31, 33, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 80, 83, 89, 91, 97, 101, 103, 107, 109, 111, 113, 121, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 230, 233
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
COMMENTS
|
|
|
LINKS
|
|
|
EXAMPLE
|
a(7) = 9 which is coprime to the three previous terms 5, 7 and 8.
|
|
MAPLE
|
R:= 1, 2: x:= 2:
for n from 3 to 100 do
t:= ilcm(R[ceil(n/2) .. n-1]);
for i from x+1 while igcd(i, t) <> 1 do od:
R:= R, i;
x:= i;
od:
|
|
PROG
|
(Python)
from math import gcd, lcm
from itertools import count, islice
def agen(): # generator of terms
alst, an, LCM, = [1], 1, 1
for n in count(2):
yield an
LCM = lcm(*alst[-(n//2):])
an = next(k for k in count(an+1) if gcd(k, LCM) == 1)
alst.append(an)
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|