We have your learning goals covered with Spring and Summer courses available. Enroll today!

G
Topic
First Poster
Last Poster
k a My Retirement & New Leadership at AoPS
rrusczyk   1571
N Mar 26, 2025 by SmartGroot
I write today to announce my retirement as CEO from Art of Problem Solving. When I founded AoPS 22 years ago, I never imagined that we would reach so many students and families, or that we would find so many channels through which we discover, inspire, and train the great problem solvers of the next generation. I am very proud of all we have accomplished and I’m thankful for the many supporters who provided inspiration and encouragement along the way. I'm particularly grateful to all of the wonderful members of the AoPS Community!

I’m delighted to introduce our new leaders - Ben Kornell and Andrew Sutherland. Ben has extensive experience in education and edtech prior to joining AoPS as my successor as CEO, including starting like I did as a classroom teacher. He has a deep understanding of the value of our work because he’s an AoPS parent! Meanwhile, Andrew and I have common roots as founders of education companies; he launched Quizlet at age 15! His journey from founder to MIT to technology and product leader as our Chief Product Officer traces a pathway many of our students will follow in the years to come.

Thank you again for your support for Art of Problem Solving and we look forward to working with millions more wonderful problem solvers in the years to come.

And special thanks to all of the amazing AoPS team members who have helped build AoPS. We’ve come a long way from here:IMAGE
1571 replies
rrusczyk
Mar 24, 2025
SmartGroot
Mar 26, 2025
k a March Highlights and 2025 AoPS Online Class Information
jlacosta   0
Mar 2, 2025
March is the month for State MATHCOUNTS competitions! Kudos to everyone who participated in their local chapter competitions and best of luck to all going to State! Join us on March 11th for a Math Jam devoted to our favorite Chapter competition problems! Are you interested in training for MATHCOUNTS? Be sure to check out our AMC 8/MATHCOUNTS Basics and Advanced courses.

Are you ready to level up with Olympiad training? Registration is open with early bird pricing available for our WOOT programs: MathWOOT (Levels 1 and 2), CodeWOOT, PhysicsWOOT, and ChemWOOT. What is WOOT? WOOT stands for Worldwide Online Olympiad Training and is a 7-month high school math Olympiad preparation and testing program that brings together many of the best students from around the world to learn Olympiad problem solving skills. Classes begin in September!

Do you have plans this summer? There are so many options to fit your schedule and goals whether attending a summer camp or taking online classes, it can be a great break from the routine of the school year. Check out our summer courses at AoPS Online, or if you want a math or language arts class that doesn’t have homework, but is an enriching summer experience, our AoPS Virtual Campus summer camps may be just the ticket! We are expanding our locations for our AoPS Academies across the country with 15 locations so far and new campuses opening in Saratoga CA, Johns Creek GA, and the Upper West Side NY. Check out this page for summer camp information.

Be sure to mark your calendars for the following events:
[list][*]March 5th (Wednesday), 4:30pm PT/7:30pm ET, HCSSiM Math Jam 2025. Amber Verser, Assistant Director of the Hampshire College Summer Studies in Mathematics, will host an information session about HCSSiM, a summer program for high school students.
[*]March 6th (Thursday), 4:00pm PT/7:00pm ET, Free Webinar on Math Competitions from elementary through high school. Join us for an enlightening session that demystifies the world of math competitions and helps you make informed decisions about your contest journey.
[*]March 11th (Tuesday), 4:30pm PT/7:30pm ET, 2025 MATHCOUNTS Chapter Discussion MATH JAM. AoPS instructors will discuss some of their favorite problems from the MATHCOUNTS Chapter Competition. All are welcome!
[*]March 13th (Thursday), 4:00pm PT/7:00pm ET, Free Webinar about Summer Camps at the Virtual Campus. Transform your summer into an unforgettable learning adventure! From elementary through high school, we offer dynamic summer camps featuring topics in mathematics, language arts, and competition preparation - all designed to fit your schedule and ignite your passion for learning.[/list]
Our full course list for upcoming classes is below:
All classes run 7:30pm-8:45pm ET/4:30pm - 5:45pm PT unless otherwise noted.

Introductory: Grades 5-10

Prealgebra 1 Self-Paced

Prealgebra 1
Sunday, Mar 2 - Jun 22
Friday, Mar 28 - Jul 18
Sunday, Apr 13 - Aug 10
Tuesday, May 13 - Aug 26
Thursday, May 29 - Sep 11
Sunday, Jun 15 - Oct 12
Monday, Jun 30 - Oct 20
Wednesday, Jul 16 - Oct 29

Prealgebra 2 Self-Paced

Prealgebra 2
Tuesday, Mar 25 - Jul 8
Sunday, Apr 13 - Aug 10
Wednesday, May 7 - Aug 20
Monday, Jun 2 - Sep 22
Sunday, Jun 29 - Oct 26
Friday, Jul 25 - Nov 21


Introduction to Algebra A Self-Paced

Introduction to Algebra A
Sunday, Mar 23 - Jul 20
Monday, Apr 7 - Jul 28
Sunday, May 11 - Sep 14 (1:00 - 2:30 pm ET/10:00 - 11:30 am PT)
Wednesday, May 14 - Aug 27
Friday, May 30 - Sep 26
Monday, Jun 2 - Sep 22
Sunday, Jun 15 - Oct 12
Thursday, Jun 26 - Oct 9
Tuesday, Jul 15 - Oct 28

Introduction to Counting & Probability Self-Paced

Introduction to Counting & Probability
Sunday, Mar 16 - Jun 8
Wednesday, Apr 16 - Jul 2
Thursday, May 15 - Jul 31
Sunday, Jun 1 - Aug 24
Thursday, Jun 12 - Aug 28
Wednesday, Jul 9 - Sep 24
Sunday, Jul 27 - Oct 19

Introduction to Number Theory
Monday, Mar 17 - Jun 9
Thursday, Apr 17 - Jul 3
Friday, May 9 - Aug 1
Wednesday, May 21 - Aug 6
Monday, Jun 9 - Aug 25
Sunday, Jun 15 - Sep 14
Tuesday, Jul 15 - Sep 30

Introduction to Algebra B Self-Paced

Introduction to Algebra B
Sunday, Mar 2 - Jun 22
Wednesday, Apr 16 - Jul 30
Tuesday, May 6 - Aug 19
Wednesday, Jun 4 - Sep 17
Sunday, Jun 22 - Oct 19
Friday, Jul 18 - Nov 14

Introduction to Geometry
Tuesday, Mar 4 - Aug 12
Sunday, Mar 23 - Sep 21
Wednesday, Apr 23 - Oct 1
Sunday, May 11 - Nov 9
Tuesday, May 20 - Oct 28
Monday, Jun 16 - Dec 8
Friday, Jun 20 - Jan 9
Sunday, Jun 29 - Jan 11
Monday, Jul 14 - Jan 19

Intermediate: Grades 8-12

Intermediate Algebra
Sunday, Mar 16 - Sep 14
Tuesday, Mar 25 - Sep 2
Monday, Apr 21 - Oct 13
Sunday, Jun 1 - Nov 23
Tuesday, Jun 10 - Nov 18
Wednesday, Jun 25 - Dec 10
Sunday, Jul 13 - Jan 18
Thursday, Jul 24 - Jan 22

Intermediate Counting & Probability
Sunday, Mar 23 - Aug 3
Wednesday, May 21 - Sep 17
Sunday, Jun 22 - Nov 2

Intermediate Number Theory
Friday, Apr 11 - Jun 27
Sunday, Jun 1 - Aug 24
Wednesday, Jun 18 - Sep 3

Precalculus
Sunday, Mar 16 - Aug 24
Wednesday, Apr 9 - Sep 3
Friday, May 16 - Oct 24
Sunday, Jun 1 - Nov 9
Monday, Jun 30 - Dec 8

Advanced: Grades 9-12

Olympiad Geometry
Wednesday, Mar 5 - May 21
Tuesday, Jun 10 - Aug 26

Calculus
Sunday, Mar 30 - Oct 5
Tuesday, May 27 - Nov 11
Wednesday, Jun 25 - Dec 17

Group Theory
Thursday, Jun 12 - Sep 11

Contest Preparation: Grades 6-12

MATHCOUNTS/AMC 8 Basics
Sunday, Mar 23 - Jun 15
Wednesday, Apr 16 - Jul 2
Friday, May 23 - Aug 15
Monday, Jun 2 - Aug 18
Thursday, Jun 12 - Aug 28
Sunday, Jun 22 - Sep 21
Tues & Thurs, Jul 8 - Aug 14 (meets twice a week!)

MATHCOUNTS/AMC 8 Advanced
Friday, Apr 11 - Jun 27
Sunday, May 11 - Aug 10
Tuesday, May 27 - Aug 12
Wednesday, Jun 11 - Aug 27
Sunday, Jun 22 - Sep 21
Tues & Thurs, Jul 8 - Aug 14 (meets twice a week!)

AMC 10 Problem Series
Tuesday, Mar 4 - May 20
Monday, Mar 31 - Jun 23
Friday, May 9 - Aug 1
Sunday, Jun 1 - Aug 24
Thursday, Jun 12 - Aug 28
Tuesday, Jun 17 - Sep 2
Sunday, Jun 22 - Sep 21 (1:00 - 2:30 pm ET/10:00 - 11:30 am PT)
Monday, Jun 23 - Sep 15
Tues & Thurs, Jul 8 - Aug 14 (meets twice a week!)

AMC 10 Final Fives
Sunday, May 11 - Jun 8
Tuesday, May 27 - Jun 17
Monday, Jun 30 - Jul 21

AMC 12 Problem Series
Tuesday, May 27 - Aug 12
Thursday, Jun 12 - Aug 28
Sunday, Jun 22 - Sep 21
Wednesday, Aug 6 - Oct 22

AMC 12 Final Fives
Sunday, May 18 - Jun 15

F=ma Problem Series
Wednesday, Jun 11 - Aug 27

WOOT Programs
Visit the pages linked for full schedule details for each of these programs!


MathWOOT Level 1
MathWOOT Level 2
ChemWOOT
CodeWOOT
PhysicsWOOT

Programming

Introduction to Programming with Python
Monday, Mar 24 - Jun 16
Thursday, May 22 - Aug 7
Sunday, Jun 15 - Sep 14 (1:00 - 2:30 pm ET/10:00 - 11:30 am PT)
Tuesday, Jun 17 - Sep 2
Monday, Jun 30 - Sep 22

Intermediate Programming with Python
Sunday, Jun 1 - Aug 24
Monday, Jun 30 - Sep 22

USACO Bronze Problem Series
Tuesday, May 13 - Jul 29
Sunday, Jun 22 - Sep 1

Physics

Introduction to Physics
Sunday, Mar 30 - Jun 22
Wednesday, May 21 - Aug 6
Sunday, Jun 15 - Sep 14
Monday, Jun 23 - Sep 15

Physics 1: Mechanics
Tuesday, Mar 25 - Sep 2
Thursday, May 22 - Oct 30
Monday, Jun 23 - Dec 15

Relativity
Sat & Sun, Apr 26 - Apr 27 (4:00 - 7:00 pm ET/1:00 - 4:00pm PT)
Mon, Tue, Wed & Thurs, Jun 23 - Jun 26 (meets every day of the week!)
0 replies
jlacosta
Mar 2, 2025
0 replies
Counting Numbers
steven_zhang123   0
a minute ago
Source: China TST 2001 Quiz 8 P3
Let the decimal representations of numbers $A$ and $B$ be given as: $A = 0.a_1a_2\cdots a_k > 0$, $B = 0.b_1b_2\cdots b_k > 0$ (where $a_k, b_k$ can be 0), and let $S$ be the count of numbers $0.c_1c_2\cdots c_k$ such that $0.c_1c_2\cdots c_k < A$ and $0.c_kc_{k-1}\cdots c_1 < B$ ($c_k, c_1$ can also be 0). (Here, $0.c_1c_2\cdots c_r (c_r \neq 0)$ is considered the same as $0.c_1c_2\cdots c_r0\cdots0$).

Prove: $\left| S - 10^k AB \right| \leq 9k.$
0 replies
steven_zhang123
a minute ago
0 replies
Perfect Numbers
steven_zhang123   0
3 minutes ago
Source: China TST 2001 Quiz 8 P2
If the sum of all positive divisors (including itself) of a positive integer $n$ is $2n$, then $n$ is called a perfect number. For example, the sum of the positive divisors of 6 is $1 + 2 + 3 + 6 = 2 \times 6$, hence 6 is a perfect number.
Prove: There does not exist a perfect number of the form $p^a q^b r^c$, where $a, b, c$ are positive integers, and $p, q, r$ are odd primes.
0 replies
steven_zhang123
3 minutes ago
0 replies
Roots of unity
steven_zhang123   0
5 minutes ago
Source: China TST 2001 Quiz 8 P1
Let $k, n$ be positive integers, and let $\alpha_1, \alpha_2, \ldots, \alpha_n$ all be $k$-th roots of unity, satisfying:
\[
\alpha_1^j + \alpha_2^j + \cdots + \alpha_n^j = 0 \quad \text{for any } j (0 < j < k).
\]Prove that among $\alpha_1, \alpha_2, \ldots, \alpha_n$, each $k$-th root of unity appears the same number of times.
0 replies
steven_zhang123
5 minutes ago
0 replies
Graph Theory Test in China TST (space stations again)
steven_zhang123   0
8 minutes ago
Source: China TST 2001 Quiz 7 P3
MO Space City plans to construct $n$ space stations, with a unidirectional pipeline connecting every pair of stations. A station directly reachable from station P without passing through any other station is called a directly reachable station of P. The number of stations jointly directly reachable by the station pair $\{P, Q\}$ is to be examined. The plan requires that all station pairs have the same number of jointly directly reachable stations.

(1) Calculate the number of unidirectional cyclic triangles in the space city constructed according to this requirement. (If there are unidirectional pipelines among three space stations A, B, C forming $A \rightarrow B \rightarrow C \rightarrow A$, then triangle ABC is called a unidirectional cyclic triangle.)

(2) Can a space city with $n$ stations meeting the above planning requirements be constructed for infinitely many integers $n \geq 3$?
0 replies
steven_zhang123
8 minutes ago
0 replies
No more topics!
Prime-related integers [CMO 2018 - P3]
Amir Hossein   15
N Mar 26, 2025 by Ilikeminecraft
Source: 2018 Canadian Mathematical Olympiad - P3
Two positive integers $a$ and $b$ are prime-related if $a = pb$ or $b = pa$ for some prime $p$. Find all positive integers $n$, such that $n$ has at least three divisors, and all the divisors can be arranged without repetition in a circle so that any two adjacent divisors are prime-related.

Note that $1$ and $n$ are included as divisors.
15 replies
Amir Hossein
Mar 31, 2018
Ilikeminecraft
Mar 26, 2025
Prime-related integers [CMO 2018 - P3]
G H J
G H BBookmark kLocked kLocked NReply
Source: 2018 Canadian Mathematical Olympiad - P3
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
Amir Hossein
5452 posts
#1 • 4 Y
Y by Smita, Davi-8191, Adventure10, Mango247
Two positive integers $a$ and $b$ are prime-related if $a = pb$ or $b = pa$ for some prime $p$. Find all positive integers $n$, such that $n$ has at least three divisors, and all the divisors can be arranged without repetition in a circle so that any two adjacent divisors are prime-related.

Note that $1$ and $n$ are included as divisors.
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
InCtrl
871 posts
#2 • 5 Y
Y by Amir Hossein, UzbekMathematician, lneis1, Adventure10, Mango247
Solution
This post has been edited 4 times. Last edited by InCtrl, Mar 31, 2018, 3:22 AM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
bobthesmartypants
4337 posts
#3 • 2 Y
Y by Amir Hossein, Adventure10
solution
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
adamov1
355 posts
#4 • 3 Y
Y by Amir Hossein, Adventure10, Mango247
Consider the graph with vertices as divisors and an edge between them if they are prime-related. We want to find a Hamiltonian cycle in this graph. If the nonzero exponents in the prime factorization of $n$ are $e_1,...,e_d$, the graph is the unit distance graph on the lattice $\{0,1,...,e_1\}\times...\times\{0,...,e_d\}$. When $n$ is a prime power, this is a line graph, so trivially there are no Hamiltonian cycles. If $n$ is a square, all $e_i$ are even, and thus the lattice has an odd number of points. But by coloring by the parity of the sum of coordinates, the graph is bipartite, and thus has no odd cycle (and thus no Hamiltonian cycle). Otherwise, some $e_i$ (WLOG $e_1$) is odd. Consider the lattice $\{0,...,e_2\}\times...\times\{0,...,e_d\}$. By induction on the dimension one can easily see that this has a directed Hamiltonian path beginning at some point $O$. Let the path without $O$ be $P$ and let the reverse of $P$ be $P'$. Then traverse as follows: $\{0\}\times O\to\{0\}\times P\to\{1\}\times P'\to\{2\}\times P\to...\to\{e_1\}\times P'\to\{e_1\}\times O\to\{e_1-1\}\times O\to...\to\{0\}\times O$.
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
rkm0959
1721 posts
#5 • 4 Y
Y by jozuch, paccongnong19hy, Adventure10, Mango247
This is just a hamiltonian cycle in a grid-like graph. If $n$ is a power of a prime, then the graph is a line, so no cycle.

If $\tau(n)$ is odd, then coloring shows that there are no hamiltonian cycles.
If $\tau(n)$ is even, there is an even-length "side" in the graph, so it's easy to traverse the graph.
So the answer is non-square numbers that are not powers of a prime.
This post has been edited 1 time. Last edited by rkm0959, Apr 12, 2018, 1:41 AM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
HamstPan38825
8857 posts
#6
Y by
The answer is all $n$ which are not squares or powers of primes. Clearly powers of primes do not work, because 1 must also be adjacent to a non-prime. To show that all other numbers work, induct on the number of distinct prime factors of $n$.

Base Case. It suffices to show numbers of the form $n=p^aq^b$ for $a, b$ not both even work. Consider a grid of squares shown below:

\begin{tabular}{c||c|c|c|c|c|c}
& $1$ & $p_1$ & $p_1^2$ & $p_1^3$ & $\cdots$ & $p_1^{k_1}$ \\
\hline \hline
$1$ & 1 & $p_1$ & $p_1^2$ & $p_1^3$ & $\cdots$ & $p_1^{k_1}$ \\
\hline
$p_2$ & $p_2$ & $p_1 p_2$ & $p_1^2p_2$ & $p_1^3p_2$ & $\cdots$ & $p_1^{k_1} p_2$ \\
\hline
$p_2^2$ & $p_2^2$ & $p_1p_2^2$ & $p_1^2p_2^2$ & $p_1^3p_2^2$ & $\cdots$ & $p_1^{k_1} p_2^2$ \\
\hline
$\vdots$ & $\vdots$& $\vdots$&$\vdots$ &$\vdots$ &$\vdots$ &$\vdots$ \\
\hline
$p_2^{k_2}$ & $p_2^{k_2}$ & $p_2^{k_2} p_1$ & $p_2^{k_2} p_1^2$ & $p_2^{k_2} p_1^3$ & $\cdots$ & $p_1^{k_1} p_2^{k_2}$
\end{tabular}
Constructing a circle satisfying the given conditions is equivalent to starting at 1, and moving through every single square in the grid, only travelling between consecutive entries every move. We claim that such a path is always possible if one of $k_1$ and $k_2$ is odd, and impossible if both $k_1$ and $k_2$ are even, which is equivalent to our base case.

First, we prove that such a path is impossible for $k_1, k_2$ both even. Color the squares of the $k_1+1$ by $k_2+1$ grid shown above black and white in an alternating fashion. Then at every step, we must move onto a square with different color than the square we started on. However, the number of black squares and white squares on the grid are not equal, because there are an odd number of total squares, while any valid path must pass through an equal number of black and white squares. Thus such a path is impossible.

Next, we provide a construction for one of $k_1, k_2$ odd. WLOG assume that $k_2$ is odd. Then begin at 1, travel down to $p_2^{k_2}$ directly, then travel to $n$ horizontally. Next, move up one step, then travel to $p_2^{k_2-1}p_1$, and then move to $p_2^{k_2-2}p_1$, and travel to $p_2^{k_2-2}p_1^{k_1}$, and so on. Because $k_2$ is odd, our path will pass through $p_2^0p_1 = p_1$, and thus we can return to $1$, thus completing our cycle. This proves the base case.

Inductive Step. Assume that some number $n$ with $k$ distinct prime factors works. Then, we will show $n \cdot p_{i+1}^{k_{i+1}}$ for some $p_{i+1}$ not already a divisor of $n$ also works. First, arrange the divisors of $n$ in a valid configuration, which exists. Next, split the circle between any two numbers, thus creating a ``line". Since the circle has an even number of elements (because $n$ is not a perfect square), divide the resulting line into two parts down the middle.

Next, replicate the first half of the line and multiply each factor by $p_{i+1}$. Moreover, if the element at one end of the line was $j$, then connect $j \cdot p_{i+1}$ to the original line. Then, replicate the first half of the line again, in reverse order, then multiply each factor by $p_{i+1}^2$. If the last element in the first half of the line was $x$, then connect $x \cdot p_{i+1}$ to $x \cdot p_{i+1}^2$. Next, replicate the first half and multiply by $p_{i+1}^3$, and so on. More generally, if $r$ is even, then replicate the first half of the line in reverse order, multiply all the elements by $p_{i+1}^r$, and connect it in that order to the truncated $p_{i+1}$ sequence. Once we get to the $k_{i+1}$th replication, we split into cases:
  1. $k_{i+1}$ is odd. Then, we can replicate the entire line in the same order as presented. After that, repeat the construction for the first half of the line, this time with the second half of the line, going down by a factor of $p_{i+1}$ every time, and reversing the order between alternating groups. Notice that the final group of the second half of the line with a factor of $p_{i+1}$ goes in the original order, and thus ends on $y \cdot p_{i+1}$ for some $y$ at the end of the second half of the line, which we can connect to the second half of the line, as desired.
  2. $k_{i+1}$ is even. Then, the entire line is replicated in reverse order. Proceed similarly as in the first part; this time, the last group of the line with a factor of $p_{i+1}$ still ends at the same $y \cdot p_{i+1}$ (because an even number of iterations have passed since the $p_{i+1}^{k_{i+1}}$ block). Thus, we can still connect it to the second half of the line.
At this point, we have used all the factors of $n \cdot p_{i+1}^{k_{i+1}}$ in the circle, and our construction guarantees that any two adjacent divisors are prime-related. Thus the induction is complete.

Hence, all other positive integers $n$ must work, as desired.
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
ilikemath40
500 posts
#7
Y by
We will prove that only if $n$ is a power of a prime or a square number does it not work.

It is easy to see that if $n$ is a power of a prime it doesn't work since there are no two primes that the 1 can border.

If $n=p_1^{e_1}p_2^{e_2}$ where $e_1\equiv e_2\equiv 0\pmod{2}$ then if we consider a 2d grid where the left side is labeled $\{ 1, p_1, p_1^2, \dots, p_1^{e_1} \}$ and the top side is labeled $\{ 1, p_2, p_2^2, \dots, p_2^{e_2} \}$, if we color this grid white and black alternatively then since there are an odd number of grid cells, we reach the desired contradiction. Note that this argument can be extended to further dimensions.

We will now prove that all other $n$ work through an induction approach. For the base case consider when $n=p_1^{e_1}p_2^{e_2}$ where at least one of $e_1, e_2$ is even. We will use the same grid as before. In each grid cell we will write the corresponding $p_1^ap_2^b$. It is easy to see that such a hamiltonian path exists in this grid.

Having our base cases covered, for the inductive step if we already have some $n'$ working with the sequence $d_1, d_2, \dots, d_k$ where $k$ is even, and we want to prove that some $n=p^an'$ works where $p$ is a prime, then notice that we can use the sequence
\[ \{ d_1, pd_1, p^2d_1, \dots, p^ad_1, p^ad_2, p^{a-1}d_2, \dots, pd_2, d_2, d_3, \dots, pd_k, d_k \} \]
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
HoRI_DA_GRe8
588 posts
#9 • 1 Y
Y by SatisfiedMagma
Very dirty problem,never hated evens so much
Canada 2018 #3 wrote:
Two positive integers $a$ and $b$ are prime-related if $a = pb$ or $b = pa$ for some prime $p$. Find all positive integers $n$, such that $n$ has at least three divisors, and all the divisors can be arranged without repetition in a circle so that any two adjacent divisors are prime-related.

Note that $1$ and $n$ are included as divisors.

Clearly $n$ cannot be a prime power because then on both sides of $1$ we must have a prime,but since $n$ is the perfect power of a prime this is not possible.

If $n$ is a perfect square.Then it has an odd number of factors.Define a move $\rightarrow$ as an operation which takes you from a term to its next term.Start from $1$ and note that after performing an odd number of $\rightarrow$s we reach $1$ again.Now see that a $\rightarrow$ increases or decreases the power of exactly $1$ prime factor of the number on which it is performed at.So if we consider the sum of exponents of the primes in the prime factorisation of a number,we see that each $\rightarrow$ changes it parities.So if we start from $1$ and end at $1$ it will take an odd number of moves or the parity of the sum of the exponents changes an odd number of times and its actual parity is ultimately altered,which is a contradiction $\square$

So squares don't work either.

We claim that rest of the integers with atleast $3$ prime factors work.Here is solely inductive+constructive proof.Say $n=p^aq^b$ and WLOG assume $b$ is odd.We start of with this
$$1,q,pq,p^2q,p^3q,\cdots,p^{a-1}q,q^2p^{a-1},q^2p^{a-2},\cdots,pq^2,q^2,q^3,q^3p,\cdots \text{  and so on}$$Clearly this maintain the conditions and if this analogy goes on until the end,the last string would start with $q^b$ as $b$ is odd and look like this
$$q^b,q^bp,q^bp^2,\cdots ,q^bp^{a-1}$$And a total of $ab+1$ divisors have been covered forming a sequence which still satisfies our condition.Note that numbers of the form $p^i$ and $p^aq^j,1 \geq j \geq b$ are still left.So we attach the following string with the last string(or the previously constructed sequence)
$$p^aq^b,p^aq^{b-1},...............,p^aq,p^a,p^{a-1},p^{a-2},...........,p$$And our base case for $n$ is constructed as $\frac{p}{1}=p$ $\square$
Inductive step : Assume that for $n=\prod_{i=1}^{k-1}p_i^{a_i}$ has a valid construction.
Call the terms of the construction $b_1,b_2,.....b_l$ where $l$ is the number of divisors of $n$.Now we will prove that for $n'=\prod_{i=1}^{k+1}p_i^{a_i}$ has a solution too.The new prime is $p_k$ and its power is $a_{k+1}$.Consider the sequence
$$b_1,b_2,......,b_l,pb_l,p,b_{l-1},....,pb_3,pb_2,p^2b_2,p^2b_3,.....,p^2b_l...\text{  and so on}$$If $a_{k+1}$ is even the sequence ends with $p^{a_{k+1}}b_l$ and if $a_{k+1}$ is odd it will end with $p^{a_{k+1}}b_2$.Nevertheless add this after the last term
$$p^{a_{k+1}}b_1,p^{a_{k+1}-1}b_1,............,p^2b_1,pb_1$$Since by our inductive hypothesis $\frac{b_l}{b_1}=\frac{p^{a_{k+1}}b_l}{p^{a_{k+1}}b_1}$ is also prime,so there is no problem in $a_{k+1}$ being even.Thus our construction is achieved and every number which is not a square or a prime power works $\blacksquare$
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
Mogmog8
1080 posts
#10 • 3 Y
Y by centslordm, ike.chen, iamnotgentle
We wish to find a hamiltonian cycle in a graph where the divisors of $n$ are vertices and vertices are adjacent if they are prime-related. We claim all $n$ that are not perfect squares or powers of primes work.

Proof of necessity: Consider $n=p^k.$ If $k=0,1,$ then $n$ does not have enough divisors, and if $k\ge 2,$ then the cycle must be $1,p,p^2,\dots,p^k,1.$ Since $p^k$ is not prime, powers of primes do not work. Suppose $n=\prod p_i^{2\alpha_i}.$ Notice since $\tau(n)$ is odd, the cycle must have an odd length. Also, going from one divisor to an adjacent divisor either multiplies the divisor by one of $p_i$ or divides it by one of $p_i.$ Hence, after an odd number of moves, the original divisor will be multiplied by $\prod p_i^{\beta_i},$ where $\sum\beta_i$ is odd. This means that the final divisor cannot be the original divisor as at least one of $\beta_i$ is odd. Therefore, perfect squares do not work.

Proof of sufficiency: Let $n$ be of the form $\prod_{i=1}^k p_i^{\alpha_i}$ where $k\ge 2$ and at least one of $\alpha_i$ is odd. We proceed by induction on $k$ to show all such $n$ work. For the base case $k=2,$ assume WLOG that $\alpha_2$ is odd and the following construction works: \begin{align*}
1,p_1,p_1^2\dots,p_1^{\alpha_1},\\
p_2p_1^{\alpha_1},p_2p_1^{\alpha_1-1},\dots,p_2p_1^2,p_2p_1^1,\\
p_2^2p_1,p_2^2p_1^2,\dots,p_2^2p_1^{\alpha_1},\\
p_2^3p_1^{\alpha_1},p_2^3p_1^{\alpha_1-1},\dots,\\
\dots,\\
p_2^{\alpha_2}p_1^{\alpha_1},p_2^{\alpha_2}p_1^{\alpha_1-1},\dots,p_2^{\alpha_2}p_1^1,\\
p_2^{\alpha_2},p_2^{\alpha_2-1},\dots,p_2^2,p_2,1,
\end{align*}where we increase the exponent of $p_2$ every row while alternating increasing and decreasing the exponent of $p_1$ depending on the row. Notice the second to last row has the exponent of $p_1$ decreasing since $\alpha_2$ is odd. For our inductive step, assume all $n$ that satisfy our conditions with $k$ prime divisors work. Consider $n_{k+1}$ with $k+1\ge 3$ distinct prime divisors that satisfy our conditions and note we can let $n_{k+1}=n_kq^{\beta}$ where $q$ is a prime factor of $n_{k+1}$ and $2\nmid\beta.$ Since $n_k$ has $k$ prime divisors, we can move the divisors into the form $d_1,d_2,\dots,d_m,d_1$ such that adjacent divisors are prime-related. Then, for $n_{k+1},$ the following construction works: \begin{align*}
1,d_1,d_2\dots,d_m,\\
qd_m,qd_{m-1},\dots,qd_2,qd_1,\\
q^2d_1,q^2d_2,\dots,q^2d_m,\\
q^3d_m,q^3d_{m-1},\dots,\\
\dots,\\
q^{\beta}d_m,q^{\beta}d_{m-1},\dots,q^{\beta}d_1,\\
q^{\beta},q^{\beta-1},\dots,q^2,q,1,
\end{align*}since $\beta$ is odd, which makes the second to last row have the index of $d$ decreasing. Thus, our induction is complete. $\square$
This post has been edited 3 times. Last edited by Mogmog8, Nov 25, 2022, 8:55 PM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
peppapig_
279 posts
#11 • 1 Y
Y by mulberrykid
All $n$ such that $n$ is neither a perfect square nor a perfect power of a prime

Proof.
First we will prove that no prime powers work. FTSOC, assume such a configuration exists for $n=p^k$ for some prime $p$ and positive integer $k$. Then obviously $1$ will be on that circle. To the left and right of $1$, there must be a number each, but the only number prime-related to $1$ is $p$ itself, a contradiction.

Now we will prove that no perfect squares work. Let $n=p_1^{e_1}p_2^{e_2}\cdots{}p_k^{e_k}$ for primes $p_i$ and even positive integers $e_i$. Consider the $n$-dimensional hypercube in the $n$ dimensional coordinate system of side lengths $e_1$, $e_2$, $\cdots{}$, $e_k$ with coordinates ranging from $(0,0,\cdots{},0)$ to $(e_1,e_2,\cdots{},e_k)$. Let the point $(c_1,c_2,\cdots{},c_k)$ represent the number $p_1^{c_1}p_2^{c_2}\cdots{}p_k^{c_k}$. Since if two numbers are prime-related, they will have exactly one coordinate differ by exactly $1$, we see that if there is a placement of the coordinates around a circle satisfying the problem conditions, then there will be a "walk"(a "walk" is defined as a series of moves from point to point such that for each move, you move only one unit in one direction and you never end up at the same spot twice in this series of moves, with the exception of your last move) from $(0,0,\cdots{},0)$ to itself that visits every point in this hypercube. Since an even number of moves is required for such an action and there happen to be an odd number of points in this hypercube, it is impossible for such a walk to happen when $n$ is a perfect square.

Now we prove that all other numbers $n$ work. Taking the hypercube idea above, we may use the two-dimensional walk and generalize to $n$ dimensions using an inductive argument, thus proving that all non-square and non-perfect prime power numbers $n$ work and we are done.
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
coolmath_2018
2807 posts
#12 • 1 Y
Y by GeoKing
The answer is all $n$ that are not a perfect square and a power of a prime. The case where $n = p^e$ is quite obvious. For the perfect square note that it has an odd number of divisors, so we have to take an odd number of jumps to reach back to $1$. But on each jump the exponent of the number differs by $1$. Clearly this is a contradiction.

Now we prove that all other $n$ work using induction.

Base Case: Consider $n = p_1^{e_1}p_2^{e_2}$. We can easily find a construction for this.

Inductive Step: Assume that there exists a construction for $k$ where the terms are $t_1, t_2, \dots t_j$. We will show that $n = k \cdot p_i^{e_i}$ works. Consider the construction \[t_1, t_2, \dots t_j, pt_j, pt_{j-1}, \dots, pt_2, p^2t_2, p^2t_3, \dots p^2t_j.\]This can be thought of as wrapping around a grid. So this is a valid construction and we are done.
This post has been edited 1 time. Last edited by coolmath_2018, Mar 13, 2023, 12:32 AM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
Danielzh
481 posts
#13
Y by
Nice problem!

We claim that all positive integer $n$ that is not a power of a prime number and/or a perfect square works.

First if $n$ is a power of a prime, it is trivial to see that it doesn't work.

Then, if $n$ were to be a perfect square, there would be an odd number of factors $\rightarrow{}$an odd number of move $\rightarrow{}$ which is impossible since there must be an even number of moves (starts at some configuration, ends at the same configuration).

Now consider the following: Let $a_{n}$ be the sequence of moves that starts from $1,0,0,...,0$ and ends with $0,0,...,0,1$ and $b_{n}$ be the opposite order of moves, where there are $n$ numbers in each. If we add another prime with an exponent of $q$, we can construct a sequence of moves that looks like this:

$(0,0,...,0|0), (1,0,...,0|0) \rightarrow{}$after $a_{n} \rightarrow{} (0,0,...,1|0), (0,0,...,1|1) \rightarrow{}$after $b_{n} \rightarrow{} (1,0,...,0|1)$ ... until the last number is equal to $q$ and we have performed a sequence of $a_{n}$ or $b_{n}$ on it.

There are two possibilities: $(1,0,...,0|q)$ or $(0,0,...,1|q)$. Either way, simply turn the digit 1 into a 0 and decrease the value of $q$ from then on.

Existence
If there are two prime factors and $n=p_{1}^{q_{1}}*p_{2}^{q_{2}}$ where $q_{1}, q_{2} \neq 0 \mod{2}$. We claim that there is a configuration that satisfies problem conditions. Consider a graph with $0,1,...,q_{1}$ and $0,1,...,q_{2}$ as its axis values. Since at least one of them must be odd, we can simply "walk" down the respective odd axis and kind of make a snake-like pattern to reach (0,0) again.

Now that we have found existence, we are done. $\blacksquare{}$

motivation
This post has been edited 1 time. Last edited by Danielzh, May 10, 2023, 3:15 AM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
peace09
5417 posts
#16
Y by
Cute little geometry problem; Wikipedia courteously provided a diagram to get you started. Good luck!

Solution to Hamiltonian Path Version (Modified Kazakhstan 2016)
Attachments:
This post has been edited 2 times. Last edited by peace09, Sep 13, 2023, 9:45 PM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
blueprimes
315 posts
#17
Y by
This problem reminds me of the Snake game!

We can prime factorize $n = p_1^{e_1} p_2^{e_2} \dots p_k^{e_k}$ such that $p_1 < p_2 \dots < p_k$ are distinct primes that divide $n$. We claim that only $n$ such that there exists some integer $1 \le i \le k$ such that $e_i$ is odd and $k \ge 2$.

To start us off, we can biject the set of divisors $d~|~n$ to a $k$-dimensional box with dimensions $e_1, e_2, \dots e_k$ of lattice points using the function $f:\mathbb{R} \to \mathbb{R}^k$ where
$$f(d) = \{\nu_{p_1}(d), \nu_{p_2}(d), \dots, \nu_{p_k}(d) \}$$We wish to prove there exists a Hamiltonian cycle in this graph. To quickly show that all $e_i$ cannot be even, we can "checkerboard-color" any vertex $(x_1, x_2, \dots, x_k)$, black if $x_1 + x_2 + \dots + x_k$ is even, and white otherwise. Then any Hamiltonian cycle, every step we alternate colors, so there must be an equal number of white and black vertices in the graph. But the number of vertices $(e_1 + 1)(e_2 + 1) \dots (e_k + 1)$ is odd, contradiction. Additionally, if $k = 1$, it is impossible for a cycle to exist without passing through a vertex again.

It suffices to demonstrate a construction for $k \ge 2$ and some $e_i$ odd, which we proceed with induction on $k$. For $k = 2$, without loss of generality assume $e_1$ is odd. Then move from the origin to $(0, e_2)$, right to $(1, e_2)$, down to $(1, 1)$, right to $(2, 1)$, then repeat the cycle of going up and down between $y = 1$ and $y = e_2$ until you hit $(e_1, 1)$, go to $(e_1, 0)$ and finish at the origin.

Now suppose there exists a Hamiltonian cycle for $k = t$. We can remove the origin, leaving us with a Hamiltonian path from a point $A$ to $B$ where $A, B$ are one unit from the origin. Let $K(\ell)$ be this Hamiltonian path translated $\ell$ units along the $t + 1$-dimensional axis, and $K'(\ell)$ be the same path but from $B$ to $A$. Suppose $O$ is the origin, and without loss of generality assume $e_1$ is odd. Then the cycle
$$O \to K(0) \to K'(1) \to K(2) \to K'(3) \cdots \to K/K'(e_{t + 1}) \to (0, 0, \dots, e_{t + 1}) \to (0, 0, \dots, e_{t + 1} - 1) \cdots \to (0, 0, \dots, 1) \to O$$works. The induction is finished, thus our proof is complete.
This post has been edited 1 time. Last edited by blueprimes, Dec 9, 2023, 3:48 PM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
Saucepan_man02
1300 posts
#18
Y by
Down we go:

We claim that the answer is all positive integers except powers of prime or perfect squares.
Clearly, perfect powers dont work.
Consider perfect squares. If there exists some valid construction for perfect squares, then, starting from $1$, at each step, the parity sum of prime exponents changes at every move. Since it has odd number of divisors, we lead to contradiction.

Consider $n=p^aq^b$, where at-least one of $a, b$ is odd. Notice that, thus there exists some Hamiltonian cycle on a $(a+1) \times (b+1)$ grid.
Now, consider inducting on the no of prime factors of $n$. Consider the chain of numbers in circle $a_1 \cdots a_t$ for some $n$ with $p \nmid n$.
Then for $p^k n$, we have the construction and we are done: $a_1 a_1 p \cdots a_1 p^k p^k a_2 \cdots a_2 a_3 a_3 p \cdots \cdots$.
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
Ilikeminecraft
328 posts
#19
Y by
It works for all numbers that aren’t perfect squares or prime powers

We begin with the construction.
We induct on the number of primes.
If $n = p^aq^b:$ first, assume $a$ is odd. Then, simply take:
\begin{align*}
1\to p\to p^2 \to \dots \to p^a & \to p^aq \to p^aq^2 \to \dots p^a q^b \\
& \to p^{a - 1}q^b \to \dots \to p^{a - 1} q \\
& \to p^{a - 2} q \to \dots \\
& \vdots \\
& \to pq \to \dots \to pq^b \\
& \to q^b \to \dots \to 1
\end{align*}Then, to multiply upwards, assume that $(n, p) = 1,$ $n$ is achieved by $1, a_1, \dots, a_r\to 1,$ then to do $n\cdot p^a,$ simply take:
\begin{align*}
1 \to p \to p^2\to\dots\to p^a & \to p^a a_1 \to \dots p^a a_r \\
& \to p^{a - 1}a_r \to \dots p^{a - 1} a_1 \\
& \vdots \\
& \to p a_k \to \dots \to p a_{\overline k} \\
& \to a_{\overline k} \to \dots \to a_k \to 1
\end{align*}where $k \in \{1, r\},$ dependent on the parity of $a$(and $\overline k$ is the other one).

Now, we prove perfect squares can’t be achieved.
Observe that perfect squares have an odd number of factors. However, observe that for every consecutive pair, we have to “turn on” or “turn off“ a prime. This clearly gives us a contradiction.
Z K Y
N Quick Reply
G
H
=
a