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.

A378619 Distance between n and the greatest squarefree number <= n.

This page as a plain text file.
%I A378619 #13 Jan 29 2025 17:30:58
%S A378619 0,0,0,1,0,0,0,1,2,0,0,1,0,0,0,1,0,1,0,1,0,0,0,1,2,0,1,2,0,0,0,1,0,0,
%T A378619 0,1,0,0,0,1,0,0,0,1,2,0,0,1,2,3,0,1,0,1,0,1,0,0,0,1,0,0,1,2,0,0,0,1,
%U A378619 0,0,0,1,0,0,1,2,0,0,0,1,2,0,0,1,0,0,0,1,0,1,0,1,0,0,0,1,0,1,2,3,0,0,0,1,0
%N A378619 Distance between n and the greatest squarefree number <= n.
%H A378619 Antti Karttunen, <a href="/A378619/b378619.txt">Table of n, a(n) for n = 1..30000</a>
%F A378619 a(n) = n - A070321(n).
%t A378619 Table[n-NestWhile[#-1&,n,!SquareFreeQ[#]&],{n,100}]
%o A378619 (Python)
%o A378619 from itertools import count
%o A378619 from sympy import factorint
%o A378619 def A378619(n): return n-next(m for m in count(n,-1) if max(factorint(m).values(),default=0)<=1) # _Chai Wah Wu_, Dec 14 2024
%o A378619 (PARI) A378619(n) = forstep(k=n,1,-1,if(issquarefree(k), return(n-k))); \\ _Antti Karttunen_, Jan 29 2025
%Y A378619 Positions of 0 are A005117.
%Y A378619 Positions of first appearances are A020755 - 1.
%Y A378619 Positions of 1 are A053806.
%Y A378619 Subtracting each term from n gives A070321.
%Y A378619 The opposite version is A081221.
%Y A378619 Restriction to the primes is A240473, opposite A240474.
%Y A378619 A013929 lists the nonsquarefree numbers, differences A078147.
%Y A378619 A061398 counts squarefree numbers between primes, zeros A068360.
%Y A378619 A061399 counts nonsquarefree numbers between primes, zeros A068361.
%Y A378619 Cf. A007674, A013928, A053797, A072284, A073247, A076259, A280892.
%Y A378619 Cf. A007947, A067535, A081217, A112925.
%K A378619 nonn
%O A378619 1,9
%A A378619 _Gus Wiseman_, Dec 12 2024
%E A378619 Data section extended to a(105) by _Antti Karttunen_, Jan 29 2025