User Tools

Site Tools


notes:discrete:fall2022:projects:cnv0

This is an old revision of the document!


BACKGROUND

To better explain this, we gotta first ask ourselves the question: What is a prime number? How do we calculate prime numbers? What does a “prime” number mean?

(Since I don't have all the time in the world, I shall resort to Wikipedia)

Computing N values

The n-ary value of something is determined by the number of “factor pairs” it possesses. For those who may have forgotten, a number's factors are the lesser numbers that multiply together to equal the number. For example, 2 has 1 factor pair, namely (1,2). Therefore, 2 has a n-ary value of 1 (or is a prime number). 4 would have two factor pairs, being (1,2 and 2,4). Thus an n-ary value of 2.

ALGORITHM: trial by division

SPECIFICATIONS

*Our task is to ask questions on Discord or in class and document our findings on this wiki page collaboratively, regarding the functionality of this project.

*For anybody interested in editing the wiki page, here is the dokuwiki user guide: https://www.dokuwiki.org/wiki:syntax#basic_text_formatting -Ash

PROGRAM

cnv0 will take a minimum of 2 and a maximum of 4 arguments. The first will be a quantity of how many numbers to output. The second will be the n-ary value, and the third will be the lower-bound of where to begin checking values, and the fourth will be the upper-bound of where to stop checking values.

OUTPUT SPECIFICATIONS

VERIFICATION

notes/discrete/fall2022/projects/cnv0.1663294576.txt.gz · Last modified: 2022/09/16 02:16 by abarbcal