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.

A378033 Greatest nonsquarefree number <= n, or 1 if there is none (the case n <= 3).

Original entry on oeis.org

1, 1, 1, 4, 4, 4, 4, 8, 9, 9, 9, 12, 12, 12, 12, 16, 16, 18, 18, 20, 20, 20, 20, 24, 25, 25, 27, 28, 28, 28, 28, 32, 32, 32, 32, 36, 36, 36, 36, 40, 40, 40, 40, 44, 45, 45, 45, 48, 49, 50, 50, 52, 52, 54, 54, 56, 56, 56, 56, 60, 60, 60, 63, 64, 64, 64, 64, 68
Offset: 1

Views

Author

Gus Wiseman, Nov 18 2024

Keywords

Examples

			The nonsquarefree numbers <= 10 are {4, 8, 9}, so a(10) = 9.
		

Crossrefs

For prime-powers we have A031218, differences A377782.
Greatest of the nonsquarefree numbers counted by A057627.
The opposite for squarefree is A067535, differences A378087.
For squarefree we have A070321, differences A378085.
The opposite is A120327 (union A162966), differences A378039.
The restriction to the primes is A378032, opposite A377783 (union A378040).
First-differences are A378036, restriction A378034.
A000040 lists the primes, differences A001223, seconds A036263.
A005117 lists the squarefree numbers, differences A076259, seconds A376590.
A013929 lists the nonsquarefree numbers, differences A078147, seconds A376593.
A061398 counts squarefree numbers between primes (sums A337030), zeros A068360.
A061399 counts nonsquarefree numbers between primes (sums A378086), zeros A068361.
A112925 gives the greatest squarefree number < prime(n), differences A378038.
A112926 gives the least squarefree number > prime(n), differences A378037.
A377046 encodes k-differences of nonsquarefree numbers, zeros A377050.

Programs

  • Mathematica
    Table[NestWhile[#-1&,n,#>1&&SquareFreeQ[#]&],{n,100}]
  • PARI
    a(n) = my(k=n); while (issquarefree(k), k--); if(!k, 1, k); \\ Michel Marcus, Jul 26 2025

Formula

a(prime(n)) = A378032(n).
a(n) = A013929(A057627(n)), for n > 3. - Ridouane Oudra, Jul 26 2025