Skip to content
Sal et Humus
a pinch of wisdom and a handful of humorism
Home
Photography
Projects
Maths functions in PHP and Javascript
twitter
facebook
instagram
linkedin
youtube
rss
email
academia
flickr
foursquare
github
paypal
Home
>
Maths functions in PHP and Javascript
Maths functions in PHP and Javascript
My own PHP mathematic functions
Greatest Common Divisor (or Factor or Denominator) between A and B
Input number A:
Input number B:
Try it with a third number!
Input number C:
FIND GCD (or GCF)
Least Common Multiple of A e B
Input number A:
Input number B:
Try it with a third number!
Input number C:
FIND LCM
Euclid's Game
Input number X:
Input number Y:
SOLVE
Check if a number is prime
Input number:
or a comma separated list of numbers:
CHECK
Find all Primes between A and B
Input number A:
Input number B:
FIND PRIMES
FIBONACCI SEQUENCE GENERATOR SCRIPT (Javascript)
GENERATE FIBONACCI SEQUENCE
Clear
OUTPUT SPEED (in ms):
LIMIT RESULTS TO:
It's well to note that all results from F
_{79}
on are not exact because of javascripts internal limitations in representing large integers. Whole numbers beyond that threshold cannot be represented correctly.
Furthermore all results beyond F
_{102}
are represented as 'floating point decimal integers' in hex format.
FIBONACCI SEQUENCE GENERATOR SCRIPT (PHP)
PHP integer thresholds are greater than javascript thresholds, especially when using the bcmath extension. There is practically no limit!
Generate a specific fibonacci number based on its index:
-- OR --
Generate a fibonacci sequence limiting the results to:
Output fibonacci square spiral image
Output fibonacci rectangles image
Output fibonacci imperfect-spiral image
Output fibonacci pinwheel image
Output fibonacci rose image
Output fibonacci perfect spiral image
GENERATE FIBONACCI
Pascal Triangle Generator
Number of rows to generate:
GENERATE PASCAL TRIANGLE
Highlight odd numbers (becomes a Sierpinski triangle! Try with 32 rows and 64 rows, adjust zoom factor as needed)
Highlight remainders when divided by 3:
0
,
1
,
2
(try with 54, 81 and 162 rows, adjust zoom factor as needed)
If checked, will not use bcmath functions in php, causing floating point overflows and erratic rounding. See parabolics form!
D'Orazio Triangle Generator
Number of rows to generate:
GENERATE D’ORAZIO TRIANGLE
Highlight bitwise = 1 (try with 32, 64 and 128 rows, adjust zoom factor as needed)
Highlight modulus 3:
0
,
1
,
2
(try with 54, 81 and 162 rows, adjust zoom factor as needed)
Highlight odd numbers (try with 32, 64 and 128 rows, adjust zoom factor as needed)
If checked, will not use bcmath functions in php, causing floating point overflows and erratic rounding. See parabolics form!