Skip to content

mgonyan/prime-table

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Prime table

Build Status

Takes numeric input (N) from a user and outputs a multiplication table of (N) prime numbers.

[N = 5]
|  X |  2 |  3 |  5 |  7 |  11 | -> Prime numbers
|  2 |  4 |  6 | 10 | 14 |  22 |
|  3 |  6 |  9 | 15 | 21 |  33 |
|  5 | 10 | 15 | 25 | 35 |  55 | -> A[row] * A[column] = cell
|  7 | 14 | 21 | 35 | 49 |  77 |
| 11 | 22 | 33 | 55 | 77 | 121 |
   ^
   |
 Prime numbers

Requirements

  • node
  • npm
  • mocha
  • prime-generator (Only for testing)
  • test-console

Run test

$> npm test

Run script

N = the number of primes (N > 0)

$> node index.js [N]

Future improvement

  • Add library to print table
  • Add Strategy pattern for different algorithm
  • Add more efficient algorithm to perform the primality check
  • Add performance stats between algorithm
  • Add a docker machine

Author

Releases

No releases published

Packages

No packages published