#Homework 13 by Ben Miles for Experimental math OK to post #Number 1 GuessH:=proc(L,n,N) local i,j,k: #i=order j=degree k:=nops(L): for i from 0 to k-7 do for j from 0 to floor((a-6)/(1+i))-1 do if GuessH1(L,i,j,n,N)<>FAIL then RETURN(GuessH1(L,i,j,n,N)): fi: od: od: FAIL: end: #Number 2 OTN:=proc(S,N) local L,x,P,i: P:=add(x^(op(i,S)),i=1..nops(S)); LIF(P,x,N): end: #Number 3 AllOTN:=proc(S,N) local S1, S2,i,n,PP,L,K: S2:=S minus {0}: with(combinat): PP:=powerset(S2): n:= nops(PP): L:={}: for i from 1 to n do S1:=op(i,PP): L:=L union {[S1, OTN({0} union S1, N)]}: od: L: end: #Number 4 Takes a long time plugging into the OEIS. #{2,3,4,5} and {1,3,4,5) are not in there But those are the only two I checked. #Old Stuff GuessH1:=proc(L,ORD,DEG,n,N) local ope,a,i,j,var,eq,n1,var1: if nops(L)<(1+ORD)*(1+DEG)+ORD+6 then RETURN(FAIL): fi: ope:=add(add(a[i,j]*n^i*N^j,i=0..DEG),j=0..ORD): var:={seq(seq(a[i,j],i=0..DEG),j=0..ORD)}: eq:={seq(add(subs(n=n1, coeff(ope,N,j))*L[n1+j],j=0..ORD), n1=1..(1+DEG)*(1+ORD)+6)}: var1:=solve(eq,var): ope:=subs(var1,ope): if ope=0 then RETURN(FAIL): fi: ope:=subs({seq(v=1, v in var)}, ope): ope:=add(factor(coeff(ope,N,j))*N^j, j=0..degree(ope,N)): end: LIF:=proc(P,u,N) local n: [seq(coeff(taylor(P^n, u=0,n),u,n-1)/n,n=1..N)]: end: