All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars
 perplexus dot info

 First Digit Four (Posted on 2009-08-08)
Determine the total number of base ten positive integers having the form 2N with the first digit (from the left) being 4, where N is a positive integer < 333.

 See The Solution Submitted by K Sengupta No Rating

Comments: ( Back to comment list | You must be logged in to post comments.)
 statistics | Comment 2 of 3 |

UBASIC is much less expensive than Mathematica, and does the job.

The program tabulates, for the digits 1 through 9, their occurrence as the first digit of 2^N, for N=1 through 332. The statistics match pretty well those expected by Benford's Law.

list
5   dim D(9)
10   for N=1 to 332
20     P=2^N
30     Ps=cutspc(str(P))
40     S=val(left(Ps,1))
50     inc D(S)
60   next
70   for I=1 to 9:print I;D(I):next
OK
run
1  99
2  60
3  40
4  33
5  27
6  23
7  17
8  19
9  14
OK

 Posted by Charlie on 2009-08-08 15:36:41

 Search: Search body:
Forums (0)