Skip to content
/ prifpy Public

Python library for computing prime factorization of numbers

License

Notifications You must be signed in to change notification settings

kameshr/prifpy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 

Repository files navigation

PRIFPY: A Python module for computing the prime factorization of numbers.

It has dependencies on sympy and numpy libraries. Please install them using pip before using prifpy.

Usage:

Add PRIFPY to your application with import prifpy.

prifpy offers the following functions based on prime factorization methods:

  1. prifpy.primefac: Prime factorizes the number sent as an argument and returns a Python dictionary with prime factors as keys and respective powers as values. This dictionary has the number that is factorized also stored in it as the value under a special key -1.

  2. prifpy.printprifac: Print the above created dictionary of prime factors to STDOUT by passing the dict to it.

  3. prifpy.lcm: Computes the LCM of an array of number passed as an argument and returns the prime factorized dict object of the LCM. The LCM value can be accessed by the special key -1.

  4. prifpy.hcf: Computes the HCF of an array of number passed as an argument and returns the prime factorized dict object of the HCF. The HCF value can be accessed by the special key -1.


prifpy-cmd is a command line wrapper script for the module. Please run it to see its options.

Copyright:

(c) 2019 Kamesh Raghavendra. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License here.

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

About

Python library for computing prime factorization of numbers

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages