(*This program (Monday the 08 March 2010) is designed to compute the "Set of Configurations" and the "Set of Equivalent Resistances" of n Equal Resistors connected in Series and/ or Parallel. The order of the Set of Equivalent Resistances is the Sequence A048211, whose first 22 terms are 1, 2, 4, 9, 22, 53, 131, 337, 869, 2213, 5691, 14517, 37017, 93731, 237465, 601093, 1519815, 3842575, 9720769, 24599577, 62283535, 157807915. The "Order of the Set of Configurations", is the Sequence A00084 : 1, 2, 4, 10, 24, 66, 180, 522, 1532, 4624, 14136, 43930, 137908, 437502, 1399068, 1399068, 4507352, ….Lines displaying the complete Set of Configurations and the Sets of Equivalent Resistances have been suppressed.Start the Program by entering the value of n.Example, n = 4, NumberResistors = 4, NumberConfigurations = 10 and NumberEquivalentResistances = 9. Author : Sameen Ahmed KHAN, rohelakhan@yahoo.com, http : // SameenAhmedKhan.webs.com/and http : // sites .google.com/site/rohelakhan/*) NumberResistors = 4; ClearAll[CirclePlus, Diamond]; SetAttributes[{CirclePlus, Diamond}, {Flat, Orderless}]; SeriesCircuit[a_, b_] := a\[CirclePlus]b; ParallelCircuit[a_, b_] := a\[Diamond]b; F[a_, b_] := Flatten[Outer[SeriesCircuit, a, b] \[Union] Outer[ParallelCircuit, a, b], 2]; S = {{R}, {R\[CirclePlus]R, R\[Diamond]R}}; Do[SX = F[S[[1]], S[[i - 1]]]; Do[SX = Flatten[SX \[Union] F[S[[k]], S[[i - k]]], 2];, {k, 2, i/2}]; S = S \[Union] {SX};, {i, 3, NumberResistors}]; (*S[[NumberResistors]]*)(*This line displays the Full Set of Configurations*) \ (*Print[StringForm["NumberResistors = ``, NumberConfigurations = ``", NumberResistors, Dimensions[S[[NumberResistors]]]]]*) SetAttributes[{CirclePlus, Diamond}, {NumericFunction, OneIdentity}]; a_\[CirclePlus]b_ := a + b; a_\[Diamond]b_ := a*b/(a + b); CirclePlus[x_] := x; Diamond[x_] := x; (*Print[S[[NumberResistors]] /. R -> 1]*)(*This line displays the Set of Equivalent Resistances corresponding to the Set of Configurations*) (*Print[Union[ S[[Number Resistors]] /. R -> 1]]*)(*This line displays the Full Set of Equivalent Resistances*) \ Print[StringForm[ "NumberResistors = ``, NumberConfigurations = ``, \ NumberEquivalentResistances = ``, CPU time in seconds = ``", NumberResistors, Dimensions[S[[NumberResistors]]], Dimensions[Union[S[[NumberResistors]]]], TimeUsed[%]]] [From Sameen Ahmed KHAN (rohelakhan(AT)yahoo.com), Mar 08 2010]