close
login
A384693
a(n) is the number of lattice points (r,s) such that 0<r,s<=n and ((r^2+s^2)*d - r*d^2)/r is a square for some integer d with 0<d<r.
0
0, 0, 0, 0, 2, 3, 3, 3, 5, 7, 9, 9, 13, 14, 16, 21, 26, 27, 29, 29, 33, 35, 37, 37, 42, 48, 52, 56, 62, 63, 70, 70, 76, 77, 81, 83, 94, 95, 95, 98, 108, 109, 113, 113, 118, 125, 127, 127, 140, 146, 156, 160, 167, 168, 174, 180, 187, 188, 191, 191, 206, 207, 208, 216, 228, 234, 239, 239, 247, 249, 258, 258, 275, 276, 280, 292
OFFSET
0,5
COMMENTS
This sequence gives the number of invisible lattice points along circular arcs surrounded in a n X n square. Visibility is defined for the family (x-t)^2 + y^2 = t^2, for t being a positive rational, this sequence is important in the sense that it proves that density of invisible points goes to 0 and hence density of visible points comes out to be 1.
FORMULA
Define I(r,s) = 1 if there exists an integer d, 1 <= d < r, such that ((r^2 + s^2)*d - r*d^2) / r is a perfect square, and I(r,s) = 0 otherwise.
Let a(0) = 0. For n >= 1, a(n) = a(n-1) + Sum_{s=1..n} I(n,s) + Sum_{r=1..n-1} I(r,n).
EXAMPLE
For n=4, a(4) = 2 because (2,4) and (4,2) are the only points for which there exists a d (1 for both cases) for which ((2^2+4^2)d-2d^2)/2 is a perfect square for some integer d, 0<d<2 and ((4^2+2^)d-4d^2)/4 is a perfect square for some integer d, 0<d<4.
For n=5, a(5) = 3 because (2,4) and (4,2) are the points already there satisfying the criterion; also, (5,5) is another point because ((5^2+5^2)*1-5*1^2)/5 = 9, which is a perfect square. Hence, a(5)=3.
PROG
(Haskell)
isSquare n = (floor . sqrt . fromIntegral $ n) ^ 2 == n
valid a b = not $ null [() | d <- [1..a-1]
, let (q, r) =((a^2 + b^2) * d - a * d^2) `divMod` a
, r == 0
, isSquare q]
count n = length
[ ()
| a <- [1..n]
, b <- [1..n]
, valid a b
]
CROSSREFS
Cf. A033996.
Sequence in context: A181530 A035362 A042957 * A341074 A343885 A264870
KEYWORD
nonn
AUTHOR
Piyush Kumar Jha, Jul 23 2025
STATUS
approved