#OK to post homework #Natalya Ter-Saakov, April 10, Assignment 21 read "C21.txt": #Problem 1 #JTseq(N): The first N terms of the sequence of congruent numbers, those that are areas of right-angled triangle #with rational sides. Shuold be called the Tunnell numbers JTseq:=proc(N) local n,La,Lb,L: with(NumberTheory): La:=aSeq(N): Lb:=bSeq(N): L:=[]: for n from 2 to N do if IsSquareFree(n) then if n mod 2 = 1 and La[n]=0 then L:=[op(L),n]: fi: if n mod 2 = 0 and Lb[n/2]=0 then L:=[op(L),n]: fi: fi: od: L: end: #Problem 2 #JTseqW(N): All the terms <=N of the sequence of congruent numbers, those that are areas of right-angled triangle #with rational sides. Shuold be called the Tunnell numbers; Using the Wikipedia version JTseqW:=proc(N) local n,L: L:=[]: for n from 1 to N do if IsCon(n) and IsSquareFree(n) then L:=[op(L),n]: fi: od: L: end: