https://github.com/dnmfarrell/excellent
Haskell module for finding Excellent numbers
https://github.com/dnmfarrell/excellent
Last synced: 12 months ago
JSON representation
Haskell module for finding Excellent numbers
- Host: GitHub
- URL: https://github.com/dnmfarrell/excellent
- Owner: dnmfarrell
- License: other
- Created: 2015-10-13T22:20:47.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-10-17T03:13:04.000Z (over 10 years ago)
- Last Synced: 2025-01-16T16:49:54.385Z (over 1 year ago)
- Language: Haskell
- Size: 133 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.pod
- License: LICENSE
Awesome Lists containing this project
README
=pod
=encoding utf8
=head1 Excellent
Excellent - Haskell module for calculating Excellent numbers
=head2 Synopsis
$ ghci
ghci> :l Excellent.hs
[1 of 1] Compiling Excellent ( Excellent.hs, interpreted )
ghci> filter (\x -> intExcellent (intSplit x)) [1..100]
[48]
=head2 Version
0.04
=head2 Description
F exports a boolean function called C which checks for Excellent numbers, and C which divides an integer into two halves.
An excellent number is any even digits-length integer where the difference between its two halves squared equals the original integer.
For example, 48 is excellent:
48 = abs(4^2 - 8^2)
So is 3468:
3468 = abs(34^2 - 68^2)
And so on.
=head2 Compiling
Excellent comes with F which will run forever, printing Excellent numbers to the command line.
$ ghc -O2 main.hs
$ ./main
[48,3468,140400,190476,216513,300625,334668,416768,484848,530901 ...
=head2 Thanks
Thanks to Tom Murphy and L for helping with the Haskell code.
=head2 See Also
This module was inspired by brian d foy's L on calculating Excellent Numbers with Perl, and Mark Jason Dominus' original L on the same topic.
=head2 Author
David Farrell E 2015
=head2 License
FreeBSD, see LICENSE