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.

A268330 Least squarefree number differing by more than n from any other squarefree number.

This page as a plain text file.
%I A268330 #33 Jun 16 2025 00:32:10
%S A268330 1,17,26,2526,5876126,8061827,8996188226,2074150570370
%N A268330 Least squarefree number differing by more than n from any other squarefree number.
%C A268330 1.8*10^12 < a(7) <= 10735237201449 - _Robert Israel_, Mar 18 2016
%C A268330 a(8) > 5*10^12. - _Giovanni Resta_, Apr 11 2016
%e A268330 a(2) = 26 because 26 is squarefree but 24,25,27,28 are not.
%t A268330 (* implementation assumes a(n) is increasing *)
%t A268330 nsfRun[n_]:=Module[{i=n}, While[!SquareFreeQ[i], i++]; i-n]
%t A268330 a268330[{low_, high_}, width_]:=Module[{k=width, i, next, r, s, list={}}, For[i=low, i<=high, i+=next, r=nsfRun[i]; If[r<k, next=r+1, s=nsfRun[i+r+1]; If[s<k, next=r+s+2, If[s==k, next=r+s+2, next=r+1]; AppendTo[list, {i,i+r,i+r+s}]; k++]]]; list] /; width>0 (* _Hartmut F. W. Hoft_, Mar 15 2016 *)
%t A268330 a268330[{0,10000000},1] (* computes a(1)...a(5) *)
%o A268330 (MATLAB)
%o A268330 B = 10^8; % blocks of size B
%o A268330 nB = 1000; % nB blocks
%o A268330 A = [1];
%o A268330 P = primes(floor(sqrt(nB*B)));
%o A268330 mmax = 1;
%o A268330 i0 = 1;
%o A268330 for k = 0:nB-1  % search squarefrees from i0+1 to i0 + B
%o A268330   V = true(1, B);
%o A268330   for i = 1:numel(P)
%o A268330     p = P(i);
%o A268330     V([(p^2 - mod(i0,p^2)):p^2:B]) = false;
%o A268330   end
%o A268330   SF = find(V) + i0;
%o A268330   DSF = SF(2:end) - SF(1:end-1);
%o A268330   i0 = SF(end-2);
%o A268330   M = min(DSF(1:end-1), DSF(2:end));
%o A268330   newmax = max(mmax,max(M));
%o A268330   for i = mmax+1:newmax
%o A268330     A(i) = SF(1 + find(M>=i, 1, 'first'));
%o A268330   end
%o A268330   mmax = newmax;
%o A268330 end
%o A268330 for i=1:mmax
%o A268330   fprintf('%d ',A(i));
%o A268330 end
%o A268330 fprintf('\n');  % _Robert Israel_, Mar 16 2016
%Y A268330 Cf. A073247, A268331, A268332, A268333, A268334.
%K A268330 nonn,more
%O A268330 0,2
%A A268330 _Christopher E. Thompson_, Feb 01 2016
%E A268330 a(6) from _Hartmut F. W. Hoft_, Mar 15 2016
%E A268330 a(7) from _Giovanni Resta_, Apr 11 2016