I want to graph this function:
DivisorSigma[1,x]-(x+1)
However, I only want to plot the points that satisfy other conditions:
DivisorSigma[0,x]-2=2
and
Mod[x,2]=1
Is that possible within Mathematica?
You could always use Piecewise
or ConditionalExpression
:
f[x_] = ConditionalExpression[
DivisorSigma[1, x] - (x + 1),
Mod[x, 2] == 1 && DivisorSigma[0, x] - 2 == 2
];
DiscretePlot[f[x], {x, 1, 100}, PlotMarkers -> {Automatic, 6}]
{#,DivisorSigma[1,#]-(#+1)}&/@Select[Range[100],DivisorSigma[0,#]-2==2&&OddQ[#]&]
ListPlot[%]
ListPlot
.
$\endgroup$
Commented
Jul 4, 2019 at 12:36