Let $$ N(n):=\{m\in\mathbb{Z}:\ \ m=\sum_{i=1}^n\frac \epsilon i,\ \epsilon=0\ \text{or}\ 1\} $$ I want to write a code in **Mathematica** as follows but I think `A[e,n]` does not define what I need above: for example A[e_,n_]:=Sum[e/i,{e,0,1},{i,1,n}]; n=1000; Sum[If[IntegerQ[A[e,n]]==True,m,0],{m,1,10}] Thanks.