%I #16 Feb 22 2023 07:50:52
%S 1,2,9,35,1573,7429,707281,1315609,3397301,12780049,1855052713
%N Each term is the smallest positive integer both coprime to all earlier terms of the sequence and with a different number of divisors than all earlier terms. (a(1)=1.)
%o (PARI) isok(v, vd, nb, k) = {if (vecsearch(vd, numdiv(k)), return (0)); for (j=1, nb, if (gcd(k, v[j]) != 1, return (0));); 1;}
%o findk(v, nb) = {my(k = 1); my(vd = vecsort(vector(nb, j, numdiv(v[j])), , 8)); while (!isok(v, vd, nb, k), k++); k;}
%o lista(nn) = {va = vector(nn); print1(va[1] = 1, ", "); for (n=2, nn, k = findk(va, n-1); print1(va[n] = k, ", "););} \\ _Michel Marcus_, Feb 25 2016
%o (Python)
%o from math import gcd
%o from sympy import divisor_count
%o from itertools import count, islice
%o def agen(): # generator of terms
%o alst, d = [1], {1}
%o while True:
%o yield alst[-1]
%o d.add(divisor_count(alst[-1]))
%o k = alst[-1] + 1
%o while any(gcd(ai, k)!=1 for ai in alst) or divisor_count(k) in d:
%o k += 1
%o alst.append(k)
%o print(list(islice(agen(), 8))) # _Michael S. Branicky_, Feb 21 2023
%Y Cf. A175231.
%K more,nonn
%O 1,2
%A _Leroy Quet_, Mar 16 2010
%E a(6)-a(10) from _Michel Marcus_, Feb 25 2016
%E a(11) from _Michael S. Branicky_, Feb 22 2023
|