Lattice points below a curveComplex elliptic curve for the “conjugate” latticeNumber of lattice...
Quoting Keynes in a lecture
Is there a RAID 0 Equivalent for RAM?
What's the difference between releasing hormones and tropic hormones?
Is there a way to get `mathscr' with lower case letters in pdfLaTeX?
Why is the "ls" command showing permissions of files in a FAT32 partition?
Limits and Infinite Integration by Parts
How to fade a semiplane defined by line?
What are some good ways to treat frozen vegetables such that they behave like fresh vegetables when stir frying them?
Does the Linux kernel need a file system to run?
How should I respond when I lied about my education and the company finds out through background check?
Creepy dinosaur pc game identification
Pre-mixing cryogenic fuels and using only one fuel tank
I'm the sea and the sun
How does the math work for Perception checks?
Why Shazam when there is already Superman?
Why is it that I can sometimes guess the next note?
Multiplicative persistence
Does an advisor owe his/her student anything? Will an advisor keep a PhD student only out of pity?
It grows, but water kills it
How do you respond to a colleague from another team when they're wrongly expecting that you'll help them?
Biological Blimps: Propulsion
How much character growth crosses the line into breaking the character
What are the advantages of simplicial model categories over non-simplicial ones?
Why does a simple loop result in ASYNC_NETWORK_IO waits?
Lattice points below a curve
Complex elliptic curve for the “conjugate” latticeNumber of lattice pointsFind lattice points on a planar curveLattice points in spheresHow to count lattice points on a line.Help in Understanding the Formula for The Lattice Point Counting in Triangles with Rational CoordinatesIs the area of a convex set approximated by the number of its lattice points, in the following sense?The number of lattice points under a rational functionFinding integer points in Lattice?Counting Lattice Points
$begingroup$
Assume a curve represented by a function
$f(b)=0.5(sqrt{N-b^2}-b+1)$ with $1leq b leq sqrt{frac{N}{2}}$. I want to count the lattice points below this curve, more specifically, I would like a closed form expression. I can assume this figure to be a parabola and try curve fitting and then use the method given in this paper to sort of get an approximation. But I am not convinced. Can someone please offer me a better solution?
Thanks
integer-lattices
$endgroup$
add a comment |
$begingroup$
Assume a curve represented by a function
$f(b)=0.5(sqrt{N-b^2}-b+1)$ with $1leq b leq sqrt{frac{N}{2}}$. I want to count the lattice points below this curve, more specifically, I would like a closed form expression. I can assume this figure to be a parabola and try curve fitting and then use the method given in this paper to sort of get an approximation. But I am not convinced. Can someone please offer me a better solution?
Thanks
integer-lattices
$endgroup$
$begingroup$
Important question: are you counting lattice points with $f(b)<0$ as negative?
$endgroup$
– R. Burton
Mar 13 at 17:19
$begingroup$
No. In the interval $1leq b leq sqrt{N/2}$, $f(b)$ is always positive. The choice of $N$ is thus made to ensure that.
$endgroup$
– RTn
Mar 13 at 17:21
add a comment |
$begingroup$
Assume a curve represented by a function
$f(b)=0.5(sqrt{N-b^2}-b+1)$ with $1leq b leq sqrt{frac{N}{2}}$. I want to count the lattice points below this curve, more specifically, I would like a closed form expression. I can assume this figure to be a parabola and try curve fitting and then use the method given in this paper to sort of get an approximation. But I am not convinced. Can someone please offer me a better solution?
Thanks
integer-lattices
$endgroup$
Assume a curve represented by a function
$f(b)=0.5(sqrt{N-b^2}-b+1)$ with $1leq b leq sqrt{frac{N}{2}}$. I want to count the lattice points below this curve, more specifically, I would like a closed form expression. I can assume this figure to be a parabola and try curve fitting and then use the method given in this paper to sort of get an approximation. But I am not convinced. Can someone please offer me a better solution?
Thanks
integer-lattices
integer-lattices
edited Mar 13 at 17:10
RTn
asked Mar 13 at 16:20
RTnRTn
306
306
$begingroup$
Important question: are you counting lattice points with $f(b)<0$ as negative?
$endgroup$
– R. Burton
Mar 13 at 17:19
$begingroup$
No. In the interval $1leq b leq sqrt{N/2}$, $f(b)$ is always positive. The choice of $N$ is thus made to ensure that.
$endgroup$
– RTn
Mar 13 at 17:21
add a comment |
$begingroup$
Important question: are you counting lattice points with $f(b)<0$ as negative?
$endgroup$
– R. Burton
Mar 13 at 17:19
$begingroup$
No. In the interval $1leq b leq sqrt{N/2}$, $f(b)$ is always positive. The choice of $N$ is thus made to ensure that.
$endgroup$
– RTn
Mar 13 at 17:21
$begingroup$
Important question: are you counting lattice points with $f(b)<0$ as negative?
$endgroup$
– R. Burton
Mar 13 at 17:19
$begingroup$
Important question: are you counting lattice points with $f(b)<0$ as negative?
$endgroup$
– R. Burton
Mar 13 at 17:19
$begingroup$
No. In the interval $1leq b leq sqrt{N/2}$, $f(b)$ is always positive. The choice of $N$ is thus made to ensure that.
$endgroup$
– RTn
Mar 13 at 17:21
$begingroup$
No. In the interval $1leq b leq sqrt{N/2}$, $f(b)$ is always positive. The choice of $N$ is thus made to ensure that.
$endgroup$
– RTn
Mar 13 at 17:21
add a comment |
1 Answer
1
active
oldest
votes
$begingroup$
If I understand what you are asking correctly, then the number of lattice points below the curve can be treated as a sort of "discrete integral".
Given that the number of lattice points below a point $(b,f(b))$ is, at most $f(b)$, the number of lattice points under the curve from $1$ to $leftlfloorsqrtfrac{N}{2}rightrfloor$ could be obtained from summing the number of lattice points below each $f(n)$ for $n=1,ldots,lfloor sqrt{frac{N}{2}}rfloor$
$$F(b)=sum_{n=1}^{leftlfloor sqrt{frac{N}{2}}rightrfloor} lfloor f(n)rfloor$$
Where $F(b)$ coincides with the number of lattice points and $lfloorcdotrfloor$ is the flooring function.
Edit: Okay, it seems that I messed up while entering this into Wolfram. After working it out by hand, the closest approximation to the graph of $F(b)$ is a parabola. However the closed form of the summation (if it exists) cannot be a polynomial of order less than 3. This is because the flooring function in the summation makes the graph asymetrical about the vertical line through the maximum for most $N$.
$endgroup$
$begingroup$
Well, indeed. But I don't get how you arrived at the Expression for $F(b)$. Assume $N=100$, $1leq b leq 6$, then the number of lattice points is $37$. For $b=6$, $f(b)=3$ and so according to your formula, $F(b)=21-lfloor f(1)rfloor$. This seems not right.. Am I missing something here?
$endgroup$
– RTn
Mar 13 at 16:58
$begingroup$
Sorry, I forgot to add that the summation should run from your lower to upper bound, otherwise you have to take the difference, just like taking a definite integral.
$endgroup$
– R. Burton
Mar 13 at 17:02
$begingroup$
I was wondering if there is a closed form expression for this instead of a summation. Like that which exists for a hyperbola using the Dirichlet method. It would be nice to have a closed form expression.
$endgroup$
– RTn
Mar 13 at 17:04
$begingroup$
If there is a closed form, it will be for the summation $sum_{n=1}^{lfloorsqrt{frac{N}{2}}rfloor}lfloor f(n)rfloor$. I'll see if I can fix it.
$endgroup$
– R. Burton
Mar 13 at 17:06
$begingroup$
Oh wonderful. I will modify the original equation a bit to include a 0.5 as a multiplier. I tried taking a finite continuous integral of this function in the said interval and then subtracted the coefficient of $b^2$ that I obtained by curve fitting $f(b)$ to a parabola and it seems to work. The only thing is that it seems a bit arbitrary to do that.
$endgroup$
– RTn
Mar 13 at 17:09
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
return StackExchange.using("mathjaxEditing", function () {
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
});
});
}, "mathjax-editing");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "69"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
noCode: true, onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3146809%2flattice-points-below-a-curve%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
If I understand what you are asking correctly, then the number of lattice points below the curve can be treated as a sort of "discrete integral".
Given that the number of lattice points below a point $(b,f(b))$ is, at most $f(b)$, the number of lattice points under the curve from $1$ to $leftlfloorsqrtfrac{N}{2}rightrfloor$ could be obtained from summing the number of lattice points below each $f(n)$ for $n=1,ldots,lfloor sqrt{frac{N}{2}}rfloor$
$$F(b)=sum_{n=1}^{leftlfloor sqrt{frac{N}{2}}rightrfloor} lfloor f(n)rfloor$$
Where $F(b)$ coincides with the number of lattice points and $lfloorcdotrfloor$ is the flooring function.
Edit: Okay, it seems that I messed up while entering this into Wolfram. After working it out by hand, the closest approximation to the graph of $F(b)$ is a parabola. However the closed form of the summation (if it exists) cannot be a polynomial of order less than 3. This is because the flooring function in the summation makes the graph asymetrical about the vertical line through the maximum for most $N$.
$endgroup$
$begingroup$
Well, indeed. But I don't get how you arrived at the Expression for $F(b)$. Assume $N=100$, $1leq b leq 6$, then the number of lattice points is $37$. For $b=6$, $f(b)=3$ and so according to your formula, $F(b)=21-lfloor f(1)rfloor$. This seems not right.. Am I missing something here?
$endgroup$
– RTn
Mar 13 at 16:58
$begingroup$
Sorry, I forgot to add that the summation should run from your lower to upper bound, otherwise you have to take the difference, just like taking a definite integral.
$endgroup$
– R. Burton
Mar 13 at 17:02
$begingroup$
I was wondering if there is a closed form expression for this instead of a summation. Like that which exists for a hyperbola using the Dirichlet method. It would be nice to have a closed form expression.
$endgroup$
– RTn
Mar 13 at 17:04
$begingroup$
If there is a closed form, it will be for the summation $sum_{n=1}^{lfloorsqrt{frac{N}{2}}rfloor}lfloor f(n)rfloor$. I'll see if I can fix it.
$endgroup$
– R. Burton
Mar 13 at 17:06
$begingroup$
Oh wonderful. I will modify the original equation a bit to include a 0.5 as a multiplier. I tried taking a finite continuous integral of this function in the said interval and then subtracted the coefficient of $b^2$ that I obtained by curve fitting $f(b)$ to a parabola and it seems to work. The only thing is that it seems a bit arbitrary to do that.
$endgroup$
– RTn
Mar 13 at 17:09
add a comment |
$begingroup$
If I understand what you are asking correctly, then the number of lattice points below the curve can be treated as a sort of "discrete integral".
Given that the number of lattice points below a point $(b,f(b))$ is, at most $f(b)$, the number of lattice points under the curve from $1$ to $leftlfloorsqrtfrac{N}{2}rightrfloor$ could be obtained from summing the number of lattice points below each $f(n)$ for $n=1,ldots,lfloor sqrt{frac{N}{2}}rfloor$
$$F(b)=sum_{n=1}^{leftlfloor sqrt{frac{N}{2}}rightrfloor} lfloor f(n)rfloor$$
Where $F(b)$ coincides with the number of lattice points and $lfloorcdotrfloor$ is the flooring function.
Edit: Okay, it seems that I messed up while entering this into Wolfram. After working it out by hand, the closest approximation to the graph of $F(b)$ is a parabola. However the closed form of the summation (if it exists) cannot be a polynomial of order less than 3. This is because the flooring function in the summation makes the graph asymetrical about the vertical line through the maximum for most $N$.
$endgroup$
$begingroup$
Well, indeed. But I don't get how you arrived at the Expression for $F(b)$. Assume $N=100$, $1leq b leq 6$, then the number of lattice points is $37$. For $b=6$, $f(b)=3$ and so according to your formula, $F(b)=21-lfloor f(1)rfloor$. This seems not right.. Am I missing something here?
$endgroup$
– RTn
Mar 13 at 16:58
$begingroup$
Sorry, I forgot to add that the summation should run from your lower to upper bound, otherwise you have to take the difference, just like taking a definite integral.
$endgroup$
– R. Burton
Mar 13 at 17:02
$begingroup$
I was wondering if there is a closed form expression for this instead of a summation. Like that which exists for a hyperbola using the Dirichlet method. It would be nice to have a closed form expression.
$endgroup$
– RTn
Mar 13 at 17:04
$begingroup$
If there is a closed form, it will be for the summation $sum_{n=1}^{lfloorsqrt{frac{N}{2}}rfloor}lfloor f(n)rfloor$. I'll see if I can fix it.
$endgroup$
– R. Burton
Mar 13 at 17:06
$begingroup$
Oh wonderful. I will modify the original equation a bit to include a 0.5 as a multiplier. I tried taking a finite continuous integral of this function in the said interval and then subtracted the coefficient of $b^2$ that I obtained by curve fitting $f(b)$ to a parabola and it seems to work. The only thing is that it seems a bit arbitrary to do that.
$endgroup$
– RTn
Mar 13 at 17:09
add a comment |
$begingroup$
If I understand what you are asking correctly, then the number of lattice points below the curve can be treated as a sort of "discrete integral".
Given that the number of lattice points below a point $(b,f(b))$ is, at most $f(b)$, the number of lattice points under the curve from $1$ to $leftlfloorsqrtfrac{N}{2}rightrfloor$ could be obtained from summing the number of lattice points below each $f(n)$ for $n=1,ldots,lfloor sqrt{frac{N}{2}}rfloor$
$$F(b)=sum_{n=1}^{leftlfloor sqrt{frac{N}{2}}rightrfloor} lfloor f(n)rfloor$$
Where $F(b)$ coincides with the number of lattice points and $lfloorcdotrfloor$ is the flooring function.
Edit: Okay, it seems that I messed up while entering this into Wolfram. After working it out by hand, the closest approximation to the graph of $F(b)$ is a parabola. However the closed form of the summation (if it exists) cannot be a polynomial of order less than 3. This is because the flooring function in the summation makes the graph asymetrical about the vertical line through the maximum for most $N$.
$endgroup$
If I understand what you are asking correctly, then the number of lattice points below the curve can be treated as a sort of "discrete integral".
Given that the number of lattice points below a point $(b,f(b))$ is, at most $f(b)$, the number of lattice points under the curve from $1$ to $leftlfloorsqrtfrac{N}{2}rightrfloor$ could be obtained from summing the number of lattice points below each $f(n)$ for $n=1,ldots,lfloor sqrt{frac{N}{2}}rfloor$
$$F(b)=sum_{n=1}^{leftlfloor sqrt{frac{N}{2}}rightrfloor} lfloor f(n)rfloor$$
Where $F(b)$ coincides with the number of lattice points and $lfloorcdotrfloor$ is the flooring function.
Edit: Okay, it seems that I messed up while entering this into Wolfram. After working it out by hand, the closest approximation to the graph of $F(b)$ is a parabola. However the closed form of the summation (if it exists) cannot be a polynomial of order less than 3. This is because the flooring function in the summation makes the graph asymetrical about the vertical line through the maximum for most $N$.
edited Mar 13 at 17:35
answered Mar 13 at 16:37
R. BurtonR. Burton
670110
670110
$begingroup$
Well, indeed. But I don't get how you arrived at the Expression for $F(b)$. Assume $N=100$, $1leq b leq 6$, then the number of lattice points is $37$. For $b=6$, $f(b)=3$ and so according to your formula, $F(b)=21-lfloor f(1)rfloor$. This seems not right.. Am I missing something here?
$endgroup$
– RTn
Mar 13 at 16:58
$begingroup$
Sorry, I forgot to add that the summation should run from your lower to upper bound, otherwise you have to take the difference, just like taking a definite integral.
$endgroup$
– R. Burton
Mar 13 at 17:02
$begingroup$
I was wondering if there is a closed form expression for this instead of a summation. Like that which exists for a hyperbola using the Dirichlet method. It would be nice to have a closed form expression.
$endgroup$
– RTn
Mar 13 at 17:04
$begingroup$
If there is a closed form, it will be for the summation $sum_{n=1}^{lfloorsqrt{frac{N}{2}}rfloor}lfloor f(n)rfloor$. I'll see if I can fix it.
$endgroup$
– R. Burton
Mar 13 at 17:06
$begingroup$
Oh wonderful. I will modify the original equation a bit to include a 0.5 as a multiplier. I tried taking a finite continuous integral of this function in the said interval and then subtracted the coefficient of $b^2$ that I obtained by curve fitting $f(b)$ to a parabola and it seems to work. The only thing is that it seems a bit arbitrary to do that.
$endgroup$
– RTn
Mar 13 at 17:09
add a comment |
$begingroup$
Well, indeed. But I don't get how you arrived at the Expression for $F(b)$. Assume $N=100$, $1leq b leq 6$, then the number of lattice points is $37$. For $b=6$, $f(b)=3$ and so according to your formula, $F(b)=21-lfloor f(1)rfloor$. This seems not right.. Am I missing something here?
$endgroup$
– RTn
Mar 13 at 16:58
$begingroup$
Sorry, I forgot to add that the summation should run from your lower to upper bound, otherwise you have to take the difference, just like taking a definite integral.
$endgroup$
– R. Burton
Mar 13 at 17:02
$begingroup$
I was wondering if there is a closed form expression for this instead of a summation. Like that which exists for a hyperbola using the Dirichlet method. It would be nice to have a closed form expression.
$endgroup$
– RTn
Mar 13 at 17:04
$begingroup$
If there is a closed form, it will be for the summation $sum_{n=1}^{lfloorsqrt{frac{N}{2}}rfloor}lfloor f(n)rfloor$. I'll see if I can fix it.
$endgroup$
– R. Burton
Mar 13 at 17:06
$begingroup$
Oh wonderful. I will modify the original equation a bit to include a 0.5 as a multiplier. I tried taking a finite continuous integral of this function in the said interval and then subtracted the coefficient of $b^2$ that I obtained by curve fitting $f(b)$ to a parabola and it seems to work. The only thing is that it seems a bit arbitrary to do that.
$endgroup$
– RTn
Mar 13 at 17:09
$begingroup$
Well, indeed. But I don't get how you arrived at the Expression for $F(b)$. Assume $N=100$, $1leq b leq 6$, then the number of lattice points is $37$. For $b=6$, $f(b)=3$ and so according to your formula, $F(b)=21-lfloor f(1)rfloor$. This seems not right.. Am I missing something here?
$endgroup$
– RTn
Mar 13 at 16:58
$begingroup$
Well, indeed. But I don't get how you arrived at the Expression for $F(b)$. Assume $N=100$, $1leq b leq 6$, then the number of lattice points is $37$. For $b=6$, $f(b)=3$ and so according to your formula, $F(b)=21-lfloor f(1)rfloor$. This seems not right.. Am I missing something here?
$endgroup$
– RTn
Mar 13 at 16:58
$begingroup$
Sorry, I forgot to add that the summation should run from your lower to upper bound, otherwise you have to take the difference, just like taking a definite integral.
$endgroup$
– R. Burton
Mar 13 at 17:02
$begingroup$
Sorry, I forgot to add that the summation should run from your lower to upper bound, otherwise you have to take the difference, just like taking a definite integral.
$endgroup$
– R. Burton
Mar 13 at 17:02
$begingroup$
I was wondering if there is a closed form expression for this instead of a summation. Like that which exists for a hyperbola using the Dirichlet method. It would be nice to have a closed form expression.
$endgroup$
– RTn
Mar 13 at 17:04
$begingroup$
I was wondering if there is a closed form expression for this instead of a summation. Like that which exists for a hyperbola using the Dirichlet method. It would be nice to have a closed form expression.
$endgroup$
– RTn
Mar 13 at 17:04
$begingroup$
If there is a closed form, it will be for the summation $sum_{n=1}^{lfloorsqrt{frac{N}{2}}rfloor}lfloor f(n)rfloor$. I'll see if I can fix it.
$endgroup$
– R. Burton
Mar 13 at 17:06
$begingroup$
If there is a closed form, it will be for the summation $sum_{n=1}^{lfloorsqrt{frac{N}{2}}rfloor}lfloor f(n)rfloor$. I'll see if I can fix it.
$endgroup$
– R. Burton
Mar 13 at 17:06
$begingroup$
Oh wonderful. I will modify the original equation a bit to include a 0.5 as a multiplier. I tried taking a finite continuous integral of this function in the said interval and then subtracted the coefficient of $b^2$ that I obtained by curve fitting $f(b)$ to a parabola and it seems to work. The only thing is that it seems a bit arbitrary to do that.
$endgroup$
– RTn
Mar 13 at 17:09
$begingroup$
Oh wonderful. I will modify the original equation a bit to include a 0.5 as a multiplier. I tried taking a finite continuous integral of this function in the said interval and then subtracted the coefficient of $b^2$ that I obtained by curve fitting $f(b)$ to a parabola and it seems to work. The only thing is that it seems a bit arbitrary to do that.
$endgroup$
– RTn
Mar 13 at 17:09
add a comment |
Thanks for contributing an answer to Mathematics Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
Use MathJax to format equations. MathJax reference.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3146809%2flattice-points-below-a-curve%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
$begingroup$
Important question: are you counting lattice points with $f(b)<0$ as negative?
$endgroup$
– R. Burton
Mar 13 at 17:19
$begingroup$
No. In the interval $1leq b leq sqrt{N/2}$, $f(b)$ is always positive. The choice of $N$ is thus made to ensure that.
$endgroup$
– RTn
Mar 13 at 17:21