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 A349538 #61 Dec 19 2024 11:45:36 %S A349538 1,5,9,13,17,29,33,37,41,45,57,61,65,77,81,93,97,109,113,117,129,133, %T A349538 137,141,145,165,177,181,185,197,209,213,217,221,233,245,249,261,265, %U A349538 277,289,301,305,309,313,325,329,333,337,341,361,373,385,397,401,413,417,421,433,437,449 %N A349538 The number of pseudo-Pythagorean triples (which allow negative or 0 sides) on a 2D lattice that are on or inside a circle of radius n. %C A349538 Consider a 2D lattice, where the Cartesian coordinates x and y are legs of the Pythagorean triangle. Thus the notion of Pythagorean triple is extended to the cases when sides x, y are in Z (i.e., sides also include negative integers and zero). The sequence gives the number of such triples on or inside a circle of radius n. %C A349538 Partial sums of A046109. %H A349538 Alexander Kritov, <a href="/A349538/a349538_1.c.txt">Source code</a> %F A349538 a(n) = (A211432(n) + 1)/2. %F A349538 a(n) = a(n-1) + 4 + 8*A046080(n). %e A349538 Sides (coordinates) a(n) %e A349538 ------------------------------------------------------------------------------ %e A349538 (0,0) 1 %e A349538 (-1,0)(0,-1)(0,1)(1,0) 5 %e A349538 (-2,0)(0,-2)(0,2)(2,0) 9 %e A349538 (-3,0)(0,-3)(0,3)(3,0) 13 %e A349538 (-4,0)(0,-4)(0,4)(4,0) 17 %e A349538 (-5,0)(-4,-3)(-4,3)(-3,-4)(-3,4)(0,-5)(0,5)(3,-4)(3,4)(4,-3)(4,3)(5,0) 29 %e A349538 (-6,0)(0,-6)(0,6)(6,0) 33 %e A349538 (-7,0)(0,-7)(0,7)(7,0) 37 %e A349538 (-8,0)(0,-8)(0,8)(8,0) 41 %e A349538 (-9,0)(0,-9)(0,9)(9,0) 45 %e A349538 (-10,0)(-8,-6)(-8,6)(-6,-8)(-6,8)(0,-10)(0,10)(6,-8)(6,8)(8,-6)(8,6)(10,0) 57 %e A349538 (-11,0)(0,-11)(0,11)(11,0) 61 %e A349538 (-12,0)(0,-12)(0,12)(12,0) 65 %o A349538 (C) /* See links */ %o A349538 (PARI) f(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)); \\ A046109 %o A349538 a(n) = sum(k=0, n, f(k)); \\ _Michel Marcus_, Nov 27 2021 %Y A349538 Cf. A046080, A211432, A046109 (first differences), A349536 (in 1/8 sector). %K A349538 nonn %O A349538 0,2 %A A349538 _Alexander Kritov_, Nov 21 2021