A natural number is called a lucky number if the sum of its digits is 7. Arrange all lucky numbers in an ascending order, and we get a sequence . If , compute .
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
using this php code I was able to generate all lucky numbers (remember that arrays start at 0, so I preloaded the number 0 so our first lucky number 7 sits at $lucky[1]):
<?php
$lucky = array(0);
for($i=1;$i<1000000;$i++){
if(array_sum(str_split($i))==7){
$lucky[] = $i;
}
}
echo '<pre>'.print_r($lucky,true).'</pre>';
?>
From here, we are able to see that $lucky[65]=2005 , so 65 is n
We are asked to find 5n, and 65*5=325
Therefore we are asked to find $lucky[325] which we can see is 52000