cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A374536 a(n) is the least exponentially odd number that is nonsquarefree and is followed by exactly n successive exponentially odd numbers that are squarefree, or -1 if no such number exists.

Original entry on oeis.org

135, 24, 120, 27, 96, 88, 32, 40, 328, 168, 136, 104, 1288, 1161, 352, 488, 8, 783, 189, 952, 4520, 56, 11576, 67384, 5088, 1336, 35768, 16173, 53768, 80328, 128169, 28576, 247375, 208552, 2556192, 1486568, 3099368, 1653032, 910568, 7864008, 34242976, 14484152
Offset: 0

Views

Author

Amiram Eldar, Jul 11 2024

Keywords

Examples

			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.
		

Crossrefs

Programs

  • 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]
  • 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; }

Formula

a(n) = A268335(A374460(k)), where k is the least number such that A374459(k+1) - A374459(k) = n + 1.