This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A384797 #14 Jul 07 2025 20:19:52 %S A384797 2,3,4,5,5,7,7,8,9,10,10,12,11,12,14,15,13,17,15,18,18,19,17,21,21,21, %T A384797 22,23,22,26,23,26,27,24,28,31,28,29,29,34,28,34,32,32,37,34,35,38,36, %U A384797 38,38,39,34,40,42,44,43,44,42,49,42,42,46,45,51,50,46,47,50 %N A384797 a(n) = A047800(n) - A047800(n-1). %C A384797 This is the number of distinct positive distances of the [0,n] X [0,n] points of a lattice square from the origin that are added when the size of the square is increased from n-1 to n. Among the newly added squared distances n^2, n^2+1^2, n^2+2^2, ..., n^2+n^2, some may already have occurred in smaller lattice point squares and are therefore not counted. %H A384797 Hugo Pfoertner, <a href="/A384797/b384797.txt">Table of n, a(n) for n = 1..10000</a> %e A384797 a(1) = 2: Newly added squared distances are 1 and 2. %e A384797 a(5) = 5: The squared distance 25=5^2+0^2 already occurs as 4^2+3^2. %e A384797 a(13) = 11: There are 3 already represented squared distances, 13^2+0^2=12^2+5^2, 13^2+1^2=11^2+7^2, 13^2+4^2=11^2+8^2. %o A384797 (Python) %o A384797 def A384797(n): %o A384797 s = set(i**2+j**2 for i in range(n) for j in range(i+1)) %o A384797 return n+1-sum(1 for i in range(n+1) if n**2+i**2 in s) # _Chai Wah Wu_, Jul 07 2025 %Y A384797 Cf. A047800, A160663, A384798, A384799. %K A384797 nonn,easy %O A384797 1,1 %A A384797 _Hugo Pfoertner_, Jun 17 2025