login
Number of times k^2 + (n-k)^2 is a square for 1 <= k <= n-1.
2

%I #24 Sep 08 2022 08:45:10

%S 0,0,0,0,0,2,0,0,0,0,0,0,2,0,0,2,0,0,0,2,0,2,0,0,0,0,2,0,0,2,0,0,2,2,

%T 0,0,0,0,0,2,2,0,0,0,2,2,0,4,0,2,0,0,0,0,2,0,0,0,0,0,2,2,0,0,0,0,2,2,

%U 2,2,0,2,0,0,0,2,0,2,0,0,2,0,2,2,0,0,0

%N Number of times k^2 + (n-k)^2 is a square for 1 <= k <= n-1.

%C a(n) is not zero for n = 7, 14, 17, 21, 23, 28, ... : A118905. - _Michel Marcus_, Jun 09 2013

%H Seiichi Manyama, <a href="/A082523/b082523.txt">Table of n, a(n) for n = 2..1000</a>

%t Table[Total[Boole[IntegerQ[Sqrt[#]]&/@Table[k^2+(n-k)^2,{k,n-1}]]],{n,2,90}] (* _Harvey P. Dale_, Aug 15 2017 *)

%o (PARI) a(n) = sum(k=1, n-1, issquare(k^2+(n-k)^2)) \\ _Michel Marcus_, Jun 09 2013

%o (Magma) [#[k:k in [1..n-1]|IsSquare(k^2+(n-k)^2)]:n in [2..90]]; // _Marius A. Burtea_, Jul 29 2019

%Y Cf. A118905.

%K nonn

%O 2,6

%A CHAUVIN thierry (thierry.chauvin2(AT)wanadoo.fr), Apr 30 2003

%E Edited and extended by _Michel Marcus_, Jun 09 2013