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.

A070321 Greatest squarefree number <= n.

This page as a plain text file.
%I A070321 #43 Jul 26 2025 08:06:56
%S A070321 1,2,3,3,5,6,7,7,7,10,11,11,13,14,15,15,17,17,19,19,21,22,23,23,23,26,
%T A070321 26,26,29,30,31,31,33,34,35,35,37,38,39,39,41,42,43,43,43,46,47,47,47,
%U A070321 47,51,51,53,53,55,55,57,58,59,59,61,62,62,62,65,66,67,67,69,70,71,71
%N A070321 Greatest squarefree number <= n.
%C A070321 a(n) = Max( core(k) : k=1,2,3,...,n ) where core(x) is the squarefree part of x (the smallest integer such that x*core(x) is a square).
%H A070321 Reinhard Zumkeller, <a href="/A070321/b070321.txt">Table of n, a(n) for n = 1..10000</a>
%H A070321 Mayank Pandey, <a href="https://arxiv.org/abs/2401.13981">Squarefree numbers in short intervals</a>, arXiv preprint (2024). arXiv:2401.13981 [math.NT]
%F A070321 a(n) = n - o(n^(1/5)) by a result of Pandey. - _Charles R Greathouse IV_, Dec 04 2024
%F A070321 a(n) = A005117(A013928(n+1)). - _Ridouane Oudra_, Jul 26 2025
%e A070321 From _Gus Wiseman_, Dec 10 2024: (Start)
%e A070321 The squarefree numbers <= n are the following columns, with maxima a(n):
%e A070321   1  2  3  3  5  6  7  7  7  10  11  11  13  14  15  15
%e A070321      1  2  2  3  5  6  6  6  7   10  10  11  13  14  14
%e A070321         1  1  2  3  5  5  5  6   7   7   10  11  13  13
%e A070321               1  2  3  3  3  5   6   6   7   10  11  11
%e A070321                  1  2  2  2  3   5   5   6   7   10  10
%e A070321                     1  1  1  2   3   3   5   6   7   7
%e A070321                              1   2   2   3   5   6   6
%e A070321                                  1   1   2   3   5   5
%e A070321                                          1   2   3   3
%e A070321                                              1   2   2
%e A070321                                                  1   1
%e A070321 (End)
%p A070321 A070321 := proc(n)
%p A070321     local a;
%p A070321     for a from n by -1 do
%p A070321         if issqrfree(a) then
%p A070321             return a;
%p A070321         end if;
%p A070321     end do:
%p A070321 end proc:
%p A070321 seq(A070321(n),n=1..100) ; # _R. J. Mathar_, May 25 2023
%t A070321 a[n_] :=For[ k = n, True, k--, If[ SquareFreeQ[k], Return[k]]]; Table[a[n], {n, 1, 100}] (* _Jean-François Alcover_, Mar 27 2013 *)
%t A070321 gsfn[n_]:=Module[{k=n},While[!SquareFreeQ[k],k--];k]; Array[gsfn,80] (* _Harvey P. Dale_, Mar 27 2013 *)
%o A070321 (PARI) a(n) = while (! issquarefree(n), n--); n; \\ _Michel Marcus_, Mar 18 2017
%o A070321 (Python)
%o A070321 from itertools import count
%o A070321 from sympy import factorint
%o A070321 def A070321(n): return next(m for m in count(n,-1) if max(factorint(m).values(),default=0)<=1) # _Chai Wah Wu_, Dec 04 2024
%Y A070321 Cf. A007947, A076260.
%Y A070321 Cf. A081217, A081218, A081210.
%Y A070321 The distinct terms are A005117 (the squarefree numbers).
%Y A070321 The opposite version is A067535, differences A378087.
%Y A070321 The run-lengths are A076259.
%Y A070321 Restriction to the primes is A112925; see A378038, A112926, A378037.
%Y A070321 For nonsquarefree we have A378033; see A120327, A378036, A378032, A377783.
%Y A070321 First differences are A378085.
%Y A070321 Subtracting each term from n gives A378619.
%Y A070321 A013929 lists the nonsquarefree numbers, differences A078147.
%Y A070321 A061398 counts squarefree numbers between primes, zeros A068360.
%Y A070321 A061399 counts nonsquarefree numbers between primes, zeros A068361.
%Y A070321 Cf. A007674, A013928, A053797, A053806, A072284, A073247, A112929, A240473.
%K A070321 easy,nonn
%O A070321 1,2
%A A070321 _Benoit Cloitre_, May 11 2002
%E A070321 New description from _Reinhard Zumkeller_, Oct 03 2002