Skip to content

Add --roots to order - #1

Merged
Gulliby merged 1 commit into
mainfrom
feature/order-roots-count
Oct 20, 2026
Merged

Gulliby merged 1 commit into
mainfrom
feature/order-roots-count

Conversation

@Gulliby

@Gulliby Gulliby commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

Requested by gulliby

Before. intsmith order A N showed the order and the smallest primitive root, but there was no way to see how many primitive roots N has.

After. order --roots A N adds one last line roots with that count (0 when N has no primitive root, otherwise phi(phi(N))). Without the flag the output is unchanged; for a non-unit residue the status line stays, roots follows it and the exit code stays 1.

$ python -m intsmith order --roots 3 7
residue   3
phi       6
order     6
smallest  3
roots     2

How. intsmith/commands/order.py declares the --roots flag and prints the line; five new test cases in tests/test_cmd_order.py (four exact outputs, one --roots takes no value error); one sentence added to the order bullet in the README. Usage text and cli.py are untouched.

@Gulliby Gulliby self-assigned this Oct 20, 2026
@Gulliby
Gulliby merged commit d2662fd into main Oct 20, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant