compute and plot arithmetic functions in C++ for large integer? -


how can write c++ code , library can use compute , plot sum of divisors or similar arithmetic functions large integers, example integers bigger 10^100 000.

for example code wrote in mathematica:

g[n_] := product[prime[i], {i, 1, primepi[n]}];   k[999990]=g[237179]*g[661]*267064515689275851355624017992790*223092870*30030*44100*30*1296*512;  k[999991]=g[237173]*g[661]*23768741896345550770650537601358310*200560490130*30030*44100*30*7776*256;  k[999992]=g[237179]*g[661]*3217644767340672907899084554130*6469693230*30030*44100*30*7776*256;  k[999993]=g[237173]*g[673]*267064515689275851355624017992790*6469693230*30030*44100*900*1296*256;  k[999994]=g[237163]*g[677]*23768741896345550770650537601358310*200560490130*30030*44100*30*7776*256;  k[999995]=g[237179]*g[659]*23768741896345550770650537601358310*6469693230*30030*44100*30*1296*256;  ds[n_] := divisorsigma[1, n];  %sum of divisors  f1[n_] := eulerphi[n];         %number of coprimes less n  d[n_] := divisorsigma[0, n];   %number of divisors   f[n_] := divisorsigma[1, n]/(n*log[n]]);  sp[n_] := sum[1/prime[i], {i, 1, n}]; 

i use mathematica 8 compute , plot them, takes long time such 1 day or more. there code in c++ compute , sum of divisors large numbers fast.

i use windows 7 64 bit. have downloaded dev c++, codeblocks, , microsoft visual c++ 2008 express edition. asked , told me use gmp(the gnu multiple precision arithmetic library). don't know how use well.!

actually need plots following(lines connecting points) not smooth graphs sin or cos.

the sample graph type

thanks

use gmp library http://gmplib.org/ these kind of heavy computation. uses big int store such big values


Comments

Popular posts from this blog

linux - Mailx and Gmail nss config dir -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -