Question: Harmonic

<p>Hi, I need help.</p>
<div style="margin: 0in 0in 0pt"><span style="color: black">I need to write a program that, for input integer n > 0, output the row vector [k<sub>1</sub>,k<sub>2</sub> . . . , k<sub>n</sub>].</span></div>
<div style="margin: 0in 0in 0pt"><span style="color: black">For example, when input n = 8, the output is [1, 4, 11, 31, 83, 227, 616, 1674].</span></div>
<div style="margin: 0in 0in 0pt"> </div>
<div style="margin: 0in 0in 0pt"> This is what I have:</div>
<pre>
harmonic1 := proc ( n )<br />   local s, h, k, j;

   h := LinearAlgebra[Dimension](x);<br />   s := 0;

<br />   for k from 1 to h do      <br />      while n > 0 do<br /><br />         s := s + 1/j[K];     <br />      end do;
   end do;

<br />   return s;
end proc;</pre>
<pre>
 </pre>
<p>But is not woking.</p>
<p>Can some one help me please</p>
<p>Thanks ^_^</p>
Please Wait...