Skip to content
m·amathatlas
ExploreAboutOpen problemsCited authorsMy libraryFeedback
Sign in
FRENES
Loading views…Recent views only, across all languages. Vercel history is unavailable for this page. Repeat visits in the same tab are grouped for 30 minutes.
ShareLinkedInXFacebookWhatsApp
← All open problems
Unanswered question

Exactly Counting the Number of Lattice Points in an nnn-Dimensional Sphere

Number theoryAlgebraic & complex geometryCombinatorics

Imported on November 28, 2026

The forum classified this question as unanswered when collected. This does not certify an open research problem; check the answers and revision history at the source.

Read the question with its definitions and background below. The source provides the full formulation and further discussion; the glossary and Wikipedia links offer additional reading aids.

Problem statement

Let Sn(R)S_n(R)Sn​(R) denote the number of lattice points in an nnn-dimensional "sphere" with radius RRR. For clarification, I am interested in lattice points found both strictly inside the sphere, and on its surface. I want to count exactly how many such points there are. This count corresponds to the amount of sets of integers that are solutions to the equation a12+a22+a32+...+an−12+an2=R2a_1^2+a_2^2+a_3^2+...+a_{n-1}^2+a_n^2= R^2a12​+a22​+a32​+...+an−12​+an2​=R2 where the aia_iai​'s are required to be integers, not necessarily positive, and sets that differ just by the order of the summands are also considered distinct, i.e for the case n=3,R=5n=3, R=5n=3,R=5, the following are both counted: 32+(−4)2+023^2+(-4)^2+0^232+(−4)2+02 and (−4)2+02+32(-4)^2+0^2+3^2(−4)2+02+32. This can also be interpreted as the sum of squares function - rd(k)r_d(k)rd​(k) denotes in how many such ways I can write kkk as the sum of ddd squares. This means that Sn(R)=∑k=1R2rn(k)S_n(R) = \sum_{k=1}^{R^2}r_n(k)Sn​(R)=∑k=1R2​rn​(k)

I am asking this question as a general one, but I am mostly concerned about the cases of n=2,n=3,n=4n=2, n=3,n=4n=2,n=3,n=4.

In order not to be too lengthy and remain focused, I won't explain why but summing this way requires to factor each kkk first. This is very time consuming, so I searched for better ways.

For the case of n=2n=2n=2, which is essentially just the count of lattice points in a circle of radius RRR, there is a lot of information - this is known as the Gauss Circle Problem and I have managed to find that S2(R)=1+∑i=1∞(⌊R24i+1⌋−⌊R24i+3⌋)S_2(R)= 1+\sum_{i=1}^\infty\biggl(\biggl \lfloor\frac{R^2}{4i+1}\biggl \rfloor-\biggl \lfloor\frac{R^2}{4i+3}\biggl \rfloor\biggl )S2​(R)=1+∑i=1∞​(⌊4i+1R2​⌋−⌊4i+3R2​⌋)For the case of n=4n=4n=4, I found: S4(R)=1+8∑k=1R2∑d∣k4∤ddS_4(R)= 1+8\sum_{k=1}^{R^2}\sum_{d|k \atop {4\nmid d}}dS4​(R)=1+8∑k=1R2​∑4∤dd∣k​​d Unfortunately, for the case of a sphere (n=3n=3n=3), I have found no formula, neither for the count of lattice points inside nor on the surface of the sphere.

Although these formulas do indeed provide the count of lattice points, they are very slow in computational terms, as their running time complexity is O(R2)O(R^2)O(R2). I was wondering if a more efficient way exists to count the number of such lattice points, perhaps O(R)O(R)O(R) or O(R1/2+ϵ)O(R^{1/2+\epsilon})O(R1/2+ϵ), so that I can work with radii as big as 10910^9109 or even more. I suspect there is a way, but I can't find it. Not necessarily a different approach to the problem, but rather just a more clever way to reduce the order of the sum. Also, any insight about S3(R)S_3(R)S3​(R) will be appreciated.

Statement and context adapted from MathOverflow · MC From Scratch

CC BY-SA 4.0 · Formatting adapted; mathematical formulas preserved · Source history

Topics : ag.algebraic-geometry · nt.number-theory · co.combinatorics · computational-complexity · computer-science

Authors listed by the source : MC From Scratch

Sources and original status

  • MathOverflow Status in source : unanswered at collection

Last activity on the question : May 18, 2019

Coverage, sources and method

This count measures imported entries, including distinct variants. It is not a count of all open mathematical questions worldwide. One entry may belong to several fields and sources.

This directory is neither exhaustive nor updated in real time. “Reported open” describes the source classification observed at import; imported entries have not each undergone independent mathematical verification. The 32 explained entries were reviewed separately.

Formal Conjectures: only “research open” statements with no reported formal proof are retained; their tag is checked in a pinned repository revision. Variants remain distinct. A “sorry” placeholder is not sufficient to establish open status.

Erdős: solved or independent problems and entries with a Lean solution are excluded, including “open (Lean)”. Exact matches to the main Formal Conjectures statements are merged.

Open Problem Garden: the open index is checked against the solved index; spam, identified clones and some outdated statuses are excluded. Statements and definition context are attributed to their original pages; formulas are preserved and the content remains under the GFDL. Recognized duplicates across sources are merged; this does not resolve every mathematical equivalence.

OEIS: direct extraction of conjectural comments and formulas, one entry per sequence, excluding mentioned resolutions. MathOverflow and Math Stack Exchange: questions classified as unanswered by their API, excluding closed posts and non-research categories. They remain distinct from problems reported open. This is a partial, dated collection; every entry credits its authors and license.

Documented exclusions account for recent announcements and conflicting statuses. A stronger variant or a special case can remain open after a different statement is settled.

Attribution: The Formal Conjectures Authors; teorth/erdosproblems and contributors; Open Problem Garden and contributors. Each source retains its license.

  • Formal Conjectures · 1,924 · Apache-2.0 / CC-BY-4.0
  • Erdős Problems (teorth) · 622 · Apache-2.0
  • Open Problem Garden · 404 · GFDL (source content); only title/category/link metadata imported
  • OEIS · 18,857 · CC BY-SA 4.0
  • MathOverflow · 19,035 · CC BY-SA (version on each entry)
  • Mathematics Stack Exchange · 35 · CC BY-SA (version on each entry)
Report a development or correction
mathatlas

An independent atlas to understand, read, and question research.

The papers present claimed results at different stages of verification.
NewsletterShare feedbackAbout Data and privacy
Created by Sonny Mupfuni