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”).

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

%I #10 Apr 15 2020 11:41:06

%S 2,3,4,5,4,4,4,6,6,6,6,5,5,5,6,8,7,7,7,6,8,12,6,8,10,7,10,8,14,7,8,10,

%T 6,7,9,10,12,10,9,6,8,8,15,12,6,6,6,8,11,11,7,7,17,10,12,8,7,16,9,9

%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 Example 1. Using 1!! = 1, 2!! = 2, 3!! = 3, 4!! = 8, we verify that a(5) = 5 as follows: The values of 4!!-j!! for j = 1,2,3 are 7,6,5, respectively, so 5 divides 4!! - 3!!, and so for k = 4 there is a number j as required. On the other hand, it is easy to check that for k = 1,2,3, there is no such j.

%e Example 2. To see that a(6) = 4, we already noted that 6 divides 4!!-2!! in Example 1, and it is easy to check that for k = 1,2,3, the number 6 does not divide k!! - j!! for any j satisfying 1 <=j < k.

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

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

%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}] (* A204912 *)

%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}] (* A204913 *)

%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}] (* A204982 *)

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

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

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

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

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

%Y Cf. A006882, A204892, A205104.

%K nonn

%O 1,1

%A _Clark Kimberling_, Jan 22 2012

%E Edited by _Clark Kimberling_, Apr 15 2020