Division of sequences in Wolfram Mathematica

Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
2 replies · 3K views
LagrangeEuler
Messages
711
Reaction score
22
How to divide two sequences in Wolfam Mathematica? For example

[tex]f_n=\frac{1}{n}=1,\frac{1}{2},\frac{1}{3},...[/tex] and [tex]g_n=n^2=1,4,9,...[/tex]

I want to get [tex]h_n=1,\frac{1}{8},\frac{1}{27}...=\frac{f_n}{g_n}[/tex]

How to do that in Wolfram Mathematica?
 
Physics news on Phys.org
In[1]:= fn = Table[1/n, {n, 1, 6}];
gn = Table[n^2, {n, 1, 6}];
MapThread[Divide, {fn, gn}]

Out[3]= {1, 1/8, 1/27, 1/64, 1/125, 1/216}