login
Number of distinct, irreducible ways that a Pythagorean hyperrectangle of 2 or more dimensions can produce diagonal length n.
0

%I #9 Sep 03 2024 01:38:47

%S 0,1,1,1,1,1,3,5,8,5,12,16,14,23,17,52,57,58,108,104,113,174,248,359,

%T 217,265,406,597,731,579,1137,1525,1137,1400,1898,2659,3136,3073,3203,

%U 5021,4660,5022,8410,8850,7748,10066,15455,18718,17354,12118,18483,22683

%N Number of distinct, irreducible ways that a Pythagorean hyperrectangle of 2 or more dimensions can produce diagonal length n.

%C Here "irreducible" means the base and diagonal lengths are coprime, and no subset of bases form smaller Pythagorean hyperrectangles.

%C Subset of cases counted in A037444, which includes nonreduced cases and 1 dimensional cases.

%e a(2)=1: {1, 1, 1, 1}

%e a(3)=1: {1, 2, 2}

%e ...

%e a(7)=3: {1, 4, 4, 4}, {2, 2, 4, 5}, {2, 3, 6}

%e a(8)=5: {1, 1, 1, 5, 6}, {1, 1, 2, 3, 7}, {1, 2, 3, 5, 5}, {1, 3, 3, 3, 6}, {2, 2, 2, 3, 3, 3, 5}

%e ...

%e Not counted:

%e {0} -> 0 (0 length base, <2 dimensions)

%e {1} -> 1 (<2 dimensions)

%e {1, 1, 1, 1, 1, 1, 1, 1, 1} -> 3 (contains subset {1, 1, 1, 1} -> 2)

%e {4, 3} -> 5 (indistinct from {3, 4} -> 5)

%e {6, 8} -> 10 (reduces to {3, 4} -> 5)

%e {5, 6, 6, 8, 8} -> 15 (reduces to {5, 10, 10} -> 15, then to {1, 2, 2} -> 3)

%o (PARI) a(n)=if(n, /* globals */ v=List([n]); c=n^2; a_n=0); if(c==0, if(#v>=3 && gcd(concat(v))==1, a_n++); return); my(b=if(#v>=2, v[#v], 1)-1); while(b++ && b^2<=c, if(hassub(b^2)==true, next); listput(v, b); c-=b^2; a(); c+=b^2; listpop(v)); a_n

%o hassub(b2)=my(r=false); for(t=1, 2^(#v-1)-1-if(b2==c, 1, 0), my(tb=binary(t)); if(issquare(b2+sum(i=0, #tb-1, tb[#tb-i]*v[#v-i]^2)), r=true; break)); r

%o for(n=1, 52, print(n, " ", a(n)))

%Y Cf. A037444.

%K nonn

%O 1,7

%A _Charles L. Hohn_, Aug 12 2024