title: Passing a list to a multiple-arity function in DrRacket (Scheme)
body: <p>I am trying to generate the least common multiple for all numbers from 1 to n as described in <a href="https://oeis.org/A003418" rel="nofollow noreferrer">OEIS-A003418</a>.  In the DrRacket REPL I'm using the following code:</p>
  
  <pre><code>(lcm (apply values (build-list 256 add1)))
  </code></pre>
  
  <p>Which gives me a "result arity mismatch" error (expected 1, received 256).  When I omit <code>lcm</code> I get a sequence from 1 to 256 output to the console.  I'm uncertain as to the cause of the arity mismatch, since <code>lcm</code> is supposed to be able to take arbitrarily many arguments (according to <a href="https://docs.racket-lang.org/reference/generic-numbers.html#%28def._%28%28quote._~23~25kernel%29._lcm%29%29" rel="nofollow noreferrer">the docs</a>), and <code>apply</code> seems to be doing what I would expect when it is the outermost function and not an input to <code>lcm</code>.  What am I missing?  Also, if there is an easier way to write the LCM from 1 to n please feel free to share.</p>