Which programming language is best/most powerful for maths?

1.4k Views Asked by At

Basically I need a programming language which I can use to do the following things, most/all of them with built in commands and functions instead of having to create my own logic/algorithms.

1) Get the value of 2 raised to the power 678932.

2) Find out whether 57656799 is a prime number or not.

3) Get factorial of 65655.

4) Get all possible partitions of the number 50.

5) Get number of digits in the number 787668768.

6) Get sum of all digits in the number 5444565464.

7) Convert 656755656.666676755 to standard form.

8) Convert 767576.000000004 to 3 significant figures.

9) Round off 56666566.67766 to nearest tens.

10) Find remainder when 65 is divided by 39.

11) Convert the number 675 to binary.

12) Get LCM or HCF of 13, 65, 90, 44, 5 and 3334.

13) Find out which number among 45, 7856, 335656, and -66 is greatest and which is smallest.

14) Get sum of all numbers from 67 to 980.

15) Get largest multiple of 7 between the numbers 89 and 557.

16) Find out whether 7656.00000 is an integer or a real number.

17) What is the seventh digit in the number 586857445653888.

18) Get Mean, Median and Mode of 2, 22, 2, 33, 2, 888888, 2, 5557, 4 and 6674.

19) Is a given number more than, less than or equal to 22.

20) How many 7s are there in the number 5645647777755557777778787907.

Truth be told, I am an 18 years old math geek who likes to make flowchart algorithms to do different things like get nth digit of the fibanachi sequence or find out whether a number is divisible by 3 or not and then translate that algorithm into code to use it on my laptop. While I don't indulge in things like calculus, trig or bionomial beyond school I often come across logics that I am not able to define with BODMAS or other functions of javascript (which I learned for this purpose but it turned out to be insufficient).

I know that a language that contains commands or functions every single one of the above mentioned stuff probably does not exist. However there must be a language that can still be used with some complex code to do all of it.

1

There are 1 best solutions below

0
On BEST ANSWER

Your question isn't very clear: the title asks "best/most powerful for maths", the body lists things that look rather pedestrian, partially. So it depends. Those recommending Python do have their reasons: it's an easy to learn language, and it has integers of arbitrary length built in. It doesn't have very many mathematical functions in the language itself, but there are lots of libraries created by the aficionados. So it's not surprising that people who do a lot of numerical simulations (engineers and scientists) often prefer Python. Calling libraries written in other languages (Fortran, say) isn't difficult, so you have all the well-tested legacy code almost at your finger tips.
If you mean professional mathematics, if you want to handle objects like Taylor series, polynomials, quadratic fields, finite fields, p-adic numbers, elliptic curves as native objects of the language, you need Pari/GP. Imagine a looney who wants to integrate the differential equation of a pendulum, $\varphi''=-\sin\varphi$, with intitial conditions $\varphi(0)=\pi-0.001, \varphi'(0)=0$ from $0$ to $73$ with Taylor series, subdividing the whole interval into subintervals of length $0.3$, using $25$ terms of each Taylor series, and then plot the result. How many lines would that be in Python? Don't ask. In Pari/GP, that would be slightly over twenty, with the result (red: $\varphi$, green: $\varphi'$): enter image description here

Pari/GP does have its shortcomings, naturally. It's not really much like other languages, the syntax is... erm... shall we say "ever so slightly ideosyncratic"?