Skip to main content

You can find the gcm (greatest common divisior) and lcm (least command multiplier) of the numbers. And also you can find the other values of the primity.

Project description

GCD-LCM-Finder

You can find the gcm (greatest common divisior) and lcm (least command multiplier) of the numbers. And also you can find the other values of the primity.

Installation

pip install gcd-lcm-calculator

On Python, you can use this library with this command

import gcdlcm

or

from gcdlcm import *

I will give this library's command with the second one.

Commands:

gcd(e, *b)

You can find the gcd (greatest common dividor) value with this function.

>>> gcd(18, 12)
6
>>> gcd(18, 12, 15)
3

You can enter as many arguments as you want to this function and get the gcd value.

gcd(e, *k)

You can find the lcm (least common multiplier) value with this function.

>>> lcm(8, 10)
40
>>> lcm(8, 10, 15)
120

You can enter as many arguments as you want to this function and get the lcm value.

getIntegerMultipliers(num)

You can get the number that you entered's multipliers with this function.

>>> getIntegerMultipliers(12)
[1, 2, 3, 4, 6, 12]
>>> getIntegerMultipliers(25)
[1, 5, 25]
>>> getIntegerMultipliers(30)
[1, 2, 3, 5, 6, 10, 15, 30]

getPrimeMultipliers(num)

This function returns the prime factors of the value you enter according to their exponent values

>>> getPrimeMultipliers(20)
[[2, 2], [5, 1]]
>>> getIntegerMultipliers(51)
[[3, 1], [17, 1]]
>>> getIntegerMultipliers(300)
[[2, 2], [3, 1], [5, 2]]

As an example:
300's prime multipliers: 2, 3, 5
2^2 * 3^1 * 5^2 = 300

isPrime(num)

This function returns the number that you entered is prime number or not.

>>> isPrime(20)
False
>>> isPrime(17)
True
>>> isPrime(1)
False

findPrimesUntil(num)

This function returns all primes up to this point.

>>> findPrimesUntil(20)
[2, 3, 5, 7, 11, 13, 17, 19]
>>> findPrimesUntil(43)
[2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43]

If the number you enter is a prime number, this function also includes that number.

isPrimeAmong(x, *y)

This function returns whether the numbers you enter are prime or not.

>>> isPrimeAmong(8, 10)
False
>>> isPrimeAmong(8, 10, 15)
True
>>> isPrimeAmong(12, 19)
True

You can enter as many arguments as you want to this function and get is these number prime among them or not.

getMostPrime(x, *y)

This function returns the most prime form of the numbers you enter.

>>> getMostPrime(8, 10)
[4, 5]
>>> getMostPrime(12, 15, 18)
[4, 5, 6]
>>> getMostPrime(1920, 1080)
[16, 9]

You can enter as many arguments as you want to this function and get the most prime form of the numbers you entered.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gcd_lcm_calculator-1.0.2.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gcd_lcm_calculator-1.0.2-py3-none-any.whl (3.5 kB view details)

Uploaded Python 3

File details

Details for the file gcd_lcm_calculator-1.0.2.tar.gz.

File metadata

  • Download URL: gcd_lcm_calculator-1.0.2.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.9.13

File hashes

Hashes for gcd_lcm_calculator-1.0.2.tar.gz
Algorithm Hash digest
SHA256 3f7ff81b199341b91d45929aa9c808d06d8f850ac3e3854df4c6ccd9cf48dc82
MD5 eba05bfb30a93dff765f3417606d910b
BLAKE2b-256 63a68434c5d65b3fc3abab71d9e1a999b228571f6ac72d9e761561b492263b4e

See more details on using hashes here.

File details

Details for the file gcd_lcm_calculator-1.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for gcd_lcm_calculator-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 514277d01333cfda5b84862e5a2ffc6a410ce39daed4998b0720670454298804
MD5 eb595854ce831a2c544d26d5f6edb2cc
BLAKE2b-256 1a02960f5852680ced284f3832f21849f9bb3c4f07e0a354484da579694170e2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page