<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:evnet="http://www.mscommunities.com/rssmodule/"><channel><title>Comment Feed for Switching our Christmas tree bulbs (Posts on Channel 8)</title><atom:link rel="self" type="application/rss+xml" href="http://channel8.msdn.com/posts/switching-our-christmas-tree-bulbs/rss/default.aspx" /><image><url>http://mschnlnine.vo.llnwd.net/d1//App_Themes/Channel8/images/feedimage.png</url><title>Comment Feed for Switching our Christmas tree bulbs (Posts on Channel 8)</title><link>http://channel8.msdn.com/Posts/Switching-our-Christmas-tree-bulbs/</link></image><description>Switching our Christmas tree bulbs</description><link>http://channel8.msdn.com/Posts/Switching-our-Christmas-tree-bulbs/</link><language>en-us</language><pubDate>Wed, 26 Dec 2007 23:37:02 GMT</pubDate><lastBuildDate>Wed, 26 Dec 2007 23:37:02 GMT</lastBuildDate><generator>EvNet (EvNet, Version=1.0.3121.26304, Culture=neutral, PublicKeyToken=null)</generator><item><title>Re: Switching our Christmas tree bulbs</title><description>&lt;p&gt;Just for curiosity, I coded both solution on Matlab and measured the performance of both algorithms (for 365 bulbs). The first one took 0.019566 seconds to complete. The second one (aka, the optimized version ;-) ) took exactly 0.000344 seconds. Maybe not a big deal for 365 bulbs but as you said, if we think bigger the difference is huge!&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Keep the puzzles coming ;-) Happy Holidays!&lt;/p&gt;</description><comments></comments><link>http://channel8.msdn.com/Posts/Switching-our-Christmas-tree-bulbs/?CommentID=824</link><pubDate>Wed, 26 Dec 2007 23:37:02 GMT</pubDate><guid isPermaLink="true">http://channel8.msdn.com/Posts/Switching-our-Christmas-tree-bulbs/?CommentID=824</guid><evnet:views>0</evnet:views><evnet:viewtrackingurl>http://channel8.msdn.com/824/WebViewBug.aspx?EVT=0</evnet:viewtrackingurl><evnet:previewtext>Just for curiosity, I coded both solution on Matlab and measured the performance of both algorithms (for 365 bulbs). The first one took 0.019566 seconds to complete. The second one (aka, the optimized version ;-) ) took exactly 0.000344 seconds. Maybe not a big deal for 365 bulbs but as you said, if&amp;#8230;</evnet:previewtext><dc:creator>Jose</dc:creator><slash:comments>0</slash:comments><wfw:commentRss></wfw:commentRss><trackback:ping>http://channel8.msdn.com/824/Trackback.aspx</trackback:ping></item><item><title>Re: Re: Re: Re: Re: Re: Switching our Christmas tree bulbs</title><description>&lt;p&gt;That's true, hehe... My first solution was very similar to yours, then I tried to improve it and took a paper and a pen, I was trying to extract a rule to determine the amount of divisors of a given number. In this problem, we will have ON at the end all those bulbs tagged with a number that has an odd amount of divisors (whatever they are).&lt;/p&gt;
&lt;p&gt;In most cases, a number has an even number of divisors, because they are grouped in multiplications. &lt;/p&gt;
&lt;p&gt;For instance, the number 50: &lt;/p&gt;
&lt;p&gt;1x50; 2x25;&amp;nbsp;and 5x10; &lt;/p&gt;
&lt;p&gt;We have 3 multiplications, then, we have 6 divisors.&lt;/p&gt;
&lt;p&gt;The perfect squares have an integer square root, so, we have an even number of multiplication factors&amp;nbsp;but one of those multiplications&amp;nbsp;is formed by only one number mutiplied by itself. Then, a perfect square will always have an odd number of divisors, and will remain ON at the end of this problem :-)&lt;/p&gt;
&lt;p&gt;Consider 100:&lt;/p&gt;
&lt;p&gt;1x100 (we should switch the bulb on day 1 and 100)&lt;/p&gt;
&lt;p&gt;2x50 (two more swtchings)&lt;/p&gt;
&lt;p&gt;4x25 (two more)&lt;/p&gt;
&lt;p&gt;5x20 (two more)&lt;/p&gt;
&lt;p&gt;10x10 (one more, the square root)&lt;/p&gt;
&lt;p&gt;Number 100 has 9 divisors. &lt;/p&gt;
&lt;p&gt;Tomorrow a new puzzle, cheers! :-)&lt;/p&gt;</description><comments></comments><link>http://channel8.msdn.com/Posts/Switching-our-Christmas-tree-bulbs/?CommentID=821</link><pubDate>Wed, 26 Dec 2007 18:47:46 GMT</pubDate><guid isPermaLink="true">http://channel8.msdn.com/Posts/Switching-our-Christmas-tree-bulbs/?CommentID=821</guid><evnet:views>0</evnet:views><evnet:viewtrackingurl>http://channel8.msdn.com/821/WebViewBug.aspx?EVT=0</evnet:viewtrackingurl><evnet:previewtext>That's true, hehe... My first solution was very similar to yours, then I tried to improve it and took a paper and a pen, I was trying to extract a rule to determine the amount of divisors of a given number. In this problem, we will have ON at the end all those bulbs tagged with a number that has an&amp;#8230;</evnet:previewtext><dc:creator>Miguel</dc:creator><slash:comments>0</slash:comments><wfw:commentRss></wfw:commentRss><trackback:ping>http://channel8.msdn.com/821/Trackback.aspx</trackback:ping></item><item><title>Re: Re: Re: Re: Re: Switching our Christmas tree bulbs</title><description>I couldn't have thought of the squares the first time around... it struck me only after u asked me to list all the bulbs that glow (which is when i actually saw the numbers).&lt;br /&gt;&lt;br /&gt;algorithms is an interesting topic indeed.&lt;br /&gt;&lt;br /&gt;Happy holidays &amp;amp; happy new year :)&lt;br /&gt;</description><comments></comments><link>http://channel8.msdn.com/Posts/Switching-our-Christmas-tree-bulbs/?CommentID=819</link><pubDate>Wed, 26 Dec 2007 18:25:37 GMT</pubDate><guid isPermaLink="true">http://channel8.msdn.com/Posts/Switching-our-Christmas-tree-bulbs/?CommentID=819</guid><evnet:views>0</evnet:views><evnet:viewtrackingurl>http://channel8.msdn.com/819/WebViewBug.aspx?EVT=0</evnet:viewtrackingurl><evnet:previewtext>I couldn't have thought of the squares the first time around... it struck me only after u asked me to list all the bulbs that glow (which is when i actually saw the numbers).algorithms is an interesting topic indeed.Happy holidays &amp;amp; happy new year :)</evnet:previewtext><dc:creator>sriram</dc:creator><slash:comments>0</slash:comments><wfw:commentRss></wfw:commentRss><trackback:ping>http://channel8.msdn.com/819/Trackback.aspx</trackback:ping></item><item><title>Re: Re: Re: Re: Switching our Christmas tree bulbs</title><description>&lt;p&gt;That is much better folk :-)&lt;/p&gt;
&lt;p&gt;So, the basic solution could be something like this:&lt;/p&gt;
&lt;p&gt;int i=1;&lt;/p&gt;
&lt;p&gt;while(i*i&amp;lt;=limit){&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bulbsOn[i]=i*i;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; i++;&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;This gives you a sqrt(n) complexity. You will only have 10 steps for 100 bulbs, 1000 for 1,000,000 bulbs...&lt;/p&gt;
&lt;p&gt;What about a more efficient solution? Tip: Dynamic programming ;-)&lt;/p&gt;
&lt;p&gt;And, in conclusion: Which is the moral of this problem?&lt;/p&gt;
&lt;p&gt;You, like I did the first time and most of people trying to solve this problem, have tried to code before trying to find the optimal approach for the problem.&lt;/p&gt;
&lt;p&gt;A very wise friend of mine said one time: "When you have a hammer, everything seems a nail to hammer in"&lt;/p&gt;
&lt;p&gt;We use to talk about high-level languages, like C#, Java... We use to add even more libraries or namespaces&amp;nbsp;to these languages, very powerful libraries and languages...&lt;/p&gt;
&lt;p&gt;But we shouldn't forget that the most powerful weapons that humans have are mathematics and logic ;-)&lt;/p&gt;
&lt;p&gt;Next puzzle in a few days, I am glad you liked this one :-)&lt;/p&gt;</description><comments></comments><link>http://channel8.msdn.com/Posts/Switching-our-Christmas-tree-bulbs/?CommentID=817</link><pubDate>Wed, 26 Dec 2007 15:37:41 GMT</pubDate><guid isPermaLink="true">http://channel8.msdn.com/Posts/Switching-our-Christmas-tree-bulbs/?CommentID=817</guid><evnet:views>0</evnet:views><evnet:viewtrackingurl>http://channel8.msdn.com/817/WebViewBug.aspx?EVT=0</evnet:viewtrackingurl><evnet:previewtext>That is much better folk :-)
So, the basic solution could be something like this:
int i=1;
while(i*i&amp;lt;=limit){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bulbsOn[i]=i*i;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; i++;
}
This gives you a sqrt(n) complexity. You will only have 10 steps for 100 bulbs,&amp;#8230;</evnet:previewtext><dc:creator>Miguel</dc:creator><slash:comments>0</slash:comments><wfw:commentRss></wfw:commentRss><trackback:ping>http://channel8.msdn.com/817/Trackback.aspx</trackback:ping></item><item><title>Re: Re: Re: Switching our Christmas tree bulbs</title><description>Yeah.....&lt;br /&gt;
all these numbers are perfect squares....&lt;br /&gt;
&lt;br /&gt;
for a given date: n ,&lt;br /&gt;
all bulbs with perfect square roots between 1-n will glow...&lt;br /&gt;
for bulbs n+1 to 365,&lt;br /&gt;
all bulbs that are integral multiples of (2 to n)*(m) &amp;lt;365 will glow. [where m ranges from n to 183]&lt;br /&gt;</description><comments></comments><link>http://channel8.msdn.com/Posts/Switching-our-Christmas-tree-bulbs/?CommentID=816</link><pubDate>Wed, 26 Dec 2007 15:16:49 GMT</pubDate><guid isPermaLink="true">http://channel8.msdn.com/Posts/Switching-our-Christmas-tree-bulbs/?CommentID=816</guid><evnet:views>0</evnet:views><evnet:viewtrackingurl>http://channel8.msdn.com/816/WebViewBug.aspx?EVT=0</evnet:viewtrackingurl><evnet:previewtext>Yeah.....
all these numbers are perfect squares....

for a given date: n ,
all bulbs with perfect square roots between 1-n will glow...
for bulbs n+1 to 365,
all bulbs that are integral multiples of (2 to n)*(m) &amp;lt;365 will glow. [where m ranges from n to 183]</evnet:previewtext><dc:creator>sriram</dc:creator><slash:comments>0</slash:comments><wfw:commentRss></wfw:commentRss><trackback:ping>http://channel8.msdn.com/816/Trackback.aspx</trackback:ping></item><item><title>Re: Re: Switching our Christmas tree bulbs</title><description>&lt;p&gt;Good solution: you have found the correct bulbs... Congrat!! :-)&lt;/p&gt;
&lt;p&gt;Regarding to the algorithm, I have a complexity of sqrt(n) for the first execution, that could also be improved for next executions changing the size of the problem (number of bulbs and days)&amp;nbsp;if we use dynamic programming...&lt;/p&gt;
&lt;p&gt;I will give you just one more clue: those numbers are special from a mathematical perspective ;-)&lt;/p&gt;</description><comments></comments><link>http://channel8.msdn.com/Posts/Switching-our-Christmas-tree-bulbs/?CommentID=815</link><pubDate>Wed, 26 Dec 2007 15:02:08 GMT</pubDate><guid isPermaLink="true">http://channel8.msdn.com/Posts/Switching-our-Christmas-tree-bulbs/?CommentID=815</guid><evnet:views>0</evnet:views><evnet:viewtrackingurl>http://channel8.msdn.com/815/WebViewBug.aspx?EVT=0</evnet:viewtrackingurl><evnet:previewtext>Good solution: you have found the correct bulbs... Congrat!! :-)
Regarding to the algorithm, I have a complexity of sqrt(n) for the first execution, that could also be improved for next executions changing the size of the problem (number of bulbs and days)&amp;nbsp;if we use dynamic programming...
I&amp;#8230;</evnet:previewtext><dc:creator>Miguel</dc:creator><slash:comments>0</slash:comments><wfw:commentRss></wfw:commentRss><trackback:ping>http://channel8.msdn.com/815/Trackback.aspx</trackback:ping></item><item><title>Re: Switching our Christmas tree bulbs</title><description>I am prolly the laziest person u would ever meet... &lt;br /&gt;my method is greedy! :D&lt;br /&gt;and the bulbs you asked: for day 365:&lt;br /&gt;1,4,9,16,25,36,49,64,81,100,121,144,169,196,225,256,289,324,361&lt;br /&gt;&lt;br /&gt;Below, was my first program .... inefficient to the core...&lt;br /&gt;for (int j = 2; j &amp;lt;= limit; j++)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for (int i = j; i &amp;lt; 366; i++)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (i%j == 0)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (light[i] == false)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; light[i] = true;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else if (light[i] == true)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; light[i] = false;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;Order of n^2 [baaaad] :(&lt;br /&gt;of course there is lot of room for optimization .. let me leave that to the next commenter.&lt;br /&gt;&lt;br /&gt;nice post dude! keep posting a few interesting problems.. will keep my brain from rusting :)&lt;br /&gt;</description><comments></comments><link>http://channel8.msdn.com/Posts/Switching-our-Christmas-tree-bulbs/?CommentID=814</link><pubDate>Wed, 26 Dec 2007 14:56:55 GMT</pubDate><guid isPermaLink="true">http://channel8.msdn.com/Posts/Switching-our-Christmas-tree-bulbs/?CommentID=814</guid><evnet:views>0</evnet:views><evnet:viewtrackingurl>http://channel8.msdn.com/814/WebViewBug.aspx?EVT=0</evnet:viewtrackingurl><evnet:previewtext>I am prolly the laziest person u would ever meet... my method is greedy! :Dand the bulbs you asked: for day 365:1,4,9,16,25,36,49,64,81,100,121,144,169,196,225,256,289,324,361Below, was my first program .... inefficient to the core...for (int j = 2; j &amp;lt;= limit;&amp;#8230;</evnet:previewtext><dc:creator>sriram</dc:creator><slash:comments>0</slash:comments><wfw:commentRss></wfw:commentRss><trackback:ping>http://channel8.msdn.com/814/Trackback.aspx</trackback:ping></item><item><title>Re: Re: Switching our Christmas tree bulbs</title><description>&lt;p&gt;Yes, it will be 19 bulbs ON... But the most important: which is the method? &lt;/p&gt;
&lt;p&gt;Even more important: which is&amp;nbsp;the most&amp;nbsp;efficient method? Which is the complexity? &lt;/p&gt;
&lt;p&gt;And the last one (if you get the most efficient method, you will know this one): which bulbs (#1, #2 or whatever) will be ON?&lt;/p&gt;
&lt;p&gt;Good job sriram, I think you are on the way (but&amp;nbsp;I don't know your method, so... hehe)&lt;/p&gt;</description><comments></comments><link>http://channel8.msdn.com/Posts/Switching-our-Christmas-tree-bulbs/?CommentID=813</link><pubDate>Wed, 26 Dec 2007 14:14:56 GMT</pubDate><guid isPermaLink="true">http://channel8.msdn.com/Posts/Switching-our-Christmas-tree-bulbs/?CommentID=813</guid><evnet:views>0</evnet:views><evnet:viewtrackingurl>http://channel8.msdn.com/813/WebViewBug.aspx?EVT=0</evnet:viewtrackingurl><evnet:previewtext>Yes, it will be 19 bulbs ON... But the most important: which is the method? 
Even more important: which is&amp;nbsp;the most&amp;nbsp;efficient method? Which is the complexity? 
And the last one (if you get the most efficient method, you will know this one): which bulbs (#1, #2 or whatever) will be&amp;#8230;</evnet:previewtext><dc:creator>Miguel</dc:creator><slash:comments>0</slash:comments><wfw:commentRss></wfw:commentRss><trackback:ping>http://channel8.msdn.com/813/Trackback.aspx</trackback:ping></item><item><title>Re: Switching our Christmas tree bulbs</title><description>Day 1: 365 glow&lt;br /&gt;Day 2: 183 glow&lt;br /&gt;Day 3: 182 glow&lt;br /&gt;Day 4: 213 glow&lt;br /&gt;....&lt;br /&gt;Day 359: 23 glow&lt;br /&gt;Day 365: 19 glow&lt;br /&gt;&lt;br /&gt;is this rite?&lt;br /&gt;</description><comments></comments><link>http://channel8.msdn.com/Posts/Switching-our-Christmas-tree-bulbs/?CommentID=812</link><pubDate>Wed, 26 Dec 2007 13:11:50 GMT</pubDate><guid isPermaLink="true">http://channel8.msdn.com/Posts/Switching-our-Christmas-tree-bulbs/?CommentID=812</guid><evnet:views>0</evnet:views><evnet:viewtrackingurl>http://channel8.msdn.com/812/WebViewBug.aspx?EVT=0</evnet:viewtrackingurl><evnet:previewtext>Day 1: 365 glowDay 2: 183 glowDay 3: 182 glowDay 4: 213 glow....Day 359: 23 glowDay 365: 19 glowis this rite?</evnet:previewtext><dc:creator>sriram</dc:creator><slash:comments>0</slash:comments><wfw:commentRss></wfw:commentRss><trackback:ping>http://channel8.msdn.com/812/Trackback.aspx</trackback:ping></item><item><title>Re: Switching our Christmas tree bulbs</title><description>okay..now i get it....answer in a while....&lt;br /&gt;</description><comments></comments><link>http://channel8.msdn.com/Posts/Switching-our-Christmas-tree-bulbs/?CommentID=811</link><pubDate>Wed, 26 Dec 2007 12:37:52 GMT</pubDate><guid isPermaLink="true">http://channel8.msdn.com/Posts/Switching-our-Christmas-tree-bulbs/?CommentID=811</guid><evnet:views>0</evnet:views><evnet:viewtrackingurl>http://channel8.msdn.com/811/WebViewBug.aspx?EVT=0</evnet:viewtrackingurl><evnet:previewtext>okay..now i get it....answer in a while....</evnet:previewtext><dc:creator>sriram</dc:creator><slash:comments>0</slash:comments><wfw:commentRss></wfw:commentRss><trackback:ping>http://channel8.msdn.com/811/Trackback.aspx</trackback:ping></item><item><title>Re: Re: Switching our Christmas tree bulbs</title><description>&lt;p&gt;Mmm, no... Probably my explanation is not very good. This is a more complete example:&lt;/p&gt;
&lt;p&gt;Day 1: You switch (ON) all the bulbs multiple of 1, so... 1,2,3,4...365&lt;/p&gt;
&lt;p&gt;Day 2: You switch (OFF, because they were ON) all the multiples of 2: 2, 4, 6...&lt;/p&gt;
&lt;p&gt;Day 3: You switch all the bulbs multiple of 3: number 3 OFF (it was ON since first day), number 6 ON (it was OFF since day 2), number 9 OFF (it was ON since first day...)&lt;/p&gt;
&lt;p&gt;Knowing the method, I can say you that, in day, 183 there will be more than 13 bulbs ON (I can say also which ones, but it will be too much easy for you to solve it with that clue)... &lt;/p&gt;
&lt;p&gt;Good luck ;-)&lt;/p&gt;</description><comments></comments><link>http://channel8.msdn.com/Posts/Switching-our-Christmas-tree-bulbs/?CommentID=810</link><pubDate>Wed, 26 Dec 2007 11:35:04 GMT</pubDate><guid isPermaLink="true">http://channel8.msdn.com/Posts/Switching-our-Christmas-tree-bulbs/?CommentID=810</guid><evnet:views>0</evnet:views><evnet:viewtrackingurl>http://channel8.msdn.com/810/WebViewBug.aspx?EVT=0</evnet:viewtrackingurl><evnet:previewtext>Mmm, no... Probably my explanation is not very good. This is a more complete example:
Day 1: You switch (ON) all the bulbs multiple of 1, so... 1,2,3,4...365
Day 2: You switch (OFF, because they were ON) all the multiples of 2: 2, 4, 6...
Day 3: You switch all the bulbs multiple of 3: number 3&amp;#8230;</evnet:previewtext><dc:creator>Miguel</dc:creator><slash:comments>0</slash:comments><wfw:commentRss></wfw:commentRss><trackback:ping>http://channel8.msdn.com/810/Trackback.aspx</trackback:ping></item><item><title>Re: Switching our Christmas tree bulbs</title><description>I am thinking that starting from 365/2&amp;nbsp; , i.e day 183 you will have only 1 bulb glowing each day..so on day 359 (Christmas) u still got only 1 bulb glowing.&lt;br /&gt;&lt;br /&gt;maybe i read the question wrong... &lt;br /&gt;</description><comments></comments><link>http://channel8.msdn.com/Posts/Switching-our-Christmas-tree-bulbs/?CommentID=809</link><pubDate>Wed, 26 Dec 2007 04:23:14 GMT</pubDate><guid isPermaLink="true">http://channel8.msdn.com/Posts/Switching-our-Christmas-tree-bulbs/?CommentID=809</guid><evnet:views>0</evnet:views><evnet:viewtrackingurl>http://channel8.msdn.com/809/WebViewBug.aspx?EVT=0</evnet:viewtrackingurl><evnet:previewtext>I am thinking that starting from 365/2&amp;nbsp; , i.e day 183 you will have only 1 bulb glowing each day..so on day 359 (Christmas) u still got only 1 bulb glowing.maybe i read the question wrong... </evnet:previewtext><dc:creator>sriram</dc:creator><slash:comments>0</slash:comments><wfw:commentRss></wfw:commentRss><trackback:ping>http://channel8.msdn.com/809/Trackback.aspx</trackback:ping></item></channel></rss>