login
A005767
Solutions k to k^2 = a^2 + b^2 + c^2 (a,b,c > 0).
11
3, 6, 7, 9, 11, 12, 13, 14, 15, 17, 18, 19, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 33, 34, 35, 36, 37, 38, 39, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 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
OFFSET
1,1
COMMENTS
All numbers not equal to some 2^k or 5*2^k [Fraser and Gordon]. - Joseph Biberstine (jrbibers(AT)indiana.edu), Jul 28 2006
REFERENCES
T. Nagell, Introduction to Number Theory, Wiley, 1951, p. 194.
LINKS
Chai Wah Wu, Table of n, a(n) for n = 1..10000 (terms 1..1000 from T. D. Noe)
O. Fraser and B. Gordon, On representing a square as the sum of three squares, Amer. Math. Monthly, 76 (1969), 922-923.
FORMULA
a(n) = n + 2*log_2(n) + O(1). - Charles R Greathouse IV, Sep 01 2015
A169580(n) = a(n)^2. - R. J. Mathar, Aug 15 2023
For n>=32, a(n) = n+m+1 if n+m>=A094958(m+1) and a(n) = n+m otherwise, where m = A070939(n)+A070939(floor(n/5)). - Chai Wah Wu, Jan 25 2026
MATHEMATICA
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 *)
PROG
(PARI) is(n)=if(n%5, n, n/5)==2^valuation(n, 2) \\ Charles R Greathouse IV, Mar 12 2013
(Python)
def A005767(n):
def f(x): return n+x.bit_length()+(x//5).bit_length()
m, k = n, f(n)
while m != k: m, k = k, f(k)
return m # Chai Wah Wu, Feb 14 2025
(Python)
def A005767(n): return (3, 6, 7, 9, 11, 12, 13, 14, 15, 17, 18, 19, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 33, 34, 35, 36, 37, 38, 39, 41)[n-1] if n<32 else n+(m:=n.bit_length()+(n//5).bit_length())+(n+m>=(1<<m if m<3 else 5<<((m+1>>1)-2) if m&1 else 1<<(m+1>>1)+1)) # Chai Wah Wu, Jan 25 2026
CROSSREFS
Complement of A094958. Cf. A169580, A000378, A000419, A000408, A070939.
For primitive solutions see A005818.
Sequence in context: A288938 A282140 A071530 * A085837 A176237 A187811
KEYWORD
nonn,easy
AUTHOR
N. J. A. Sloane, Ralph Peterson (ralphp(AT)library.nrl.navy.mil)
EXTENSIONS
More terms from T. D. Noe, Mar 04 2010
STATUS
approved