1
$\begingroup$

This is what I have tried so far.

I have a function defined as the below:

Multifactorial[n_, k_] := Abs[Apply[Times, Range[-n, -1, k]]]
s[i_] := Sum[1/Multifactorial[n, 1], {n, 1, i}]
ListPlot[Table[{i, s[i]}, {i, 1, 100}]]

Which results in the following plot of the partial sums of Multifactorial[n,1] . ListPlot

I managed to display the partial sums when its just a single variable function (i.e. me manually inputting the argument for k).

However what I am trying to achieve is display as one plot (with different colours and a legend) the partial sums of MultiFactorial[n,1] through to MultiFactorial[n,10]. I was not able to define this as I don't know the syntax well enough.

Thanks for any and all help.

$\endgroup$
1
$\begingroup$
ListPlot[Table[Sum[1/Multifactorial[n, j], {n, 1, i}], {j, 1, 10}, {i, 1, 100}],
 PlotLegends ->  PointLegend[Automatic, PromptForm[j, #] & /@ Range[10], 
    LegendMarkers -> {Graphics[Disk[]], 6}]]

enter image description here

$\endgroup$
1
  • $\begingroup$ Thanks thats perfect and simple. I was sure I must have been making a syntax error. $\endgroup$ – Bhoris Dhanjal Feb 16 at 14:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.