Highly Cototient Calculator

Cototient

solutions to x - phi(x) = 234
best count below n (the record to beat)3
is n a highly cototient number?Yes - its count beats every smaller value
next highly cototient number after n35
How this was calculated
  1. The cototient of x is x - phi(x); count how many x give the cototient value 23.
  2. The counts come from a phi sieve up to x = 1,000,000, the range where the counts for n up to 700 stop changing.
  3. That count is 4, against a previous record of 3 set below 23.
  4. Because the count strictly beats every smaller value, the number is highly cototient - the cototient analogue of a highly totient record.

Euler's totient phi(x) counts the integers up to x that are coprime to x. Its complement, the cototient x - phi(x), counts the integers that share a factor with x - and asking how many x produce a given cototient value turns out to have a rich record structure. A value n is highly cototient when the equation x - phi(x) = n has strictly more solutions than the same equation for every smaller value: a record-setter for the cototient equation, in the same spirit as the highly totient records for phi(x) = n.

This calculator counts the solutions for any n up to 700 and tells you whether n beats the standing record, what that record is, and which record-setter comes next. In list mode it prints the highly cototient numbers up to your limit. Try n = 23: the equation has exactly 4 solutions, and no smaller cototient value has more than 3 - so 23 is highly cototient. Try n = 100 and you get the opposite extreme: no x at all produces cototient 100.

The two modes serve different questions. Test mode answers the record question for a single value - how many solutions, what record it had to beat, and whether it beat it. List mode draws the record sequence itself up to your limit, which is the fastest way to see how sparse the records are: up to 200 there are just 13 highly cototient numbers, and the gaps between them widen as the counts climb.

Worked examples

Solutions to x - phi(x) = 23

(0 - test a single number · 23)

solutions to x - phi(x) = 234
best count below n (the record to beat)3
is n a highly cototient number?Yes - its count beats every smaller value
next highly cototient number after n35

Solutions to x - phi(x) = 100

(0 - test a single number · 100)

solutions to x - phi(x) = 1000
best count below n (the record to beat)10
is n a highly cototient number?No - its count does not beat the record below it
next highly cototient number after n113

Highly cototient numbers up to 200

(1 - list up to a limit · 200)

highly cototient numbers up to 2002, 4, 8, 23, 35, 47, 59, 63, 83, 89, 113, 119, 167
how many there are13
largest of them167
its solution count15

What the cototient counts

For a positive integer x, phi(x) counts the integers between 1 and x that share no factor with x. The cototient, x - phi(x), counts the rest: the integers up to x that share a common factor with x. Every integer up to x falls into exactly one of the two camps, which is why the two counts add back to x.

The highly cototient question turns the function around. Instead of evaluating the cototient at a given x, fix a target value n and count how many x satisfy x - phi(x) = n. Most values are hit rarely, some are never hit at all - 100 is one of the never-hit values - and a sparse subsequence is hit a record number of times. Those record values are the highly cototient numbers: 2, 4, 8, 23, 35, 47, 59, 63, 83, 89, 113, 119, 167 and beyond.

  • cototient of x: x - phi(x), the count of integers up to x sharing a factor with x
  • highly cototient: a strict record for the solution count of x - phi(x) = n
  • 23 is highly cototient with 4 solutions; 100 has 0 solutions
  • The value 1 is excluded: every prime gives cototient 1, so its count is infinite

How the count is computed

Counting solutions means sieving phi(x) for every x up to a large bound and tallying x - phi(x). The bound matters more than one might expect: the solution counts for n up to 700 are still changing when the sieve stops at 480,000, because a large x can have a small cototient, and those late contributions keep arriving. Only with a sieve bound of about 1,000,000 do the counts settle to their true values, so that is the bound this calculator uses.

Once the tally exists, the records are read off in order: a value is highly cototient exactly when its tally strictly exceeds every tally before it. Ties do not count - a record must be beaten, not matched. The calculator reports the standing record below your n alongside the verdict, so you can see by how much a candidate misses or clears the bar.

  • phi is sieved up to x = 1,000,000, the bound where counts for n up to 700 stop changing
  • A sieve bound of 480,000 is demonstrably not enough - counts there are still wrong
  • Records must be strict: matching the previous record does not make a value highly cototient

The record sequence

The records climb slowly and irregularly. The first few solution counts are 1 (at n = 2), 2 (at 4), 3 (at 8), 4 (at 23), 5 (at 35) and 6 (at 47). By n = 119 the record has reached 13 solutions, and by n = 659 it has reached 42. Between records, long stretches of values are hit a handful of times or not at all - the cototient is a much more selective function than its totient twin, whose values are hit comparatively evenly.

That selectivity is exactly what makes the records interesting. Because a highly cototient value must beat every predecessor, the sequence is a fingerprint of how the cototient distributes its hits: heavily concentrated on a thin set of popular values, with most of the number line left nearly untouched.

nSolutions to x - phi(x) = nNote
21first record
42record
83record
234record
355record
476record
11913record
65942record
1000never hit - not a cototient value

Cototient records vs totient records

The sibling page on this site covers highly totient numbers, the records for phi(x) = n. The machinery is the same - one sieve produces both tallies - but the questions are complementary: the totient counts the integers coprime to x, the cototient counts those that are not. A value can be a record on one side and unremarkable on the other.

One asymmetry is worth noting. The totient value 1 is hit exactly twice (phi(1) = phi(2) = 1), so totient records start from small finite counts. The cototient value 1 is hit by every prime, infinitely often, so it is excluded from the cototient record sequence entirely - the records here start at 2, with its single solution x = 4.

Quick check: enter 23 in test mode - 4 solutions, a record. Enter 100 - 0 solutions. The two extremes of the cototient sit just 77 apart.

Records, near-misses and dead values

Three kinds of values show up in test mode, and the calculator's secondary results distinguish them. A record-setter beats the standing record outright - 23 with its 4 solutions against a previous best of 3. A near-miss has a healthy solution count that simply does not beat the record below it; its tally can be large in absolute terms and still fail, because the bar is every smaller value, not a fixed threshold. And a dead value has no solutions at all: it is a noncototient, a number the cototient function never produces.

The dead values deserve a page of their own - the sibling noncototient calculator tests exactly that property - but they matter here too, because they shape the record race. A value with zero solutions can never be highly cototient, and the even values split sharply: some, like 8 and 32's neighbours in the record list, are hit constantly, while others like 100 are never hit at all. Nobody has a simple closed form predicting which is which; the sieve tally is the practical answer.

Near-misses are the subtlest case. A value whose count equals the standing record fails - the definition demands strictly more solutions. That strictness is what keeps the sequence honest as a sequence of records rather than a list of popular values, and it is why the calculator always shows the record to beat next to the verdict.

  • Record-setter: strictly beats every smaller count (23 beats 3 with 4)
  • Near-miss: a strong count that ties or trails the record - not highly cototient
  • Dead value: 0 solutions - a noncototient, like 100

A contrast with the totient side: the count 1

One more asymmetry between the twins is worth knowing. On the totient side, the question of whether phi(x) = n can have exactly one solution is the subject of Carmichael's famous totient function conjecture: it asserts that the count 1 never occurs for the totient - every totient value that is hit at all is hit at least twice. The conjecture has been open for over a century, and any counterexample must be astronomically large.

On the cototient side there is no such mystery: the count 1 occurs immediately, at the very first record. The equation x - phi(x) = 2 has the single solution x = 4, which is why 2 opens the highly cototient sequence with a count of 1. The cototient's record race can therefore be followed from its first step with complete certainty, while its twin's most basic counting question remains open.

That contrast is a good reminder of what these calculators are for. The definitions differ by a single complement - coprime versus not coprime - yet one side hides a century-old conjecture and the other hands you its first record on a plate. Running both pages on the same inputs is a quick way to feel how different the two landscapes are.

  • Cototient count 1 occurs at once: x - phi(x) = 2 has the single solution x = 4
  • Totient count 1 is conjectured impossible (Carmichael) - and still unproven
  • Same sieve, complementary questions, very different open problems

FAQs

What is a highly cototient number?

A value n whose equation x - phi(x) = n has strictly more solutions than the same equation for every smaller value. The sequence begins 2, 4, 8, 23, 35, 47 - for example, 23 qualifies because its 4 solutions beat the previous record of 3.

How many solutions does x - phi(x) = 23 have?

Exactly 4. No smaller cototient value has more than 3 solutions, which is what makes 23 a record-setter and therefore highly cototient.

Is 100 a highly cototient number?

No - it is not a cototient value at all. The equation x - phi(x) = 100 has 0 solutions, so 100 never even enters the record race. Many even values are hit rarely or never; the records are the rare values hit exceptionally often.

Why is 1 not counted among the highly cototient numbers?

Because every prime p satisfies p - phi(p) = 1, the value 1 has infinitely many solutions. A record sequence needs finite counts, so 1 is excluded and the records start at 2.

What is the difference between highly cototient and highly totient?

Highly totient numbers set records for the solution count of phi(x) = n; highly cototient numbers set records for x - phi(x) = n. The totient counts integers coprime to x, the cototient counts integers sharing a factor with x - complementary questions answered by the same sieve.

Why does the calculator sieve phi up to 1,000,000?

Because the solution counts for n up to 700 are still changing at a sieve bound of 480,000: large values of x can have small cototients, and their contributions arrive late. At a bound of about 1,000,000 the counts settle, so that bound is used for every test.

Sources

Related calculators

Euler's Totient Calculator
Euler's totient φ(n) — how many integers up to n are coprime to n — from the distinct prime factors of n.
Highly Totient Calculator
Count the solutions to phi(x) = n and test whether n is a highly totient number - a record-setter for totient solution counts.
Jordan Totient Calculator
Jordan's totient function J_k(n) = n^k prod (1 - 1/p^k): the count of k-tuples jointly coprime to n, with J_1(n) = phi(n) and the divisor-sum identity check.