login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Distance between n and the least nonsquarefree number >= n.
5

%I #7 Dec 02 2024 09:50:05

%S 3,2,1,0,3,2,1,0,0,2,1,0,3,2,1,0,1,0,1,0,3,2,1,0,0,1,0,0,3,2,1,0,3,2,

%T 1,0,3,2,1,0,3,2,1,0,0,2,1,0,0,0,1,0,1,0,1,0,3,2,1,0,2,1,0,0,3,2,1,0,

%U 3,2,1,0,2,1,0,0,3,2,1,0,0,2,1,0,3,2,1

%N Distance between n and the least nonsquarefree number >= n.

%C All terms are 0, 1, 2, or 3 (cf. A078147).

%t Table[NestWhile[#+1&,n,SquareFreeQ[#]&]-n,{n,100}]

%Y Adding n to each term a(n) gives A120327.

%Y Positions of 0 are A013929.

%Y Positions of 1 are A373415.

%Y Positions of 2 are A378458.

%Y Positions of 3 are A007675.

%Y Sequences obtained by adding n to each term are placed in parentheses below.

%Y The version for primes is A007920 (A007918).

%Y The version for perfect powers is A074984 (A377468).

%Y The version for squarefree numbers is A081221 (A067535).

%Y The version for non-perfect powers is A378357 (A378358).

%Y The version for prime powers is A378370 (A000015).

%Y The version for non prime powers is A378371 (A378372).

%Y A005117 lists the squarefree numbers, first differences A076259.

%Y A013929 lists the nonsquarefree numbers, first differences A078147.

%Y A120992 gives run-lengths of squarefree numbers increasing by one.

%Y Cf. A073247, A151800, A236575, A243348, A375707, A377046, A378033, A378039, A378086, A378373.

%K nonn

%O 1,1

%A _Gus Wiseman_, Dec 01 2024