#!/usr/local/bin/maple #-*- maplev -*- # Nathaniel Shar # HW 19 # Experimental Mathematics # It is okay to link to this assignment on the course webpage. Help := proc(): print(`Adn(d,n), IsBad(d,S), adnS(d,n), NdnS(d,n), Wn(A,FP,B,n), AdnM(d,n), adnM(d,n), NdnM(d,n), WGn(A,FP,B,n,BFP), AdjustBFP(a,B,FP,BFP), SFP(d,n, B), NdnC(d,n), WnX(A, FP, B, n, x), WGnX(A,FP,B,n,BFP, x), adnC(d,n), GuessRec1(L,r), GuessRec(L), WnR(A, FP, B, N)`): end: # From C19.txt: #Dedicated to Endre Szemeredi on the occaison of the Abel Prize 2012 with(combinat): #Let a_d(n) be the largest size of a subset of {1, ...,n} #avoiding arthmetical pogressions of length d #(Szemeredi's famous theorem says that a_d(n)/n->0) #d=3 is it the already deep Roth theorem who proved that #a_3(n)/n<=C/log(log(n)) #Adn(d,n): Inputs positive integers d and n and outputs #the set of all subsets of {1, ...,n} that DO NOT have #an arithmetical progression of length d Adn:=proc(d,n) local S,s1,i,T: S:=powerset(n): T:={}: for s1 in S do if not IsBad(d,s1) then #T:=T union {s1}: T:={op(T), s1}: fi: od: T: end: #IsBad(d,S): Does the set of pos. integers S contain #an AP of length d? IsBad:=proc(d,S) local m,S1,dif,PTM,j: option remember: if nops(S)FAIL then RETURN(ans): fi: od: FAIL: end: ############# WnR := proc(A, FP, B, N): GuessRec([seq(Wn(A, FP, B, n), n=1..N)]): end: # Problem 1: [[-1, -1], [2, 3]] # Problem 2: [[-1, -1], [2, 4]] # Problem 3: [[-1, -1, -1], [2, 4, 8]] # Problem 4: [[-26, 0, 0, 0, 2, -26, 676, -17576, 456976, -1, 26, 0, # 0, 0, -3, 26, -1352, 0, 0, 0, 0, 0, 0, 0, 1], [26, 676, 17576, # 456976, 11881375, 308915724, 8031808148, 208826994272, # 5429500937120, 141167000602370, 3670341397830146, 95428860279966824, # 2481149949625113728, 64509887831250168736, 1677256801278467538269, # 43608669492556433587452, 1133825215948714586103456, # 29479450652365844680379856, 766465587941714581179849616, # 19928101931970411885560383365, 518130563013877042540242072648, # 13471392370709989493023397440900, 350256142679548497482735104595720, # 9106658176736827011456605811559488, # 236773072738946929326737191050813688]]