login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A349120
Primitive Pythagorean triples [a, b, c] in lexicographic order with a < b < c such that [w(a), w(b), w(c)] is also a primitive Pythagorean triple, where w(n) is the binary weight of n.
0
11, 60, 61, 19, 180, 181, 25, 312, 313, 35, 612, 613, 41, 840, 841, 47, 1104, 1105, 49, 1200, 1201, 52, 165, 173, 57, 176, 185, 67, 2244, 2245, 97, 4704, 4705, 104, 153, 185, 105, 208, 233, 105, 608, 617, 131, 8580, 8581, 133, 156, 205, 145, 408, 433, 145, 10512, 10513, 165, 532, 557, 181, 16380, 16381, 193, 18624, 18625
OFFSET
1,1
EXAMPLE
[11, 60, 61] is a primitive Pythagorean triple, and [w(11), w(60), w(61)] = [3, 4, 5] is also a primitive Pythagorean triple, thus 11, 60, and 61 are members.
PROG
(PARI) ppt(a) = {my(L=List(), b, c, d, g); fordiv(a^2, d, g=a^2\d; if(d<=g && (d+g)%2==0, c=(d+g)\2; b=g-c; if(a<b && gcd(b, c)==1, listput(L, [a, b, c])))); vecsort(Vec(L), , 2); } \\ A263728
isok(t) = {my(ht = vecsort(apply(hammingweight, t))); (ht[1]^2 + ht[2]^2 == ht[3]^2) && (gcd(ht)==1); }
lista(nn) = {my(list=List()); for (n=1, nn, my(v = ppt(n)); if (#v, for (k=1, #v, if (isok(v[k]), listput(list, v[k])); ); ); ); Vec(list); } \\ Michel Marcus, Nov 10 2021
CROSSREFS
Sequence in context: A241860 A082884 A193230 * A077036 A076604 A076676
KEYWORD
nonn,base,tabf
AUTHOR
Ctibor O. Zizka, Nov 08 2021
STATUS
approved