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.

A353589 Number of nondecreasing nonnegative integer quadruples (m,p,q,r) such that m^2 + p^2 + q^2 + r^2 = n^2 and m +- p +- q +- r = +- n.

This page as a plain text file.
%I A353589 #6 Jun 22 2022 20:58:59
%S A353589 1,1,2,2,2,2,4,2,2,4,4,4,4,3,4,6,2,5,8,5,4,6,8,5,4,7,6,9,4,6,12,6,2,
%T A353589 12,10,9,8,7,10,10,4,9,12,9,8,17,10,9,4,9,14,16,6,10,18,17,4,16,12,12,
%U A353589 12,11,12,17,2,16,24,13,10,18,18,13,8,14,14,26,10,17,20,14,4,23
%N A353589 Number of nondecreasing nonnegative integer quadruples (m,p,q,r) such that m^2 + p^2 + q^2 + r^2 = n^2 and m +- p +- q +- r = +- n.
%C A353589 Motivated by A354766 and A278085.
%e A353589 For n = 1, (0, 0, 0, 1) is the only solution.
%e A353589 For n = 2, (0, 0, 0, 2) and (1, 1, 1, 1) are solutions, with 1 + 1 + 1 - 1 = 2.
%o A353589 (PARI) apply( {A353589(n, show=0, cnt=0, n2=n^2, e=[1,-1]~)=
%o A353589   for(a=0,sqrtint(n2\4), for(b=a,sqrtint((n2-a^2)\3),
%o A353589     my(s=[a+b, b-a, a-b, -a-b]); foreach(sum2sqr(n2-a^2-b^2), cd, cd[1] >= b &&
%o A353589       vecsum(cd)+s[1] >= n && foreach(s, d, (vecsum(cd)+d==n || abs(cd*e+d)==n)&&
%o A353589         cnt++&& !(show && print1(concat([a, b], cd)))&& break)))); cnt}, [0..99]) \\ See A133388 for sum2sqr().
%Y A353589 Cf. A354766, A278085.
%K A353589 nonn
%O A353589 0,3
%A A353589 _M. F. Hasler_, Jun 20 2022