Skip to content

AlanBreck/additivity-checker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

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).

About

Check if a function is additive.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published