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.

A373552 a(n) is the least start of a run of exactly n successive squarefree numbers (A005117) that are even, or -1 if no such run exists.

This page as a plain text file.
%I A373552 #11 Jun 14 2024 11:53:57
%S A373552 2,422,2522,1674274,24697404970,4014578863358
%N A373552 a(n) is the least start of a run of exactly n successive squarefree numbers (A005117) that are even, or -1 if no such run exists.
%e A373552 a(1) = 2, since 2 is an even squarefree number, preceded by an odd squarefree number, 3, and followed by an odd squarefree number, 3.
%e A373552 a(2) = 422, since 422 and 426 are two successive squarefree numbers that are even, preceded by an odd squarefree number, 421, and followed by an odd squarefree number, 427.
%e A373552 The first 4 terms and the corresponding sets of successive squarefree numbers are:
%e A373552   n |         a(n)  | The n successive squarefree numbers
%e A373552   --|---------------|------------------------------------
%e A373552   1 |            2  | 1
%e A373552   2 |          422  | 422, 426
%e A373552   3 |         2522  | 2522, 2526, 2530
%e A373552   4 |      1674274  | 1674274, 1674278, 1674282, 1674286
%t A373552 seq[lim_] := Module[{sqf = Select[Range[lim], SquareFreeQ], s = {}, rem, ind}, rem = Join[{1}, Mod[sqf, 2]]; Do[ind = SequencePosition[rem, Join[{1}, Table[0, {k}], {1}], 1]; If[ind == {}, Break[]]; AppendTo[s, sqf[[ind[[1, 1]]]]], {k, 1, Infinity}]; s]; seq[2*10^6]
%o A373552 (PARI) lista(len, kmax = oo) = {my(v = vector(len), c = 0, k = 1, k0, i = 0); while(c < len && k < kmax, if(issquarefree(k), if(!(k % 2), i++; if(i == 1, k0 = k), if(i > 0 && i <= len && v[i] == 0, v[i] = k0; c++); i = 0)); k++); v;}
%Y A373552 Cf. A005117, A039956, A056911, A363191, A373550, A373551.
%K A373552 nonn,hard,more
%O A373552 1,1
%A A373552 _Amiram Eldar_, Jun 09 2024
%E A373552 a(6) from _Bert Dobbelaere_, Jun 14 2024