login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A204932 Least k such that n divides k!-j! for some j satisfying 1<=j<k. 10

%I #5 Mar 30 2012 18:58:08

%S 2,3,4,3,3,4,5,5,4,6,4,5,9,6,6,5,5,4,5,6,6,4,4,5,6,9,7,8,6,6,10,5,7,6,

%T 8,7,13,5,9,6,7,6,11,7,7,8,10,5,8,6,6,9,12,7,8,8,5,6,5,6,16,10,8,9,14,

%U 7,8,11,8,8,9,7,8,13,6,7,12,9,14,7,10,7,19,8,11,11,6,7,10,7

%N Least k such that n divides k!-j! for some j satisfying 1<=j<k.

%C See A204892 for a discussion and guide to related sequences.

%e 1 divides 2!-1!, so a(1)=2

%e 2 divides 3!-2!, so a(2)=3

%e 3 divides 4!-3!, so a(3)=4

%e 13 divides 9!-4!, so a(13)=9

%t s[n_] := s[n] = n!; z1 = 80; z2 = 60;

%t Table[s[n], {n, 1, 30}] (* A000142 *)

%t u[m_] := u[m] = Flatten[Table[s[k] - s[j], {k, 2, z1}, {j, 1, k - 1}]][[m]]

%t Table[u[m], {m, 1, z1}] (* A204930 *)

%t v[n_, h_] := v[n, h] = If[IntegerQ[u[h]/n], h, 0]

%t w[n_] := w[n] = Table[v[n, h], {h, 1, z1}]

%t d[n_] := d[n] = First[Delete[w[n], Position[w[n], 0]]]

%t Table[d[n], {n, 1, z2}] (* A204931 *)

%t k[n_] := k[n] = Floor[(3 + Sqrt[8 d[n] - 1])/2]

%t m[n_] := m[n] = Floor[(-1 + Sqrt[8 n - 7])/2]

%t j[n_] := j[n] = d[n] - m[d[n]] (m[d[n]] + 1)/2

%t Table[k[n], {n, 1, z2}] (* A204932 *)

%t Table[j[n], {n, 1, z2}] (* A204933 *)

%t Table[s[k[n]], {n, 1, z2}] (* A204934 *)

%t Table[s[j[n]], {n, 1, z2}] (* A204935 *)

%t Table[s[k[n]] - s[j[n]], {n, 1, z2}] (* A204936 *)

%t Table[(s[k[n]] - s[j[n]])/n, {n, 1, z2}] (* A204937 *)

%Y Cf. A000142, A204892.

%K nonn

%O 1,1

%A _Clark Kimberling_, Jan 21 2012

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 18 12:53 EDT 2024. Contains 371780 sequences. (Running on oeis4.)