OFFSET
1,2
COMMENTS
Permutation of the positive integers, a "Yellowstone" version of A350150, having similar characteristics to the latter. The sequence interleaves squares a(2n+1) having odd tau with nonsquares a(2n) having even tau. Numbers with the same tau appear in their natural order (primes, squares, etc).
EXAMPLE
a(1)=1, a(2)=2, a(3)=4, with number of divisors 1,2,3 respectively.
a(4) must be 3 because d(3)=2, which is prime to d(a(3))=d(4)=3 and to d(a(1))=d(1)=1 but it is not prime to d(a(2))=d(2)=2, and 3 is the least unused number with this property.
MATHEMATICA
Nest[Block[{a = #1, i = #2, j = #3, k = #4, m = 3}, While[Nand[FreeQ[a, m], CoprimeQ[#, i], ! CoprimeQ[#, j], CoprimeQ[#, k]] &@DivisorSigma[0, m], m++]; Append[#1, m]] & @@ Join[{#}, DivisorSigma[0, #[[-3 ;; -1]]]] &, {1, 2, 4}, 58] (* Michael De Vlieger, Jan 15 2022 *)
PROG
(PARI) isok(k, ndx, ndy, ndz, set) = {if (!setsearch(set, k), my(ndk=numdiv(k)); (gcd(ndx, ndk)==1) && (gcd(ndy, ndk)!=1) && (gcd(ndz, ndk)==1); ); }
lista(nn) = {my(x=1, y=2, z=4, list=List([x, y, z]), set = Set(list)); for (n=4, nn, my(k=1, ndx=numdiv(x), ndy=numdiv(y), ndz=numdiv(z)); while (!isok(k, ndx, ndy, ndz, set), k++); listput(list, k); set = Set(list); x=y; y=z; z=k; ); Vec(list); } \\ Michel Marcus, Jan 16 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
David James Sycamore, Dec 22 2021
EXTENSIONS
More terms from Michael De Vlieger, Dec 24 2021
STATUS
approved