Skip to main content
15-Moonstone
January 17, 2023
Solved

functions of number theory

  • January 17, 2023
  • 2 replies
  • 3163 views

In Mathcad 14, I didn't find any functions or worksheets for using number theory functions. I am particularly interested in:

Factorization/prime number decomposition of a natural number as an ordered product of prime powers,
number of divisors of a natural number,
Euler function phi.
Are such functions implemented in MC14?

Happy New Year, Alfred Flasshaar

Best answer by Werner_E

Number theory was definitely the domain of the old genius programme Derive. This was bought up by Texas Instruments and distribution was then later discontinued. Nevertheless, there are still sites from which you can download a 30-day demo version of the programme.
http://www.austromath.at/daten/derive/derivedemo.htm
However, I don't know if there is still a legal way to purchase a licence key for the permanent use of the programme.


There has been a magazine since 1991, the Derive User Group Newsletter, which I was recently surprised to discover is still published online and freely available. D-N-L #128 was published last December. All 128 booklets are available here for free

http://www.austromath.at/dug/


I have particularly fond memories of Johann Wiesenbauer's contributions in the D-N-L.

 

So if you are curious you may give it a try, and, I am not sure, but some contributions might be valuable even without having Derive at hand.

 

It sure might be possible to create the functions you are looking for in Mathcad or even in Prime, but they would be rather slow and limited to IEEE floating point with all its drawbacks (Derive used internally integers only and implemented their own calc routines to deal with really large integers - the limit was only the memory installed).

 

Just for demonstration I add a sheet which I posted here quite some time ago when someone has a question to prime twins and prime cousins, etc.

I now added a function to factorize numbers and then it was easy to also write the Euler phi function or a function for the number of divisors.

Werner_E_0-1674095838374.png

 

But be aware that things really get slow when it comes to numbers with very large prime factors!

And in no way I claim that my implementations are optimized for running speed and memory usage. They are certainly not, and there is still a lot of room for improvement.

 

EDIT: Added Function to return the set of all divisors (quite inefficient) and a divisor function (returns sum of powers of divisors).

 

EDIT2: Added a far more efficient "Teiler" function to return a vector with all divisors.

 

TODO: make the old  prime number functions accessible for symbolic evaluation
             speed up prime number functions (nextPrime, etc.)

 

 

2 replies

23-Emerald IV
January 17, 2023

Like this?

LucMeekes_3-1673990993738.png

It's possible that not all work in Mathcad 14, but they do in Mathcad 11.

 

Success!
Luc

 

25-Diamond I
January 18, 2023

I fear that the prime number functions are not available in MC14/15!

Werner_E25-Diamond IAnswer
25-Diamond I
January 18, 2023

Number theory was definitely the domain of the old genius programme Derive. This was bought up by Texas Instruments and distribution was then later discontinued. Nevertheless, there are still sites from which you can download a 30-day demo version of the programme.
http://www.austromath.at/daten/derive/derivedemo.htm
However, I don't know if there is still a legal way to purchase a licence key for the permanent use of the programme.


There has been a magazine since 1991, the Derive User Group Newsletter, which I was recently surprised to discover is still published online and freely available. D-N-L #128 was published last December. All 128 booklets are available here for free

http://www.austromath.at/dug/


I have particularly fond memories of Johann Wiesenbauer's contributions in the D-N-L.

 

So if you are curious you may give it a try, and, I am not sure, but some contributions might be valuable even without having Derive at hand.

 

It sure might be possible to create the functions you are looking for in Mathcad or even in Prime, but they would be rather slow and limited to IEEE floating point with all its drawbacks (Derive used internally integers only and implemented their own calc routines to deal with really large integers - the limit was only the memory installed).

 

Just for demonstration I add a sheet which I posted here quite some time ago when someone has a question to prime twins and prime cousins, etc.

I now added a function to factorize numbers and then it was easy to also write the Euler phi function or a function for the number of divisors.

Werner_E_0-1674095838374.png

 

But be aware that things really get slow when it comes to numbers with very large prime factors!

And in no way I claim that my implementations are optimized for running speed and memory usage. They are certainly not, and there is still a lot of room for improvement.

 

EDIT: Added Function to return the set of all divisors (quite inefficient) and a divisor function (returns sum of powers of divisors).

 

EDIT2: Added a far more efficient "Teiler" function to return a vector with all divisors.

 

TODO: make the old  prime number functions accessible for symbolic evaluation
             speed up prime number functions (nextPrime, etc.)

 

 

12-Amethyst
January 19, 2023

Werner - can you save your xmcdz file in a mathcad 11 version and post that?

 

Luc - you posted some prime # functions that work in MCD11 symbolics. I was looking in my notes/old files for other (undocumented?) symbolic modifiers that work in MCD11. Specifically, I recall at least two: trig and exponential. I found trig down one level in the symbolic Modifiers, but haven't figured out how to use it. Do you have a catalog of undocumented symbolic functions for MCD11, and use examples?

 

Lou

25-Diamond I
January 19, 2023

@LouP wrote:

Werner - can you save your xmcdz file in a mathcad 11 version and post that?


Sure, here you are!