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 A008846 #105 Jul 10 2025 19:50:29 %S A008846 5,13,17,25,29,37,41,53,61,65,73,85,89,97,101,109,113,125,137,145,149, %T A008846 157,169,173,181,185,193,197,205,221,229,233,241,257,265,269,277,281, %U A008846 289,293,305,313,317,325,337,349,353,365,373,377,389,397,401,409,421,425,433 %N A008846 Hypotenuses of primitive Pythagorean triangles. %C A008846 Numbers of the form x^2 + y^2 where x is even, y is odd and gcd(x, y)=1. Essentially the same as A004613. %C A008846 Numbers n for which there is no solution to 4/n = 2/x + 1/y for integers y > x > 0. Related to A073101. - _T. D. Noe_, Sep 30 2002 %C A008846 Discovered by Frénicle (on Pythagorean triangles): Méthode pour trouver ..., page 14 on 44. First text of Divers ouvrages ... Par Messieurs de l'Académie Royale des Sciences, in-folio, 6+518+1 pp., Paris, 1693. Also A020882 with only one of doubled terms (first: 65). - _Paul Curtz_, Sep 03 2008 %C A008846 All divisors of terms are of the form 4*k+1 (products of members of A002144). - _Zak Seidov_, Apr 13 2011 %C A008846 A024362(a(n)) > 0. - _Reinhard Zumkeller_, Dec 02 2012 %C A008846 Closed under multiplication. Primitive elements are in A002144. - _Jean-Christophe Hervé_, Nov 10 2013 %C A008846 Not only the square of these numbers is equal to the sum of two nonzero squares, but the numbers themselves also are; this sequence is then a subsequence of A004431. - _Jean-Christophe Hervé_, Nov 10 2013 %C A008846 Conjecture: numbers p for which sqrt(-1) exists in the p-adic numbering system. For example the 5-adic number ...2431212, when squared, gives ...4444444, which is -1, and 5 is in the sequence. - _Thierry Banel_, Aug 19 2022 %C A008846 The above conjecture was proven true by George Bergman. 3 known facts: (1) prime factors of a(n) are equal to 1 mod 4, (2) modulo such primes, sqrt(-1) exists, (3) if sqrt(m) exists mod r, r being odd, this extends to sqrt(m) in the r-adic ring. - _Thierry Banel_, Jul 04 2025 %D A008846 A. H. Beiler, Recreations in the Theory of Numbers, Dover, NY, 1964, pp. 10, 107. %H A008846 Zak Seidov, <a href="/A008846/b008846.txt">Table of n, a(n) for n = 1..87881</a> (with a(n) up to 10^6). %H A008846 Ron Knott, <a href="http://www.maths.surrey.ac.uk/hosted-sites/R.Knott/Pythag/pythag.html">Pythagorean Triples and Online Calculators</a> %F A008846 x^2 + y^2 where x is even, y is odd and gcd(x, y)=1. Essentially the same as A004613. %p A008846 for x from 1 by 2 to 50 do for y from 2 by 2 to 50 do if gcd(x,y) = 1 then print(x^2+y^2); fi; od; od; [ then sort ]. %t A008846 Union[ Map[ Plus@@(#1^2)&, Select[ Flatten[ Array[ {2*#1, 2*#2-1}&, {10, 10} ], 1 ], GCD@@#1 == 1& ] ] ] (* _Olivier Gérard_, Aug 15 1997 *) %t A008846 lst = {}; Do[ If[ GCD[m, n] == 1, a = 2 m*n; b = m^2 - n^2; c = m^2 + n^2; AppendTo[lst, c]], {m, 100}, {n, If[ OddQ@m, 2, 1], m - 1, 2}]; Take[ Union@ lst, 57] (* _Robert G. Wilson v_, May 02 2009 *) %t A008846 Union[Sqrt[#[[1]]^2+#[[2]]^2]&/@Union[Sort/@({Times@@#,(Last[#]^2-First[#]^2)/2}&/@ (Select[Subsets[Range[1,33,2],{2}],GCD@@#==1&]))]] (* _Harvey P. Dale_, Aug 26 2012 *) %o A008846 (Haskell) %o A008846 a008846 n = a008846_list !! (n-1) %o A008846 a008846_list = filter f [1..] where %o A008846 f n = all ((== 1) . (`mod` 4)) $ filter ((== 0) . (n `mod`)) [1..n] %o A008846 -- _Reinhard Zumkeller_, Apr 27 2011 %o A008846 (PARI) is(n)=Set(factor(n)[,1]%4)==[1] \\ _Charles R Greathouse IV_, Nov 06 2015 %o A008846 (Python) # for an array from the beginning %o A008846 from math import gcd, isqrt %o A008846 hypothenuses_upto = 433 %o A008846 A008846 = set() %o A008846 for x in range(2, isqrt(hypothenuses_upto)+1): %o A008846 for y in range(min(x-1, (yy:=isqrt(hypothenuses_upto-x**2))-(yy%2 == x%2)) , 0, -2): %o A008846 if gcd(x,y) == 1: A008846.add(x**2 + y**2) %o A008846 print(A008846:=sorted(A008846)) # _Karl-Heinz Hofmann_, Sep 30 2024 %o A008846 (Python) # for single k %o A008846 from sympy import factorint %o A008846 def A008846_isok(k): return not any([(pf-1) % 4 for pf in factorint(k)]) # _Karl-Heinz Hofmann_, Oct 01 2024 %Y A008846 Subsequence of A004431 and of A000404 and of A339952; primitive elements: A002144. %Y A008846 Cf. A004613, A020882, A073101. %Y A008846 Cf. A137409 (complement), disjoint union of A024409 and A120960. %K A008846 nonn,nice,easy %O A008846 1,1 %A A008846 _N. J. A. Sloane_, Ralph Peterson (RALPHP(AT)LIBRARY.nrl.navy.mil) %E A008846 More terms from _T. D. Noe_, Sep 30 2002