DreamCalc

Home | Download | Buy Now | Support

 The Art of Math  Contents | Getting Started | Index 
 For Business, Science, Engineering & Education   Site Map & Search 


Number Theory Functions

Functions related to number theory are listed in alphabetical order below.


 

GCD

GCD calculates the greatest common divisor of two values.

Example:

98
[GCD]
140
[ENTER]
Displays: 14

See also: LCM.

   
 

fPart

Fractional part. Returns the fraction part of a value.

For example:

5.23237
[fPart]
Displays: 0.23237

Note. This function always operates in a postfix manner on when used from the calculator keypad. However, the prefix form may be used instead when entering a function into the function graph entry box, for example, "fPart(x)".

See also: iPart.

   
 

HEAVY

Returns 0 if the input value is less than or equal to zero, or +1 otherwise.

This function can be entered using the [NUM] key. However, its main use is intended to be with graphing functions.

See also: SIGN.

   
 

iPart

Integer part. Returns the integer part of a value.

Example:

5.23237
[iPart]
Displays: 5

Note. This function always operates in a postfix manner on when used from the calculator keypad. However, the prefix form may be used instead when entering a function into the function graph entry box, for example, "iPart(x)".

The ROUND function can be used instead where nearest integer rounding is required.

See also: fPart, ROUND.

   
 

LCM

LCM calculates the least common multiple of two values.

Example:

5
[LCM]
3
[ENTER]
Displays: 15

See also: GCD.

   
 

MOD

MOD returns the modulo value of the first argument with respect to the second. It is defined as the amount by which the first argument exceeds the largest integer multiple of the divisor that is not greater than that number.

Example:

27.87
[MOD]
12
[ENTER]
Displays: 3.87

MOD is sometimes incorrectly referred to as the "remainder function". Where both arguments are positive, the result will indeed be the remainder, but not so for negative values. If you wish to calculate the remainder rather than modulus, use the REM function in base-N mode.

See also: Base-N REM.

   
 

nCr

Calculates the number of ways of picking r unordered outcomes from n possibilities.

Example: Determine how many 3 member groups can be organized in a group of 12 individuals.

12 [nCr] 3
[ENTER]
Displays: 220

See also: nPr.

   
 

nPr

Calculates the number of ways of obtaining an ordered subset of r elements from a set of n elements.

Example: Determine how many 4 digit values can be produced using the numbers 1 to 16.

16 [nPr] 4
[ENTER]
Displays: 43680

See also: nCr.

   
 

NUM

The [NUM] key provides input for an additional range of number theory functions.

Example: Random Number

[SHIFT] [NUM] (use with SHIFT key)
Select RAN
[ENTER]
Displays: 0.435... (random number)
   
 

PRIME

PRIME is available from the [NUM] function key. It uses the Sieve of Eratosthenes method to determine the nth prime, beginning with PRIME(1) = 2. The larger the value of n, the longer the time required to determine the result. Therefore, this function places an upper time limit on the calculation, and returns a Timeout error if the result cannot be determined in this time. This upper limit is configurable, and can be set with the 'Timeout' option in the configuration settings.

Note that this function is not designed to generate huge primes and it will, therefore, return Range Error if the input value exceeds 20E6. Generally, however, a computer with a 2GHz CPU should be able to determine the millionth prime number within around 2 seconds.

Example: What is the millionth prime number?

[NUM] and select PRIME
1E6
[ENTER]
Displays: 15485863

See also: PRIMEQ.

   
 

PRIMEQ

PRIMEQ is available from the [NUM] function key. It returns +1 is the input value is prime, or zero otherwise.

See also: PRIME.

   
 

Ran

RAN is available from the [NUM] function key. It returns a pseudo random number in the range, 0 <= n < 1.

For example, to generate a random number between 1 and 47 inclusive, enter:

1 [+]
[NUM] and select Ran
[×] 47
[ENTER]
Displays: 17.187... (result is variable)

Ran takes no input parameter.

See also: GRan.

   
 

ROUND

Rounds value to the nearest integer.

Example:

5.7
[ROUND]
Displays: 6

Note. This function always operates in a postfix manner on when used from the calculator keypad. However, the prefix form may be used instead when entering a function into the function graph entry box, for example, "ROUND(x)".

The iPart function can be used instead where it is required to round down the value to an integer.

See also: fPart, ROUND.

   
 

SIGN

Returns -1 if the input value is below 0, zero if the input is zero, or +1 if greater than zero.

This function can be entered using the [NUM] key. However, its main use is intended to be with graphing functions.

See also: HEAVY.


See also: Key Math Functions


Try DreamCalc for Free: Download Page

 Home | News | Download | Buy Now | Support | Academia | Links | About Copyright Big Angry Dog Ltd