OFFSET
1,1
COMMENTS
The numbers of terms that do not exceed 10^k, for k = 3, 4, ..., are 7, 59, 556, 5539, 55329, 553188, 5531116, 55311354, ... . Apparently, the asymptotic density of this sequence exists and equals 0.005531... .
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000
EXAMPLE
135 is a term since both 135 = 3^3 * 5 and 136 = 2^3 * 17 are nonsquarefree exponentially odd numbers.
MATHEMATICA
q[n_] := q[n] = Module[{e = FactorInteger[n][[;; , 2]]}, AllTrue[e, OddQ] && ! AllTrue[e, # == 1 &]]; Select[Range[10000], q[#] && q[# + 1] &]
PROG
(PARI) is1(k) = {my(e = factor(k)[, 2]); for(i = 1, #e, if(!(e[i] %2), return(0))); for(i = 1, #e, if(e[i] >1, return(1))); 0; }
lista(kmax) = {my(q1 = is1(1), q2); for(k = 2, kmax, q2 = is1(k); if(q1 && q2, print1(k-1, ", ")); q1 = q2); }
CROSSREFS
KEYWORD
nonn
AUTHOR
Amiram Eldar, Jul 09 2024
STATUS
approved