Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[perfect-numbers] backticks on math and removed parens #2319

Merged
merged 12 commits into from
Dec 13, 2023
18 changes: 9 additions & 9 deletions exercises/perfect-numbers/description.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
Determine if a number is perfect, abundant, or deficient based on Nicomachus' (60 - 120 CE) classification scheme for positive integers.

The Greek mathematician [Nicomachus][nicomachus] devised a classification scheme for positive integers, identifying each as belonging uniquely to the categories of **perfect**, **abundant**, or **deficient** based on their [aliquot sum][aliquot-sum].
The aliquot sum is defined as the sum of the factors of a number not including the number itself.
The aliquot sum is defined as the sum of the factors of a `number` not including the `number` itself.
For example, the aliquot sum of `15` is `1 + 3 + 5 = 9`.

- **Perfect**: aliquot sum = number
- 6 is a perfect number because (1 + 2 + 3) = 6
- 28 is a perfect number because (1 + 2 + 4 + 7 + 14) = 28
- **Abundant**: aliquot sum > number
- 12 is an abundant number because (1 + 2 + 3 + 4 + 6) = 16
- 24 is an abundant number because (1 + 2 + 3 + 4 + 6 + 8 + 12) = 36
- **Deficient**: aliquot sum < number
- 8 is a deficient number because (1 + 2 + 4) = 7
- **Perfect**: when a `number` equals its `aliquot sum`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should number and aliquot sum be quoted rather than code blocked?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will take that as a no, then. ;)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's perhaps easier to read wth the code blocks marking them as variables which also draws us to their earlier mention -- but I don't mind. It currently looks like


The aliquot sum is defined as the sum of the factors of a number not including the number itself.
For example, the aliquot sum of 15 is 1 + 3 + 5 = 9.

  • Perfect: when a number equals its aliquot sum
  • Abundant: when a number is less than its aliquot sum
  • Deficient: when a number is greater than its aliquot sum

Copy link
Member

@kotp kotp Sep 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought we were describing the idea, rather than actual code. It seems that aloquot sum may or may not be an invocation of a function or method in some languages.

I definitely will not stand in the way of it though.

It could look like:


The "aliquot sum" is defined as the sum of factors of a number not including the number itself.
For example, the "aliquot sum" of 15 is 1 + 3 + 5 or 9.

  • Perfect: when number equals its "aliquot sum"
  • Abundant: when number less than its "aliquot sum"
  • Deficient: when number greater than its "aliquot sum"

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The aliquot sum is defined as the sum of factors of a number not including the number itself. For example, the aliquot sum of 15 is 1 + 3 + 5 or 9.

  • Perfect: when number equals its aliquot sum
  • Abundant: when number less than its aliquot sum
  • Deficient: when number greater than its aliquot sum

—-

Italics to me emphasize the technical term aliquot sum but also distinct from other terms that are bolded, a different category of emphasis. Quote marks to me don’t convey that much emphasis compared to italics.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would also prefer bolding it

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason I kept the emphasis on each occurrence was because perfect, abundant, and deficient are also bolded in later occurrences. It’d make sense though to only emphasize the first occurrence so maybe that needs to fixed as well

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've turned them into links referencing the relevant heading.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everyone happy with this ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wasn't terrible to start out with, but still looking much better now!

- `6` is a perfect number because `1 + 2 + 3 = 6`
habere-et-dispertire marked this conversation as resolved.
Show resolved Hide resolved
- `28` is a perfect number because `1 + 2 + 4 + 7 + 14 = 28`
- **Abundant**: when a `number` is less than its `aliquot sum`
- `12` is an abundant number because `1 + 2 + 3 + 4 + 6 = 16`
- `24` is an abundant number because `1 + 2 + 3 + 4 + 6 + 8 + 12 = 36`
- **Deficient**: when a `number` is greater than its `aliquot sum`
- `8` is a deficient number because `1 + 2 + 4 = 7`
- Prime numbers are deficient

Implement a way to determine whether a given number is **perfect**.
habere-et-dispertire marked this conversation as resolved.
Show resolved Hide resolved
Expand Down