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.

A077640 Smallest term of a run of at least 7 consecutive integers which are not squarefree.

This page as a plain text file.
%I A077640 #33 Jun 22 2025 21:32:37
%S A077640 217070,671346,826824,1092747,1092748,1427370,2097048,2779370,3112819,
%T A077640 3306444,3597723,3994820,4063774,4442874,4630544,4842474,5436375,
%U A077640 5479619,5610644,5634122,6315019,6474220,6626319,6677864,7128471,7216618,7216619,7295448,7507923
%N A077640 Smallest term of a run of at least 7 consecutive integers which are not squarefree.
%H A077640 Amiram Eldar, <a href="/A077640/b077640.txt">Table of n, a(n) for n = 1..10000</a> (terms 1..488 from Robert Israel)
%F A077640 A077640 = { A078144[k] | A078144[k+2] = A078144[k]+2 } = { A070284[k] | A070284[k+3] = A070284[k]+3 } etc. Note that A049535 is defined differently. - _M. F. Hasler_, Feb 01 2016
%F A077640 a(n) = A188347(n) - 3. - _Amiram Eldar_, Feb 09 2021
%e A077640 n=8870024: squares dividing n+j (j=0...8) i.e. 9 consecutive integers are as follows {4,25,121,841,4,49,961,9,16}.
%t A077640 s7[x_] := Apply[Plus, Table[Abs[MoebiusMu[x+j]], {j, 0, 6}]]; Do[If[s7[n] == 0, Print[n]], {n, 10^7}]
%t A077640 Flatten[Position[Partition[SquareFreeQ/@Range[7000000],7,1],_?(Union[#] == {False}&),{1},Heads->False]] (* _Harvey P. Dale_, May 24 2014 *)
%t A077640 SequencePosition[Table[If[SquareFreeQ[n],0,1],{n,72*10^5}],{1,1,1,1,1,1,1}][[All,1]] (* Requires Mathematica version 10 or later *) (* _Harvey P. Dale_, Aug 15 2017 *)
%o A077640 (MATLAB)
%o A077640 N = 10^7; % to get all terms <= N-6
%o A077640 T = zeros(1,N);
%o A077640 for m = 2:floor(sqrt(N))
%o A077640    T([m^2 : m^2 : N]) = 1;
%o A077640 end
%o A077640 S = T(1:N-6).*T(2:N-5).*T(3:N-4).*T(4:N-3).*T(5:N-2).*T(6:N-1).*T(7:N);
%o A077640 find(S)  % _Robert Israel_, Feb 03 2016
%o A077640 (PARI) {my(N=10^6, M=0, t, m2); for(m=2,sqrtint(N), t=1; m2=m^2; M=bitor(sum(i=1,N\m^2,t<<=m2),M)); for(i=1,6,M=bitand(M,M>>1)); for(i=0,N,M||break;print1(i+=t=valuation(M,2),",");M>>=t+1)} \\ Works but is much slower than the following (16s for 10^6 vs. 3s for 10^7). Should scale better (~sqrt(n) vs linear) but doesn't because of inefficient implementation of binary operations (copies & re-allocation of very large bitmaps): increasing N from 10^5 to 10^6 multiplies CPU time by a factor of 100!
%o A077640 (PARI) for(n=1,10^7,forstep(k=6,0,-1,issquarefree(n+k)&&(n+=k)&&next(2));print1(n",")) \\ _M. F. Hasler_, Feb 03 2016
%Y A077640 Cf. A013929, A045882, A049535, A051681, A188347.
%Y A077640 Cf. A068781 (2-chains), A070258 (3-chains), A070284 (4-chains), A078144 (5-chains), A049535 (6-chains), A077640 (7-chains), A077647 (8-chains), A078143 (9-chains), A268313 (10-chains), A268314 (11-chains).
%K A077640 nonn
%O A077640 1,1
%A A077640 _Labos Elemer_, Nov 14 2002