PDA

View Full Version : memory out of bounds



sailingboarder
April 20th, 2007, 05:55 PM
when writing a program to solve the following problem, i ran out of memory.
i was programming in java, using longs
how can i properly solve this problem?

How many powers of 2 less than a googol begin with the digit 9?

Lux Perpetua
April 20th, 2007, 06:38 PM
(In what follows, all logs are to base 10.) Hint: 2^k starts with 9 if and only if the fractional part of k*log(2) is more than log(9).