search for: arithmeticgmp

Displaying 1 result from an estimated 1 matches for "arithmeticgmp".

2008 Apr 04
4
Arbitrary Precision Numbers
Hi (If you're wondering, this is a Project Euler question :)) If I wanted to calculate the sum of the digits in the decimal representation of 2^1000, what would be a good way to go about that? I've tried the following methods: # Calculate the sum of digits in the decimal representation of 2^n # Only works for smaller values of n bsum <- function(n) { s <- 0 e <-