cp's OEIS Frontend

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.

A005767 Solutions n to n^2 = a^2 + b^2 + c^2 (a,b,c > 0).

This page as a plain text file.
%I A005767 #28 Feb 14 2025 15:33:54
%S A005767 3,6,7,9,11,12,13,14,15,17,18,19,21,22,23,24,25,26,27,28,29,30,31,33,
%T A005767 34,35,36,37,38,39,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,
%U A005767 58,59,60,61,62,63,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,81,82,83,84,85
%N A005767 Solutions n to n^2 = a^2 + b^2 + c^2 (a,b,c > 0).
%C A005767 All numbers not equal to some 2^k or 5*2^k [Fraser and Gordon]. - Joseph Biberstine (jrbibers(AT)indiana.edu), Jul 28 2006
%D A005767 T. Nagell, Introduction to Number Theory, Wiley, 1951, p. 194.
%H A005767 T. D. Noe, <a href="/A005767/b005767.txt">Table of n, a(n) for n = 1..1000</a>
%H A005767 O. Fraser and B. Gordon, <a href="http://www.jstor.org/stable/2317949">On representing a square as the sum of three squares</a>, Amer. Math. Monthly, 76 (1969), 922-923.
%F A005767 a(n) = n + 2*log_2(n) + O(1). - _Charles R Greathouse IV_, Sep 01 2015
%F A005767 A169580(n) = a(n)^2. - _R. J. Mathar_, Aug 15 2023
%t A005767 z=100;lst={};Do[a2=a^2;Do[b2=b^2;Do[c2=c^2;e2=a2+b2+c2;e=Sqrt[e2];If[IntegerQ[e]&&e<=z,AppendTo[lst,e]],{c,b,1,-1}],{b,a,1,-1}],{a,1,z}];Union@lst (* _Vladimir Joseph Stephan Orlovsky_, May 19 2010 *)
%o A005767 (PARI) is(n)=if(n%5,n,n/5)==2^valuation(n,2) \\ _Charles R Greathouse IV_, Mar 12 2013
%o A005767 (Python)
%o A005767 def A005767(n):
%o A005767     def f(x): return n+x.bit_length()+(x//5).bit_length()
%o A005767     m, k = n, f(n)
%o A005767     while m != k: m, k = k, f(k)
%o A005767     return m # _Chai Wah Wu_, Feb 14 2025
%Y A005767 Complement of A094958. Cf. A169580, A000378, A000419, A000408.
%Y A005767 For primitive solutions see A005818.
%K A005767 nonn,easy
%O A005767 1,1
%A A005767 _N. J. A. Sloane_, Ralph Peterson (ralphp(AT)library.nrl.navy.mil)
%E A005767 More terms from _T. D. Noe_, Mar 04 2010