Mathematica Division of sequences in Wolfram Mathematica

AI Thread Summary
To divide two sequences in Wolfram Mathematica, you can use the `MapThread` function alongside `Divide`. For example, to compute the sequence h_n, which is the result of dividing f_n = 1/n by g_n = n^2, you can define the sequences using `Table`. The code snippet provided demonstrates this process: fn = Table[1/n, {n, 1, 6}]; gn = Table[n^2, {n, 1, 6}]; MapThread[Divide, {fn, gn}]This results in the sequence h_n = {1, 1/8, 1/27, 1/64, 1/125, 1/216}. This method efficiently computes the desired output by applying the division element-wise across the two sequences.
LagrangeEuler
Messages
711
Reaction score
22
How to divide two sequences in Wolfam Mathematica? For example

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

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

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}
 
Tnx!
 

Similar threads

Replies
2
Views
1K
Replies
1
Views
2K
Replies
19
Views
2K
Replies
1
Views
2K
Back
Top