Using lbc instead of lmapm would be easier because lbc is self-contained.
local bc = require"bc"
s=bc.pow(2,1000):tostring()
z=0
for i=1,#s do
z=z+s:byte(i)-("0"):byte(1)
end
print(z)
Related Contents:
- Arbitrary-precision arithmetic Explanation
- Is floating point math broken?
- Calculate distance between 2 GPS coordinates
- How can i produce multi point linear interpolation? [closed]
- Divide by 10 using bit shifts?
- How to determine if a list of polygon points are in clockwise order?
- A simple algorithm for polygon intersection
- How to scale down a range of numbers with a known min and max value
- Turning a cylinder into a sphere without pinching at the poles
- Finding quaternion representing the rotation from one vector to another
- Mathematically compute a simple graphics pipeline
- Sort points in clockwise order?
- OCR and character similarity
- How to calculate the volume of a 3D mesh object the surface of which is made up triangles
- Cone to box collision
- How do I calculate the normal vector of a line segment? [closed]
- How to convert latitude or longitude to meters?
- Calculating area enclosed by arbitrary polygon on Earth’s surface
- Using atan2 to find angle between two vectors
- How to check intersection between 2 rotated rectangles?
- Is Big O(logn) log base e?
- Overflow and Carry flags on Z80
- correcting fisheye distortion programmatically
- Implementing Ray Picking
- Nth Combination
- Rotating a Vector in 3D Space
- How to test randomness (case in point – Shuffling)
- Arbitrary-Precision Decimals in C# [duplicate]
- Calculating a LookAt matrix
- Quadratic Bézier Curve: Calculate Points
- What is “entropy and information gain”?
- Signed angle between two 3D vectors with same origin within the same plane
- How to map atan2() to degrees 0-360
- How to use 4d rotors
- Representing integers in doubles
- Is finding the equivalence of two functions undecidable?
- Evaluating a string of simple mathematical expressions [closed]
- Fitting polynomials to data
- Can a IEEE 754 real number “cover” all integers within its range?
- Solving a linear equation
- How to distribute points evenly on the surface of hyperspheres in higher dimensions?
- Calculate second point knowing the starting point and distance
- Find point of intersection between two vectors in MATLAB
- Perpendicular on a line from a given point
- Plotting a point on the edge of a sphere
- Why must a nonlinear activation function be used in a backpropagation neural network? [closed]
- What types of numbers are representable in binary floating-point?
- Cracking short RSA keys
- Convert Linear scale to Logarithmic
- Calculate angle between two Latitude/Longitude points