The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A046109 Number of lattice points (x,y) on the circumference of a circle of radius n with center at (0,0). 31
1, 4, 4, 4, 4, 12, 4, 4, 4, 4, 12, 4, 4, 12, 4, 12, 4, 12, 4, 4, 12, 4, 4, 4, 4, 20, 12, 4, 4, 12, 12, 4, 4, 4, 12, 12, 4, 12, 4, 12, 12, 12, 4, 4, 4, 12, 4, 4, 4, 4, 20, 12, 12, 12, 4, 12, 4, 4, 12, 4, 12, 12, 4, 4, 4, 36, 4, 4, 12, 4, 12, 4, 4, 12, 12, 20, 4, 4, 12, 4, 12, 4, 12, 4, 4, 36 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,2
COMMENTS
Also number of Gaussian integers x + yi having absolute value n. - Alonso del Arte, Feb 11 2012
LINKS
Eric Weisstein's World of Mathematics, Circle Lattice Points
FORMULA
a(n) = A000328(n) - A051132(n).
a(n) = 8*A046080(n) + 4 for n > 0.
a(n) = A004018(n^2).
a(A084647(k)) = 28. - Jean-Christophe Hervé, Dec 01 2013
a(A084648(k)) = 36. - Jean-Christophe Hervé, Dec 01 2013
a(A084649(k)) = 44. - Jean-Christophe Hervé, Dec 01 2013
a(n) = 4 * Product_{i=1..k} (2*e_i + 1) for n > 0, given that p_i^e_i is the i-th factor of n with p_i = 1 mod 4. - Orson R. L. Peters, Jan 31 2017
a(n) = [x^(n^2)] theta_3(x)^2, where theta_3() is the Jacobi theta function. - Ilya Gutkovskiy, Apr 20 2018
From Hugo Pfoertner, Sep 21 2023: (Start)
a(n) = 8*A063014(n) - 4 for n > 0.
a(n) = 4*A256452 for n > 0.(End)
EXAMPLE
a(5) = 12 because the circumference of the circle with radius 5 will pass through the twelve points (5, 0), (4, 3), (3, 4), (0, 5), (-3, 4), (-4, 3), (-5, 0), (-4, -3), (-3, -4), (0, -5), (3, -4) and (4, -3). Alternatively, we can say the twelve Gaussian integers 5, 4 + 3i, ... , 4 - 3i all have absolute value of 5.
MAPLE
N:= 1000: # to get a(0) to a(N)
A:= Array(0..N):
A[0]:= 1:
for x from 1 to N do
A[x]:= A[x]+4;
for y from 1 to min(x-1, floor(sqrt(N^2-x^2))) do
z:= x^2+y^2;
if issqr(z) then
t:= sqrt(z);
A[t]:= A[t]+8;
fi
od
od:
seq(A[i], i=0..N); # Robert Israel, May 08 2015
MATHEMATICA
Table[Length[Select[Flatten[Table[r + I i, {r, -n, n}, {i, -n, n}]], Abs[#] == n &]], {n, 0, 49}] (* Alonso del Arte, Feb 11 2012 *)
PROG
(Haskell)
a046109 n = length [(x, y) | x <- [-n..n], y <- [-n..n], x^2 + y^2 == n^2]
-- Reinhard Zumkeller, Jan 23 2012
(Python)
from sympy import factorint
def a(n):
r = 1
for p, e in factorint(n).items():
if p%4 == 1: r *= 2*e + 1
return 4*r if n > 0 else 0
# Orson R. L. Peters, Jan 31 2017
(PARI) a(n)=if(n==0, return(1)); my(f=factor(n)); 4*prod(i=1, #f~, if(f[i, 1]%4==1, 2*f[i, 2]+1, 1)) \\ Charles R Greathouse IV, Feb 01 2017
(PARI) a(n)=if(n==0, return(1)); t=0; for(x=1, n-1, y=n^2-x^2; if(issquare(y), t++)); return(4*t+4) \\ Arkadiusz Wesolowski, Nov 14 2017
CROSSREFS
Sequence in context: A295643 A190718 A035621 * A294246 A107680 A358509
KEYWORD
nonn,easy,nice
AUTHOR
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 15 20:14 EDT 2024. Contains 372549 sequences. (Running on oeis4.)