# OK to post homework # Vikrant, Apr 10 2022, Assignment 21 # ================================================================================ # 0. Code that has been given. # ================================================================================ read("C21.txt"): # ================================================================================ # 1. Fix JTseq. # ================================================================================ JTseq:= proc(N) local n,La,Lb,L,b,l: La:=aSeq(N): Lb:=bSeq(3*N): L:=[]: for n from 1 to N do b:= IsSquareFree(n) and La[n]=0 and (n mod 2=1 or Lb[n/2]=0): for l in L do b:= evalb(b or type(sqrt(n/l),integer)): od: if b then L:=[op(L),n]: fi: od: L: end: # ================================================================================ # 2. Square-freeness. # ================================================================================ IsSquareFree:= proc(N) evalb(add(ifactors(N)[2])[2]=nops(ifactors(N)[2])): end: IsCon:= proc(n): if n mod 2=1 and 2*nops(Tn(n,2,1,32))=nops(Tn(n,2,1,8)) then RETURN(IsSquareFree(n)): elif n mod 2=0 and 2*nops(Tn(n,8,2,64))=nops(Tn(n,8,2,16)) then RETURN(IsSquareFree(n)): fi: false: end: JTseqW:= proc(N) local n,L,l,b: L:=[]: for n from 1 to N do b:= IsCon(n): for l in L do b:= evalb(b or type(sqrt(n/l),integer)): od: if b then L:=[op(L),n]: fi: od: L: end: # ================================================================================ # 3. # ================================================================================ # ================================================================================ # 4. # ================================================================================