OFFSET
0,1
LINKS
Amiram Eldar, Table of n, a(n) for n = 0..53
FORMULA
EXAMPLE
a(0) = 135 because 135 and 136 are successive nonsquarefree exponentially odd numbers with no squarefree number between them.
a(1) = 24 because 24 and 27 are successive nonsquarefree exponentially odd numbers with one squarefree number between them, 26.
a(2) = 120 because 120 and 125 are successive nonsquarefree exponentially odd numbers with two squarefree number between them, 122 and 123.
MATHEMATICA
sq[k_] := Module[{e = FactorInteger[k][[;; , 2]]}, If[AnyTrue[e, EvenQ], 0, If[k == 1 || Max[e] == 1, 2, 1]]]; seq[len_, kmax_ : Infinity] := Module[{v = Table[0, {len}], c = 0, k = 1, k0 = 0, m, i = 1}, While[c < len && k < kmax, m = sq[k]; If[m > 0, If[m == 2, i++, If[k0 > 0, If[i <= len && v[[i]] == 0, c++; v[[i]] = k0]; i = 1]; k0 = k]]; k++]; v]; seq[10]
PROG
(PARI) issq(k) = {my(e = factor(k)[, 2]); for(i = 1, #e, if(!(e[i] % 2), return(0))); if(k == 1 || vecmax(e) == 1, 2, 1); }
lista(len, kmax = oo) = {my(v = vector(len), c = 0, k = 1, k0 = 0, m, i = 1); while(c < len && k < kmax, m = issq(k); if(m > 0, if(m == 2, i++, if(k0 > 0, if(i <= len && v[i] == 0, c++; v[i] = k0); i = 1); k0 = k)); k++); v; }
CROSSREFS
KEYWORD
nonn
AUTHOR
Amiram Eldar, Jul 11 2024
STATUS
approved