Skip to content

Instantly share code, notes, and snippets.

@crudd
crudd / secretPrimes.php
Last active July 23, 2017 03:31
Test whether a given function, secret(), is additive [secret(x+y) = secret(x) + secret(y)], for all combinations x and y, where x and y are all prime numbers less than the number passed via the command-line argument.
<?php
/**
* Test whether a given function, secret(), is additive [secret(x+y) = secret(x) + secret(y)],
* for all combinations x and y, where x and y are all prime numbers less than the number passed
* via the command-line argument.
*
* To execute:
* php secretPrimes.php $max
* where $max is an integer argument