restart: with(LinearAlgebra): with(combinat): # # SetA174283 - compute set of resistances such that # A174283(n) = card(SetA174283(n)) # Author Rainer Rosenthal, Oct 27 2020 # # Generators Series, Parallel, Bridge: # Ser := (x1,x2) -> x1 + x2: Par := (x1,x2) -> 1 / (1/x1 + 1/x2): Bri := (x1,x2,x3,x4,x5) -> (x2*x1*x4+x2*x1*x5+x5*x4*x1+x5*x4*x2+x3*(x2+x5)*(x1+x4))/ # -------------------------------------------------------- ((x1+x2)*(x4+x5)+x3*(x1+x4+x2+x5)): # # Derived set functions in this way: SetFkt(A,B) = {Fkt(a,b) | a in A and b in B} # SetSer := (X1,X2) -> {seq(seq( Ser(X1[i1],X2[i2]), i2=1..nops(X2)), i1=1..nops(X1))}: SetPar := (X1,X2) -> {seq(seq( Par(X1[i1],X2[i2]), i2=1..nops(X2)), i1=1..nops(X1))}: SetBri := (X1,X2,X3,X4,X5) -> {seq(seq(seq(seq(seq( Bri(X1[i1],X2[i2],X3[i3],X4[i4],X5[i5]), i5=1..nops(X5)), i4=1..nops(X4)), i3=1..nops(X3)), i2=1..nops(X2)), i1=1..nops(X1))}: SetA174283 := proc(n) option remember; local allres,k,w1,w2,xload,partload,i,addresi, permad,numad,wheremore,pw,increm,plan,ix,setsplanned; if n = 1 then return {1}; fi; allres := {}: allres := `union`(allres,seq(SetSer(SetA174283(k),SetA174283(n-k)),k=1..n/2)); allres := `union`(allres,seq(SetPar(SetA174283(k),SetA174283(n-k)),k=1..n/2)); # # Bridge combinations # xload := n - 5; # 5 arms in a bridge if xload >= 0 then partload := partition(xload); for i to nops(partload) do addresi := partload[i]; permad := permute(addresi); numad := nops(addresi); wheremore := choose(5,numad); for pw in wheremore do for increm in permad do plan := [1,1,1,1,1]; setsplanned := [{1},{1},{1},{1},{1}]; for ix to nops(pw) do setsplanned[pw[ix]] := SetA174283(plan[pw[ix]] + increm[ix]); od; allres := allres union SetBri(op(setsplanned)); od: od; od: fi; return allres; end: A174283 := n -> nops(SetA174283(n)): seq(A174283(n),n=1..12);