yaworsw/euler-manager

View on GitHub
data/problems/155.yml

Summary

Maintainability
Test Coverage
---
:id: 155
:name: Counting Capacitor Circuits
:url: https://projecteuler.net/problem=155
:content: "An electric circuit uses exclusively identical capacitors of the same value
  C.  \nThe capacitors can be connected in series or in parallel to form sub-units,
  which can then be connected in series or in parallel with other capacitors or other
  sub-units to form larger sub-units, and so on up to a final circuit.\n\nUsing this
  simple procedure and up to <var>n</var> identical capacitors, we can make circuits
  having a range of different total capacitances. For example, using up to <var>n</var>=3
  capacitors of 60 ![]({{ images_dir }}/p155_capsmu.gif)F each, we can obtain the
  following 7 distinct total capacitance values:\n\n ![]({{ images_dir }}/p155_capacitors1.gif)\n\nIf
  we denote by <var>D</var>(<var>n</var>) the number of distinct total capacitance
  values we can obtain when using up to <var>n</var> equal-valued capacitors and the
  simple procedure described above, we have: <var>D</var>(1)=1, <var>D</var>(2)=3,
  <var>D</var>(3)=7 ...\n\nFind <var>D</var>(18).\n\n_Reminder :_ When connecting
  capacitors C<sub>1</sub>, C<sub>2</sub> etc in parallel, the total capacitance is
  C<sub>T</sub>&nbsp;=&nbsp;C<sub>1</sub>&nbsp;+&nbsp;C<sub>2</sub>&nbsp;+...,  \nwhereas
  when connecting them in series, the overall capacitance is given by: ![]({{ images_dir
  }}/p155_capsform.gif)\n\n"