search.cpan.org is shutting down
Adam Lesperance > Project-Euler > Project::Euler::Problem::P005

Project-Euler-0.20.tar.gz

Dependencies

Annotate this POD

# CPAN RT

 Open 0
View/Report Bugs
Module Version: 0.20

# NAME

Project::Euler::Problem::P005 - Solutions for problem 005 - Least common multiple

version 0.20

# HOMEPAGE

http://projecteuler.net/index.php?section=problems&id=5

# SYNOPSIS

```    use Project::Euler::Problem::P005;
my \$p5 = Project::Euler::Problem::P005->new;

# DESCRIPTION

This module is used to solve problem #005

Use Math::BigInt to calculate the least common multiple between numbers

# SETUP

## Problem Number

`    005`

## Problem Name

`    Least common multiple`

## Problem Date

`    30 November 2001`

## Problem Desc

2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder.What is the smallest number that is evenly divisible by all of the numbers from 1 to 20?

## Default Input

20

`    232792560`

## Has Input?

`    Yes`

## Help Message

The input controls the cap of the range of numbers to find the least common multiple of.

# INTERNAL FUNCTIONS

## Validate Input

The restrictions on custom_input

`    A positve integer`

## Solving the problem

This is just goes from the largest multi_num until multiple_check returns true and returns that number.

This is like P3 in that it's definitely cheating and will have to be re-written with custom logic (even though it will almost certainly be much slower)