(*This Program is designed to compute the "Set of Configurations" and the "Set of Equivalent Resistances" of at most n Equal Resistors (n or fewer Resistors) connected in Series and/or Parallel.  The "Order of the Set of Configurations" is the Sequence A058351 (Partial sums of A000084): 1, 3, 7, 17, 41, 107, 287, 809, 2341, 6965, 21101, 65031, 202939, 640441, 2039509, 6546861, ....  The order of the Set of Equivalent Resistances is the Sequence A153588: 1, 3, 7, 15, 35, 77, 179, 429, 1039, 2525, 6235, 15463, 38513, 96231, 241519, 607339, ....  Start the Program by entering the value of n (n≥2).  Example: n = 4, NumberResistors = 4, NumberConfigurations = 17 and  NumberEquivalentResistances = 15.  Author: Sameen Ahmed KHAN, rohelakhan@yahoo.com, http://SameenAhmedKhan.webs.com/ and http://sites.google.com/site/rohelakhan/ E-Print archive: http://arxiv.org/abs/1004.3346/ (21 April 2010) Date: Wednesday the 21 April 2010*)

NumberResistors = 4;
ClearAll[CirclePlus, CircleTimes];
SetAttributes[
    {CirclePlus, CircleTimes}, {Flat, Orderless}]; 
SeriesCircuit[a_, b_]:= a⊕b;
ParallelCircuit[a_, b_]:= a⊗b;
F[a_,b_]:= 
    Flatten[Outer[SeriesCircuit, a, b] ⋃ Outer[ParallelCircuit, a, b], 2];
S = {{R}, {R⊕R, R⊗R}};
Do[SX = F[S[[1]], S[[i-1]]];
    Do[SX = Flatten[SX ⋃ F[S[[k]], S[[i-k]]], 2]; , {k, 2, i/2}];
    S = S ⋃ {SX}; , {i, 3, NumberResistors}];
SetConfigurations = Union[Flatten[Table[S, {i, NumberResistors}]]];
Print[StringForm["NumberResistors = ``, SetConfigurations = ``, NumberConfigurations = ``", NumberResistors, SetConfigurations, Dimensions[SetConfigurations]  ]]  (*This line displays the Full Set of Configurations*)
SetAttributes[{CirclePlus, CircleTimes}, {NumericFunction, OneIdentity}];
a_⊕b_:= a + b;
a_⊗b_:= a*b/(a + b);
CirclePlus[x_]:= x;
CircleTimes[x_]:= x;
SetResistances = Union[SetConfigurations/.R -> 1];
Print[StringForm["NumberResistors = ``, NumberConfigurations = ``,  NumberEquivalentResistances = ``, CPU time in seconds = ``"
                , NumberResistors, Dimensions[SetConfigurations], Dimensions[SetResistances], TimeUsed[%] ]]