A378033 Greatest nonsquarefree number <= n, or 1 if there is none (the case n <= 3).
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
Keywords
Examples
The nonsquarefree numbers <= 10 are {4, 8, 9}, so a(10) = 9.
Crossrefs
Greatest of the nonsquarefree numbers counted by A057627.
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).