A375338 Number of distinct, irreducible ways that a Pythagorean hyperrectangle of 2 or more dimensions can produce diagonal length n.
0, 1, 1, 1, 1, 1, 3, 5, 8, 5, 12, 16, 14, 23, 17, 52, 57, 58, 108, 104, 113, 174, 248, 359, 217, 265, 406, 597, 731, 579, 1137, 1525, 1137, 1400, 1898, 2659, 3136, 3073, 3203, 5021, 4660, 5022, 8410, 8850, 7748, 10066, 15455, 18718, 17354, 12118, 18483, 22683
Offset: 1
Keywords
Examples
a(2)=1: {1, 1, 1, 1} a(3)=1: {1, 2, 2} ... a(7)=3: {1, 4, 4, 4}, {2, 2, 4, 5}, {2, 3, 6} 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} ... Not counted: {0} -> 0 (0 length base, <2 dimensions) {1} -> 1 (<2 dimensions) {1, 1, 1, 1, 1, 1, 1, 1, 1} -> 3 (contains subset {1, 1, 1, 1} -> 2) {4, 3} -> 5 (indistinct from {3, 4} -> 5) {6, 8} -> 10 (reduces to {3, 4} -> 5) {5, 6, 6, 8, 8} -> 15 (reduces to {5, 10, 10} -> 15, then to {1, 2, 2} -> 3)
Crossrefs
Cf. A037444.
Programs
-
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 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 for(n=1, 52, print(n, " ", a(n)))
Comments