Skip to main content

Linear Congruential Method (LCM) pseudo-random number generator

Project description

LICOME

LICOME (Linear Congruential Method) is a lightweight Python package that generates pseudo-random numbers using the Linear Congruential Method (LCM).

It returns both the raw sequence of generated numbers and their normalized versions between [0, 1) using NumPy.


🔧 Features

  • Simple and clean API
  • Fast LCM-based random number generation
  • Normalized output with NumPy
  • User-defined input parameters

📦 Installation

Install via pip:

pip install licome

🚀 Usage

from licome import LICOME

# Define parameters
a = 2        # Multiplier
c = 3        # Increment
x0 = 5       # Seed value
m = 103      # Modulus
count = 10   # Number of values

# Generate pseudo-random numbers
y, u = LCM(a, c, x0, m, count)

print("Generated:", y)
print("Normalized:", u)

📄 Function Reference

def LCM(a: int, c: int, x0: int, m: int, count: int):
    """
    Linear Congruential Method to generate pseudo-random numbers.

    Parameters:
        a (int): Multiplier
        c (int): Increment
        x0 (int): Initial seed value
        m (int): Modulus
        count (int): Total numbers to generate

    Returns:
        tuple:
            y (list): Raw generated integers
            u (ndarray): Normalized values in [0, 1)
    """

🧪 Example Script

from licome import LCM  # Make sure this matches the folder name!

a, c, x0, m, count = 2, 3, 5, 103, 10
y, u = LCM(a, c, x0, m, count)
print("Generated Sequence:", y)
print("Normalized Sequence:", u)

👤 Author

Rohit Kumar Behera

Feel free to contribute, suggest improvements, or report issues.

📧 Email: [rohitmbl24@gmail.com] (mailto:rohitmbl24@gmail.com)
🔗 PyPI: [https://pypi.org/project/licome/]


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

licome-2.0.0.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.

licome-2.0.0-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

File details

Details for the file licome-2.0.0.tar.gz.

File metadata

  • Download URL: licome-2.0.0.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for licome-2.0.0.tar.gz
Algorithm Hash digest
SHA256 d30f02db30153740fa4d1bd7d419c6ff146d0e1e2c269194ea21df41c7ab8b22
MD5 d76b87814408cdb0f38324e086497485
BLAKE2b-256 3feef24c00dd741973f8bdb9adfd7b54827e2b74b8c17ba229454efe1650a768

See more details on using hashes here.

File details

Details for the file licome-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: licome-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 3.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for licome-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 aee8357007b47d2104241bc3e2ef41dad6614e2d351a0847fb0fe60bdb5d8063
MD5 4a48dcfe591e74d122871e78986cc961
BLAKE2b-256 fa27bef180d432e715e66e1436f0d45a52e5550aeac21c9ecd3e4009cc5cdb08

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