OFFSET
0,2
COMMENTS
LINKS
Amiram Eldar, Table of n, a(n) for n = 0..176
EXAMPLE
a(1) = 8 since 8 is the least number that has exactly one non-unitary square divisor, 4.
MATHEMATICA
f1[p_, e_] := 1 + Floor[e/2]; f2[p_, e_] := 2^(1 - Mod[e, 2]); f[1] = 0; f[n_] := Times @@ f1 @@@ (fct = FactorInteger[n]) - Times @@ f2 @@@ fct; seq[len_, nmax_] := Module[{s = Table[0, {len}], c = 0, n = 1, i}, While[c < len && n < nmax, i = f[n] + 1; If[i <= len && s[[i]] == 0, c++; s[[i]] = n]; n++]; s]; seq[21, 10^6]
PROG
(PARI) s(n) = {my(f = factor(n)); prod(i = 1, #f~, 1 + floor(f[i, 2]/2)) - 2^sum(i = 1, #f~, 1 - f[i, 2]%2); }
lista(len, nmax) = {my(v = vector(len), c = 0, n = 1, i); while(c < len && n < nmax, i = s(n) + 1; if(i <= len && v[i] == 0, c++; v[i] = n); n++); v};
CROSSREFS
KEYWORD
nonn
AUTHOR
Amiram Eldar, Nov 05 2022
STATUS
approved