VOOZH
about
URL: https://oeis.org/A363051
⇱ A363051 - OEIS
login
A363051
a(n) = Sum_{b=0..floor(sqrt(n/2)), n-b^2 is square} b.
2
0, 1, 0, 0, 1, 0, 0, 2, 0, 1, 0, 0, 2, 0, 0, 0, 1, 3, 0, 2, 0, 0, 0, 0, 3, 1, 0, 0, 2, 0, 0, 4, 0, 3, 0, 0, 1, 0, 0, 2, 4, 0, 0, 0, 3, 0, 0, 0, 0, 6, 0, 4, 2, 0, 0, 0, 0, 3, 0, 0, 5, 0, 0, 0, 5, 0, 0, 2, 0, 0, 0, 6, 3, 5, 0, 0, 0, 0, 0, 4, 0, 1, 0
(
list
;
graph
;
refs
;
listen
;
history
;
text
;
internal format
)
OFFSET
1,8
COMMENTS
a(n) = 0 if n in
A022544
.
a(n) > 0 if n in
A001481
.
LINKS
Table of n, a(n) for n=1..83.
Project Euler,
Problem 273: Sum of Squares
MAPLE
A363051
:= proc(n)
local x, a ;
a := 0 ;
for x from 1 do
if x^2 > n/2 then
return a;
end if;
if issqr(n-x^2) then
a := a+x ;
end if;
end do:
end proc:
seq(
A363051
(n), n=1..100) ; #
R. J. Mathar
, Jan 31 2024
MATHEMATICA
a[n_]:=Sum[b Boole[IntegerQ[Sqrt[n-b^2]]], {b, 0, Floor[Sqrt[n/2]]}]; Array[a, 83] (*
Stefano Spezia
, May 15 2023 *)
PROG
(Python)
from gmpy2 import *
a = lambda n: sum([b for b in range(0, isqrt(n >> 1) + 1) if is_square(n - (b*b))])
print([a(n) for n in range(1, 84)])
(Python)
from sympy.solvers.diophantine.diophantine import diop_DN
def
A363051
(n): return sum(min(a) for a in diop_DN(-1, n))>>1 #
Chai Wah Wu
, May 16 2023
CROSSREFS
Cf.
A022544
,
A001481
,
A362961
.
Sequence in context:
A217540
A226861
A185643
*
A278515
A285709
A080101
Adjacent sequences:
A363048
A363049
A363050
*
A363052
A363053
A363054
KEYWORD
nonn
AUTHOR
Darío Clavijo
, May 14 2023
STATUS
approved