login
L = A132468(n) = A048669(n)-1 is the length of the longest run of consecutive numbers that have a common factor with n; a(n) = smallest k >= 0 which starts such a run.
1

%I #16 Jun 06 2017 00:28:19

%S 0,0,0,0,2,0,0,0,4,0,2,0,6,5,0,0,2,0,4,6,10,0,2,0,12,0,6,0,2,0,0,11,

%T 16,14,2,0,18,12,4,0,6,0,10,5,22,0,2,0,4,17,12,0,2,10,6,18,28,0,2,0,

%U 30,6,0,25,8,0,16,23,4,0,2,0,36,5,18,21,12,0,4,0,40,0,6,34,42,29,10,0,2,13,22,30

%N L = A132468(n) = A048669(n)-1 is the length of the longest run of consecutive numbers that have a common factor with n; a(n) = smallest k >= 0 which starts such a run.

%C Related to the Jacobsthal function A048669.

%C a(n) depends only on the radical A007947(n).

%H Rémy Sigrist, <a href="/A285182/b285182.txt">Table of n, a(n) for n = 2..20000</a>

%e If n = 6, among the numbers k = 0,1,2,3,4,5,6,7,... there is a run of L = 3 consecutive numbers, 2,3,4, all with gcd(k,6)>1, starting at k=2, so a(6) = 2.

%e If n is a prime (or prime power), a(n)=0.

%p acf:=[]; wcf:=[];

%p for n from 2 to 120 do

%p s:=[seq(j,j=0..4*n)];

%p rec:=0;

%p for st from 0 to n do

%p len:=0;

%p for i from 1 to n while gcd(s[st+i],n)>1 do len:=len+1; od:

%p if len>rec then rec:=len; w:=st; fi;

%p od:

%p acf:=[op(acf),rec];

%p wcf:=[op(wcf),w];

%p od:

%p acf; # A132468

%p wcf; # A285182

%Y Cf. A132468, A048669, A007947.

%K nonn

%O 2,5

%A _N. J. A. Sloane_, Apr 19 2017