Skip to content

Latest commit

 

History

History
7 lines (5 loc) · 726 Bytes

README.md

File metadata and controls

7 lines (5 loc) · 726 Bytes

Additivity Checker

Challenge

You are given a function secret() that accepts a single integer parameter and returns an integer. In your favorite programming language, write a command-line program that takes one command-line argument (a number) and determines if the secret() function 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. Describe how to run your examples. Please generate the list of primes without using built-in functionality.

Run Examples

To run examples, execute script with node and enter any positive integer as the third argument (e.g. node index.js 89).