OFFSET
1,1
COMMENTS
See A204892 for a discussion and guide to related sequences.
EXAMPLE
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.
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.
MATHEMATICA
s[n_] := s[n] = n!!; z1 = 400; z2 = 60;
Table[s[n], {n, 1, 30}] (* A006882 *)
u[m_] := u[m] = Flatten[Table[s[k] - s[j], {k, 2, z1}, {j, 1, k - 1}]][[m]]
Table[u[m], {m, 1, z1}] (* A204912 *)
v[n_, h_] := v[n, h] = If[IntegerQ[u[h]/n], h, 0]
w[n_] := w[n] = Table[v[n, h], {h, 1, z1}]
d[n_] := d[n] = First[Delete[w[n], Position[w[n], 0]]]
Table[d[n], {n, 1, z2}] (* A204913 *)
k[n_] := k[n] = Floor[(3 + Sqrt[8 d[n] - 1])/2]
m[n_] := m[n] = Floor[(-1 + Sqrt[8 n - 7])/2]
j[n_] := j[n] = d[n] - m[d[n]] (m[d[n]] + 1)/2
Table[k[n], {n, 1, z2}] (* A204982 *)
Table[j[n], {n, 1, z2}] (* A205100 *)
Table[s[k[n]], {n, 1, z2}] (* A205101 *)
Table[s[j[n]], {n, 1, z2}] (* A205102 *)
Table[s[k[n]] - s[j[n]], {n, 1, z2}] (* A205103 *)
Table[(s[k[n]] - s[j[n]])/n, {n, 1, z2}] (* A205104 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Clark Kimberling, Jan 22 2012
EXTENSIONS
Edited by Clark Kimberling, Apr 15 2020
STATUS
approved