Stay ahead of learning milestones! Enroll in a class over the summer!

G
Topic
First Poster
Last Poster
k a April Highlights and 2025 AoPS Online Class Information
jlacosta   0
Apr 2, 2025
Spring is in full swing and summer is right around the corner, what are your plans? At AoPS Online our schedule has new classes starting now through July, so be sure to keep your skills sharp and be prepared for the Fall school year! Check out the schedule of upcoming classes below.

WOOT early bird pricing is in effect, don’t miss out! If you took MathWOOT Level 2 last year, no worries, it is all new problems this year! Our Worldwide Online Olympiad Training program is for high school level competitors. AoPS designed these courses to help our top students get the deep focus they need to succeed in their specific competition goals. Check out the details at this link for all our WOOT programs in math, computer science, chemistry, and physics.

Looking for summer camps in math and language arts? Be sure to check out the video-based summer camps offered at the Virtual Campus that are 2- to 4-weeks in duration. There are middle and high school competition math camps as well as Math Beasts camps that review key topics coupled with fun explorations covering areas such as graph theory (Math Beasts Camp 6), cryptography (Math Beasts Camp 7-8), and topology (Math Beasts Camp 8-9)!

Be sure to mark your calendars for the following events:
[list][*]April 3rd (Webinar), 4pm PT/7:00pm ET, Learning with AoPS: Perspectives from a Parent, Math Camp Instructor, and University Professor
[*]April 8th (Math Jam), 4:30pm PT/7:30pm ET, 2025 MATHCOUNTS State Discussion
April 9th (Webinar), 4:00pm PT/7:00pm ET, Learn about Video-based Summer Camps at the Virtual Campus
[*]April 10th (Math Jam), 4:30pm PT/7:30pm ET, 2025 MathILy and MathILy-Er Math Jam: Multibackwards Numbers
[*]April 22nd (Webinar), 4:00pm PT/7:00pm ET, Competitive Programming at AoPS (USACO).[/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, 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
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
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
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
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
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
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
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
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
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
Tuesday, Jun 10 - Aug 26

Calculus
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
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
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
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
Wednesday, May 21 - Aug 6
Sunday, Jun 15 - Sep 14
Monday, Jun 23 - Sep 15

Physics 1: Mechanics
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
Apr 2, 2025
0 replies
k i Adding contests to the Contest Collections
dcouchman   1
N Apr 5, 2023 by v_Enhance
Want to help AoPS remain a valuable Olympiad resource? Help us add contests to AoPS's Contest Collections.

Find instructions and a list of contests to add here: https://artofproblemsolving.com/community/c40244h1064480_contests_to_add
1 reply
dcouchman
Sep 9, 2019
v_Enhance
Apr 5, 2023
k i Zero tolerance
ZetaX   49
N May 4, 2019 by NoDealsHere
Source: Use your common sense! (enough is enough)
Some users don't want to learn, some other simply ignore advises.
But please follow the following guideline:


To make it short: ALWAYS USE YOUR COMMON SENSE IF POSTING!
If you don't have common sense, don't post.


More specifically:

For new threads:


a) Good, meaningful title:
The title has to say what the problem is about in best way possible.
If that title occured already, it's definitely bad. And contest names aren't good either.
That's in fact a requirement for being able to search old problems.

Examples:
Bad titles:
- "Hard"/"Medium"/"Easy" (if you find it so cool how hard/easy it is, tell it in the post and use a title that tells us the problem)
- "Number Theory" (hey guy, guess why this forum's named that way¿ and is it the only such problem on earth¿)
- "Fibonacci" (there are millions of Fibonacci problems out there, all posted and named the same...)
- "Chinese TST 2003" (does this say anything about the problem¿)
Good titles:
- "On divisors of a³+2b³+4c³-6abc"
- "Number of solutions to x²+y²=6z²"
- "Fibonacci numbers are never squares"


b) Use search function:
Before posting a "new" problem spend at least two, better five, minutes to look if this problem was posted before. If it was, don't repost it. If you have anything important to say on topic, post it in one of the older threads.
If the thread is locked cause of this, use search function.

Update (by Amir Hossein). The best way to search for two keywords in AoPS is to input
[code]+"first keyword" +"second keyword"[/code]
so that any post containing both strings "first word" and "second form".


c) Good problem statement:
Some recent really bad post was:
[quote]$lim_{n\to 1}^{+\infty}\frac{1}{n}-lnn$[/quote]
It contains no question and no answer.
If you do this, too, you are on the best way to get your thread deleted. Write everything clearly, define where your variables come from (and define the "natural" numbers if used). Additionally read your post at least twice before submitting. After you sent it, read it again and use the Edit-Button if necessary to correct errors.


For answers to already existing threads:


d) Of any interest and with content:
Don't post things that are more trivial than completely obvious. For example, if the question is to solve $x^{3}+y^{3}=z^{3}$, do not answer with "$x=y=z=0$ is a solution" only. Either you post any kind of proof or at least something unexpected (like "$x=1337, y=481, z=42$ is the smallest solution). Someone that does not see that $x=y=z=0$ is a solution of the above without your post is completely wrong here, this is an IMO-level forum.
Similar, posting "I have solved this problem" but not posting anything else is not welcome; it even looks that you just want to show off what a genius you are.

e) Well written and checked answers:
Like c) for new threads, check your solutions at least twice for mistakes. And after sending, read it again and use the Edit-Button if necessary to correct errors.



To repeat it: ALWAYS USE YOUR COMMON SENSE IF POSTING!


Everything definitely out of range of common sense will be locked or deleted (exept for new users having less than about 42 posts, they are newbies and need/get some time to learn).

The above rules will be applied from next monday (5. march of 2007).
Feel free to discuss on this here.
49 replies
ZetaX
Feb 27, 2007
NoDealsHere
May 4, 2019
Beautiful problem
luutrongphuc   11
N a few seconds ago by whwlqkd
Let triangle $ABC$ be circumscribed about circle $(I)$, and let $H$ be the orthocenter of $\triangle ABC$. The circle $(I)$ touches line $BC$ at $D$. The tangent to the circle $(BHC)$ at $H$ meets $BC$ at $S$. Let $J$ be the midpoint of $HI$, and let the line $DJ$ meet $(I)$ again at $X$. The tangent to $(I)$ parallel to $BC$ meets the line $AX$ at $T$. Prove that $ST$ is tangent to $(I)$.
11 replies
luutrongphuc
Apr 4, 2025
whwlqkd
a few seconds ago
Vector geometry with unusual points
Ciobi_   1
N a minute ago by ericdimc
Source: Romania NMO 2025 9.2
Let $\triangle ABC$ be an acute-angled triangle, with circumcenter $O$, circumradius $R$ and orthocenter $H$. Let $A_1$ be a point on $BC$ such that $A_1H+A_1O=R$. Define $B_1$ and $C_1$ similarly.
If $\overrightarrow{AA_1} + \overrightarrow{BB_1} + \overrightarrow{CC_1} = \overrightarrow{0}$, prove that $\triangle ABC$ is equilateral.
1 reply
Ciobi_
Apr 2, 2025
ericdimc
a minute ago
Collinearity with orthocenter
Retemoeg   9
N 14 minutes ago by X.Luser
Source: Own?
Given scalene triangle $ABC$ with circumcenter $(O)$. Let $H$ be a point on $(BOC)$ such that $\angle AOH = 90^{\circ}$. Denote $N$ the point on $(O)$ satisfying $AN \parallel BC$. If $L$ is the projection of $H$ onto $BC$, show that $LN$ passes through the orthocenter of $\triangle ABC$.
9 replies
+1 w
Retemoeg
Mar 30, 2025
X.Luser
14 minutes ago
Parallel Lines and Q Point
taptya17   14
N 36 minutes ago by Haris1
Source: India EGMO TST 2025 Day 1 P3
Let $\Delta ABC$ be an acute angled scalene triangle with circumcircle $\omega$. Let $O$ and $H$ be the circumcenter and orthocenter of $\Delta ABC,$ respectively. Let $E,F$ and $Q$ be points on segments $AB,AC$ and $\omega$, respectively, such that
$$\angle BHE=\angle CHF=\angle AQH=90^\circ.$$Prove that $OQ$ and $AH$ intersect on the circumcircle of $\Delta AEF$.

Proposed by Antareep Nath
14 replies
taptya17
Dec 13, 2024
Haris1
36 minutes ago
The last nonzero digit of factorials
Tintarn   4
N 42 minutes ago by Sadigly
Source: Bundeswettbewerb Mathematik 2025, Round 1 - Problem 2
For each integer $n \ge 2$ we consider the last digit different from zero in the decimal expansion of $n!$. The infinite sequence of these digits starts with $2,6,4,2,2$. Determine all digits which occur at least once in this sequence, and show that each of those digits occurs in fact infinitely often.
4 replies
Tintarn
Mar 17, 2025
Sadigly
42 minutes ago
P2 Geo that most of contestants died
AlephG_64   2
N 44 minutes ago by Tsikaloudakis
Source: 2025 Finals Portuguese Mathematical Olympiad P2
Let $ABCD$ be a quadrilateral such that $\angle A$ and $\angle D$ are acute and $\overline{AB} = \overline{BC} = \overline{CD}$. Suppose that $\angle BDA = 30^\circ$, prove that $\angle DAC= 30^\circ$.
2 replies
AlephG_64
Yesterday at 1:23 PM
Tsikaloudakis
44 minutes ago
Geometry
youochange   0
an hour ago
m:}
Let $\triangle ABC$ be a triangle inscribed in a circle, where the tangents to the circle at points $B$ and $C$ intersect at the point $P$. Let $M$ be a point on the arc $AC$ (not containing $B$) such that $M \neq A$ and $M \neq C$. Let the lines $BC$ and $AM$ intersect at point $K$. Let $P'$ be the reflection of $P$ with respect to the line $AM$. The lines $AP'$ and $PM$ intersect at point $Q$, and $PM$ intersects the circumcircle of $\triangle ABC$ again at point $N$.

Prove that the point $Q$ lies on the circumcircle of $\triangle ANK$.
0 replies
youochange
an hour ago
0 replies
comp. geo starting with a 90-75-15 triangle. <APB =<CPQ, <BQA =<CQP.
parmenides51   1
N an hour ago by Mathzeus1024
Source: 2013 Cuba 2.9
Let ABC be a triangle with $\angle A = 90^o$, $\angle B = 75^o$, and $AB = 2$. Points $P$ and $Q$ of the sides $AC$ and $BC$ respectively, are such that $\angle APB =  \angle CPQ$ and $\angle BQA = \angle CQP$. Calculate the lenght of $QA$.
1 reply
parmenides51
Sep 20, 2024
Mathzeus1024
an hour ago
Fridolin just can't get enough from jumping on the number line
Tintarn   2
N an hour ago by Sadigly
Source: Bundeswettbewerb Mathematik 2025, Round 1 - Problem 1
Fridolin the frog jumps on the number line: He starts at $0$, then jumps in some order on each of the numbers $1,2,\dots,9$ exactly once and finally returns with his last jump to $0$. Can the total distance he travelled with these $10$ jumps be a) $20$, b) $25$?
2 replies
Tintarn
Mar 17, 2025
Sadigly
an hour ago
Geometry
Captainscrubz   2
N an hour ago by MrdiuryPeter
Source: Own
Let $D$ be any point on side $BC$ of $\triangle ABC$ .Let $E$ and $F$ be points on $AB$ and $AC$ such that $EB=ED$ and $FD=FC$ respectively. Prove that the locus of circumcenter of $(DEF)$ is a line.
Prove without using moving points :D
2 replies
Captainscrubz
3 hours ago
MrdiuryPeter
an hour ago
inequality ( 4 var
SunnyEvan   4
N an hour ago by SunnyEvan
Let $ a,b,c,d \in R $ , such that $ a+b+c+d=4 . $ Prove that :
$$ a^4+b^4+c^4+d^4+3 \geq \frac{7}{4}(a^3+b^3+c^3+d^3) $$$$ a^4+b^4+c^4+d^4+ \frac{252}{25} \geq \frac{88}{25}(a^3+b^3+c^3+d^3) $$equality cases : ?
4 replies
SunnyEvan
Apr 4, 2025
SunnyEvan
an hour ago
Find the constant
JK1603JK   1
N an hour ago by Quantum-Phantom
Source: unknown
Find all $k$ such that $$\left(a^{3}+b^{3}+c^{3}-3abc\right)^{2}-\left[a^{3}+b^{3}+c^{3}+3abc-ab(a+b)-bc(b+c)-ca(c+a)\right]^{2}\ge 2k\cdot(a-b)^{2}(b-c)^{2}(c-a)^{2}$$forall $a,b,c\ge 0.$
1 reply
JK1603JK
5 hours ago
Quantum-Phantom
an hour ago
2025 - Turkmenistan National Math Olympiad
A_E_R   4
N an hour ago by NODIRKHON_UZ
Source: Turkmenistan Math Olympiad - 2025
Let k,m,n>=2 positive integers and GCD(m,n)=1, Prove that the equation has infinitely many solutions in distict positive integers: x_1^m+x_2^m+⋯x_k^m=x_(k+1)^n
4 replies
A_E_R
2 hours ago
NODIRKHON_UZ
an hour ago
hard problem
Cobedangiu   15
N 2 hours ago by Nguyenhuyen_AG
problem
15 replies
Cobedangiu
Mar 27, 2025
Nguyenhuyen_AG
2 hours ago
Sum of whose elements is divisible by p
nntrkien   42
N Apr 2, 2025 by cubres
Source: IMO 1995, Problem 6, Day 2, IMO Shortlist 1995, N6
Let $ p$ be an odd prime number. How many $ p$-element subsets $ A$ of $ \{1,2,\dots,2p\}$ are there, the sum of whose elements is divisible by $ p$?
42 replies
nntrkien
Aug 8, 2004
cubres
Apr 2, 2025
Sum of whose elements is divisible by p
G H J
Source: IMO 1995, Problem 6, Day 2, IMO Shortlist 1995, N6
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
nntrkien
61 posts
#1 • 5 Y
Y by Davi-8191, Adventure10, Mango247, cubres, and 1 other user
Let $ p$ be an odd prime number. How many $ p$-element subsets $ A$ of $ \{1,2,\dots,2p\}$ are there, the sum of whose elements is divisible by $ p$?
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
iura
481 posts
#2 • 6 Y
Y by Adventure10, ken3k06, v4913, Mango247, cubres, and 1 other user
This is problem 6 form IMO 1995.There are two different solutions to it:
The first is purely combinatorial: Tahe $ A = \{0..p - 1\}, B = \{p..2p - 1\}$.
For a set $ S$ different from $ A$ and $ B$ denote $ C = S \bigcap A$ ,$ D = S \bigcap B$.
Then the sets $ (C + x) \bigcap D$ form a group of $ p$ sets where all the residues appear. (The set $ A + x = \{(a + x) mod p| a \in A\}$)
So we can couunt easily.
The second uses multisection formula counting the coeff $ x^{pk} y^p$ at the polynomial
$ (1 + y)(1 + xy)\cdots (1 + x^{2p - 1}y)$
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
ZetaX
7579 posts
#3 • 5 Y
Y by Adventure10, Mango247, balllightning37, cubres, and 1 other user
Define $X: =\{ 1,2,...,p\},Y: =\{p+1,p+2,...,2p\}$.
See $X$ and $Y$ as a representant system for $\mathbb{Z}/ p \mathbb{Z}$, since not more is necessary (so all identities concerning $X$ or $Y$ must be seen $\mod p$).
For a subset $A \subset X$ and $z \in \mathbb{Z}/ p \mathbb{Z}$ define $A+z: =\{ a+z \in X| a \in A \}$ and similar for a subset $B \subset Y$.
Call $A \subset X$ trivial iff $A=\emptyset$ or $A=X$, similar for $B \subset Y$ again.
Now there are only $4$ subsets $P \subset (X \cup Y)$ such that both $P \cap X$ and $P \cap Y$ are trivial, so call these subsets trival from now on too.
Then define for a nontrivial subset $P \subset (X \cup Y)$ a 'translation':
if $P \cap X$ is nontrivial define $P+z : = ((P\cap X) +z) \cup (P \cap Y)$ and $P+z : = (P \cap X) \cup ((P\cap Y) +z)$ otherwise.
Now it's easy to see that when $z$ goes through all possible residue classes, that also the sum of the elements of $P+z$ goes through all of them, so there is exactly one sum that is divisible by $p$.
So the 'translation' divides the nontrivial subsets into equivalence classes of $p$ sets each, all sets of the same class having same number of elements.

Since there are exactly $\binom{2p}{p}$ subsets of the desired order $p$ and $2$ of them are trivial, we get that there are $\frac{\binom{2p}{p}-2}{p}+2$ such subsets.

(note that this technique trivially generalises to other types of subsets and all sets of type $\{1,2,...,kp\}$)
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
pluricomplex
390 posts
#4 • 3 Y
Y by Adventure10, Mango247, cubres
Thanks for nice work ZetaX (is it true ? :D )!
It's a very famous problem ! It seems that there's another way to count this by using polynomial (or useing generator function) . Do you know who creat that nice solution? It's just my wondering about the exactly author of that nice solution which i saw on The Mathematics and Youth Magazine (Vietnam Magazine) in 1996!
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
Bluesea
59 posts
#5 • 3 Y
Y by Adventure10, Mango247, cubres
can you write the second solution in a slightly way iura
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
iura
481 posts
#6 • 11 Y
Y by duanby, Davi-8191, huricane, HolyMath, Scrutiny, Adventure10, cubres, and 4 other users
Consider the polynomial $f(x,y)=(1+xy)(1+x^2y)\ldots(1+x^{2p-1}y)$, the $k$-th factor refering to whether $k$ is present in the set or not.

Then the monomial $x^ky^l$ will refer to the set having $l$ elements and sum of elements $k$, so we need to compute the sum of coefficients of $x^{kp}y^p$ of $f$ to find the answer.

To do this, we need to compute the sum of coefficients $x^{pk}y^{pl}$ and substract 2, since there are two terms for $l\neq 1$:$1, x^{p(2p-1)}y^{2p}$.

To compute the sum of coefficients of $x^{pk}y^{pl}$ we use Multisection formula that says us that it equals

$\frac{1}{p^2}\sum_{i,j}f(w^i,w^j)$($w$ is $p$th root of unity).

Now if $w^i$ is not $1$, $f(w^i,w^j)=\prod(1+w^{ik}w^j)=\prod (1+w^k)^2$ (every $w^m$ will be written twice as $w^{ki}w^j$). This equals $\prod (-1-w^k)^2=g(-1)^2=((-1)^p-1)^2=4$ ($g(x)=x^p-1$ is the polynomial with roots $w^i$). Since there are $p-1$ choices for $w^i$, $p$ choices for $w^j$ we get $4p(p-1)$.

Finally, if $w^i=1$, $f(1,w^j)=(1+w^j)^{2p}$. To evaluate $\sum_{j=0}^{p-1} (1+w^j)^{2p}$, note that it equals $p$ times the coefficients of $x^p$ in the polynomial $(1+x)^{2p}$ by the same multisection formula, so it equals $p\binom{2p}{p}$.

So our total sum is $\frac 1{p^2} (4p(p-1)+p\binom{2p}{p}) =\frac{\binom{2p}{p}-2}p+4$.
Substracting 2 we get the desired answer.
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
Bluesea
59 posts
#7 • 3 Y
Y by Adventure10, Mango247, cubres
iura wrote:
.


To compute the sum of coefficients of $x^{pk}y^{pl}$ we use Multisection formula that says us that it equals

$\frac{1}{p^2}\sum_{i,j}f(w^i,w^j)$($w$ is $p$th root of unity).

.
how can you prove that?What is miultisection formula?
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
iura
481 posts
#8 • 7 Y
Y by pavel kozlov, Adventure10, guptaamitu1, Mango247, cubres, and 2 other users
If $w$ is a $n$th root of unity then $\sum_{i=0}^{n-1} w^k=0$ if $w\neq 1$ and $\sum_{i=0}^{n-1} w^k=n$ if $w=1$. By using this result, we can prove the Multisection Formula (which holds also for polynomials of more variables) :

$f(x)=\sum a_ix^i$, then $\sum_{i\equiv k\pmod m} a_ix^i=\frac 1n (\sum_{i=0}^{n-1} f(w^ix) w^{-ik})$. Particularly

$\sum_{i \equiv k\pmod m} a_i=\frac 1n(\sum_{i=0}^{n-1}f(w^i)w^{-ik})$
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
Bluesea
59 posts
#9 • 3 Y
Y by Adventure10, Mango247, cubres
thank,i understand it now
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
mathmanman
1444 posts
#10 • 9 Y
Y by siddigss, Polynom_Efendi, Supercali, Illuzion, Imayormaynotknowcalculus, Adventure10, cubres, and 2 other users
Another (wonderful) solution :

We let $w$ be the p-th root of unity.
We thus have :
\[ \prod_{k=1}^{2p} (x - w^k) = (x^p - 1)^2 = x^{2p} - 2x^p + 1. \]
We now define the quantity :
\[ t(w) = \sum_{1 \leq j_1 < j_2 < \ldots < j_p \leq 2p} w^{j_1}w^{j_2} \ldots w^{j_p}. \]
So we have $t(w) = 2$. Besides, if we write $t(w) = \sum a_jw^j$, then $a_j$ represents the number of sub-sets ${j_1, j_2, \ldots, j_p}$ of ${1, 2, \ldots, 2p}$ such that $j_1 + j_2 + \ldots + j_p \equiv j \pmod p$, and we can write :
\[ (a_0 - 2) + a_1w + \ldots + a_{p-1}w^{p-1} = 0. \]
Since the minimal polynomial of $w$ on $\mathbb{Q}[X]$ is $1 + x + \ldots + x^{p-1}$, it follows that :
\[ a_0 - 2 = a_1 = a_2 = \ldots = a_{p-1}. \]
Besides, $a_0 + a_1 + \ldots + a_{p-1} = \binom {2p}{p}$, we conclude immediately that :
\[ a_0 = \frac 1p \left\{\binom {2p}{p} - 2 \right \} + 2. \]
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
bilarev
200 posts
#11 • 5 Y
Y by Polynom_Efendi, Imayormaynotknowcalculus, Adventure10, Assassino9931, cubres
mathmanman wrote:
Another (wonderful) solution
mathmanman is this the solution of Nikolai Nikolov from Bulgaria for which he get a special prize?
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
mathmanman
1444 posts
#12 • 5 Y
Y by Polynom_Efendi, Imayormaynotknowcalculus, Adventure10, Mango247, cubres
Yes, exactly. :)
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
bilarev
200 posts
#13 • 3 Y
Y by Adventure10, Mango247, cubres
iura wrote:
$\frac 1{p^2} (4p(p-1)+p\binom{2p}{p}) =\frac{\binom{2p}{p}-2}p+4$.
This is not true...$\frac 1{p^2} (4p(p-1)+p\binom{2p}{p}) =\frac{\binom{2p}{p}-4}p+4$. ;)
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
bilarev
200 posts
#14 • 4 Y
Y by Adventure10, Adventure10, Mango247, cubres
iura wrote:
Consider the polynomial $f(x,y)=(1+xy)(1+x^2y)\ldots(1+x^{2p-1}y)$, the $k$-th factor refering to whether $k$ is present in the set or not.
I think that we have to consider the polynomial $f(x,y)=(1+xy)(1+x^2y)\ldots(1+x^{2p}y)$...am I right?
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
me@home
2349 posts
#15 • 3 Y
Y by Adventure10, Mango247, cubres
Sorry to bump this....

but when I solve it I keep getting $\left\lceil \frac{{2p \choose p}}{p}\right\rceil$, is this the same answer?
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
ZetaX
7579 posts
#16 • 3 Y
Y by Adventure10, Mango247, cubres
That's $1$ to small.
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
robinson123
217 posts
#17 • 2 Y
Y by Adventure10, cubres
mathmanman wrote:
Another (wonderful) solution :

We let $w$ be the p-th root of unity.
We thus have :
\[ \prod_{k=1}^{2p} (x - w^k) = (x^p - 1)^2 = x^{2p} - 2x^p + 1. \]
We now define the quantity :
\[ t(w) = \sum_{1 \leq j_1 < j_2 < \ldots < j_p \leq 2p} w^{j_1}w^{j_2} \ldots w^{j_p}. \]
So we have $t(w) = 2$. Besides, if we write $t(w) = \sum a_jw^j$, then $a_j$ represents the number of sub-sets ${j_1, j_2, \ldots, j_p}$ of ${1, 2, \ldots, 2p}$ such that $j_1 + j_2 + \ldots + j_p \equiv j \pmod p$, and we can write :
\[ (a_0 - 2) + a_1w + \ldots + a_{p-1}w^{p-1} = 0. \]
Since the minimal polynomial of $w$ on $\mathbb{Q}[X]$ is $1 + x + \ldots + x^{p-1}$, it follows that :
\[ a_0 - 2 = a_1 = a_2 = \ldots = a_{p-1}. \]
Besides, $a_0 + a_1 + \ldots + a_{p-1} = \binom {2p}{p}$, we conclude immediately that :
\[ a_0 = \frac 1p \left\{\binom {2p}{p} - 2 \right \} + 2. \]

I wonder that whether we can use this wonderful idea to solve the generation of this problem? I mean we replace $ 2p $ with $ n>p $?
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
mihaith
133 posts
#18 • 4 Y
Y by Adventure10, Mango247, VIATON, cubres
Yes, we can. If $\{ 1,2,...,2n \}$ is the initial set, then the number of subsets with $n$ elements such that each sum of these subsets' elements is divisible by $n$ is
$$\frac{(-1)^n}{n} \cdot \sum_{d|n} (-1)^d \varphi \bigg( \frac{n}{d} \bigg ) \binom {2d}{d} $$where $"\varphi"$ is the Euler totient function.
$$\odot$$
This post has been edited 6 times. Last edited by mihaith, May 1, 2016, 2:32 PM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
62861
3564 posts
#19 • 10 Y
Y by baopbc, huricane, ValidName, pad, hakN, Adventure10, Mango247, VIATON, Chikara, cubres
different solution
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
SidVicious
584 posts
#20 • 4 Y
Y by thedragon01, Adventure10, Mango247, cubres
mihaith wrote:
Yes, we can. If $\{ 1,2,...,2n \}$ is the initial set, then the number of subsets with $n$ elements such that each sum of these subsets' elements is divisible by $n$ is
$$\frac{(-1)^n}{n} \cdot \sum_{d|n} (-1)^d \varphi \bigg( \frac{n}{d} \bigg ) \binom {2d}{d} $$where $"\varphi"$ is the Euler totient function.
$$\odot$$

Solution for generalization: Consider the generating function $f(x)=\prod_{i=1}^{2n}(1-x^iy)$ where $y>1.$ Clearly, it suffices to find sum of coefficients in the terms of the form $x^{kn}y^{n}.$ So let $\omega$ be n-th primitive root of unity. By roots of unity filter it is sufficient to find the sum of coefficients in front of $y^{n}$ in $$P=\frac{\sum_{i=0}^{n-1}f(\omega^{i})}{n}$$Now, $f(w^{i})=\prod_{j=1}^{2n}(1-\omega^{ij}y)=(\prod_{j=1}^{n}(1-\omega^{ij}y))^2.$ Now if we denote $\epsilon=\omega^{i},$ then $\epsilon$ is $\frac{n}{gcd(n,i)}$-th primitive root of unity. Hence $$f(w^{i})=(\prod_{j=0}^{\frac{n}{gcd(n,i)}-1}(1-\epsilon^{j}y))^2=(1-y^{\frac{n}{gcd(n,i)}})^{2gcd(n,i)}...(*)$$Now it is clear that sequence $(\frac{n}{gcd(n,j)})_{1 \le j \le n}$ passes through all divisors of $n$ and only through them. In the spirit of this, we have:
Lemma: For any divisor $d$ of $n$ the following has $\varphi(d)$ solutions in $j: d=\frac{n}{gcd(n,j)}$
Proof: It is equivalent with $gcd(n,j)=\frac{n}{d}$ i.e $gcd(d,\frac{jd}{n})=1$ which, since $\frac{jd}{n} < d$ has $\varphi(d)$ solutions.
So let $d=gcd(n,j)$ in $(*)$ then: $f(w^{i})=(1-y^\frac{n}{d})^{2d}.$ Coefficient in front of $y^{n}$ is thus $(-1)^d\binom{2d}{d}.$ This holds for any divisor $d$ of $n$ and it appears for $\varphi(d)$ times, from Lemma. Hence, the answer is $$\frac{\sum_{d|n} (-1)^d \varphi \bigg( \frac{n}{d} \bigg ) \binom {2d}{d}}{n} \blacksquare$$
This post has been edited 2 times. Last edited by SidVicious, Apr 8, 2017, 7:21 AM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
nmd27082001
486 posts
#21 • 2 Y
Y by Adventure10, cubres
Nice problem
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
unicomyy
17 posts
#22 • 3 Y
Y by Adventure10, Mango247, cubres
how to get the formula in *
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
mastermind.hk16
143 posts
#23 • 2 Y
Y by Adventure10, cubres
My solution is similar to CantonMathGuy's.

Let $A = \{ 1,2, \dots, p \}$ and $B = \{ p+1, p+2, \dots ,2p \}$. As usual $\sigma(S)$ denotes the sum of elements of set $S$.

Claim: The number of $k$-element sets $S_k \subset A$, $k<p$, such that $\sigma(S_k) \equiv \ell \mod p$, for a fixed $\ell$ is $\frac{1}{p} \binom{p}{k}$.
Fix $k<p$. We will establish the desired bijection. Suppose $\sigma(S_k) \equiv \ell \mod p$. Then to each element of $S_k$ add a fixed constant $i$ so that $\sigma(S_k +i) \equiv \ell +ik \mod p$. Here addition is defined in modulo $p$. Anyway,we can choose $i$ so that $\ell +ik$ is any desired residue mod $p$. There are $\binom{p}{k}$ subsets in total. By our bijection between all residues we get $\frac{1}{p} \binom{p}{k}$ subsets with $\sigma(S_k) \equiv \ell \mod p$.

Now we can directly count the number of $p$-element subsets with sum divisible by $p$.
If we choose no elements from $A$, then we choose all of $B$. If we choose all of $A$, then choose nothing from $B$.
Choose $1 \leq i \leq p-1$ elements from $A$. There are $\binom{p}{i}$ ways to do this. Then choose $p-i$ elements from $B$ with a fixed sum mod $p$. There are $\frac{1}{p} \binom{p}{p-i}$ ways to do so.

So the number of ways is $$2 + \sum _{i=1} ^{p-1} \frac{1}{p} \binom{p}{i} \binom{p}{p-i} = \boxed{2 + \frac{\binom{2p}{p}-2}{p}}$$The last equality follows from the identity $\binom{2p}{p} = \sum_{i=0}^{p} \binom{p}{i} \binom{p}{p-i}$ which can be proved by double counting the number of ways to choose $p$ elements from a $2p$-element set. So 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.
BOBTHEGR8
272 posts
#24 • 2 Y
Y by Adventure10, cubres
iura wrote:
. To evaluate $\sum_{j=0}^{p-1} (1+w^j)^{2p}$, note that it equals $p$ times the coefficients of $x^p$ in the polynomial $(1+x)^{2p}$ by the same multisection formula, so it equals $p\binom{2p}{p}$.
No, it equals $p\binom{2p}{p}+2p$ , as you forgot to consider the first and last terms.
But anyways you got the final answer correct ,so maybe it was a typo.
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
djmathman
7936 posts
#25 • 1 Y
Y by cubres
Of course, we can determine the number of such subsets for any fixed size of subset (not just those with $p$ elements).

As in other solutions, let
\[
f(x,y) = (1+xy)(1+x^2y)\cdots(1+x^{2p}y),
\]and let $\zeta$ be a primitive $p^{\text{th}}$ root of unity. We will consider this as a generating function in $x$ first, run the roots of unity computation, and read the result as a generating function in $y$. Indeed, observe that $f(1,y) = (1+y)^{2p}$ while
\begin{align*}
f(\zeta^k,y) &= y^{2p}\Big((-y^{-1} - 1)(-y^{-1} - \zeta)\cdots (-y^{-1}-\zeta^{p-1})\Big)^2 \\&\hspace{2in}= y^{2p}(-(y^{-1})^p-1)^2 = (y^p + 1)^2.
\end{align*}Therefore the sum of all coefficients of $x$ associated to powers of $p$ is
\[
\frac{1}{p}\sum_{k=0}^{p-1}f(\zeta^k,y) = \frac{(p-1)(y^p + 1)^2 + (y+1)^{2p}}p.
\]From this, we can read off the answer as the coefficient of $y^p$ in the above expression, or $\boxed{2 + \tfrac{\binom{2p}p - 2}p}$.

In general, the number of subsets of size $k$ whose sum of elements is divisible by $p$ equals $\tfrac{1}{p}\textstyle\binom{2p}k$ when $k$ is not divisible by $p$ and equals $1$ when either $k=0$ or $k=2p$ (as we would expect). Additionally, the total number of subsets over all sizes is $4 + \tfrac{4^p-4}{p}$, found by setting $y = 1$ above.
This post has been edited 2 times. Last edited by djmathman, Feb 8, 2021, 3:57 AM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
Grizzy
920 posts
#26 • 2 Y
Y by Mango247, cubres
Let $f(x, y)$ be

\[(1+xy)(1+x^2y)\cdots (1+x^{2p}y).\]
Then we desire the sum of the coefficients of terms of the form $x^{pk}y^p$, where $k$ is a positive integer.

To get this value, we apply the roots of unity filter twice. Let $\omega = e^{\tfrac{2\pi i}{p}}$. Note that the sum of the coefficients of $y^0, y^p, y^{2p}$ is

\[\frac{\sum_{k=0}^{p-1} f(x, \omega^k)}{p}.\]
Then the coefficients of $y^0$ and $y^{2p}$ are clearly $1$ and $x^{p(2p+1)}$, so the coeffient of $y^p$ is

\[\frac{\sum_{k=0}^{p-1} f(x, \omega^k)}{p} - x^{p(2p+1)} - 1.\]
To find the sum of the coefficients of $x$ raised to a power of a multiple of $p$, we once again apply the roots of unity filter. We desire the value of

\begin{align*}
\frac{\sum_{m=0}^{p-1} \left(\frac{\sum_{k=0}^{p-1} f(\omega^m, \omega^k)}{p} - (\omega^m)^{p(2p+1)} - 1\right)}{p} & = \frac{ \frac{\sum_{m=0}^{p-1} \sum_{k=0}^{p-1} f(\omega^m, \omega^k)}{p} - p(\omega^m)^{p(2p+1)} - p}{p}\\
& = \frac{\frac{\sum_{m=0}^{p-1} \sum_{k=0}^{p-1} f(\omega^m, \omega^k)}{p} - p - p}{p}\\
& = \frac{\sum_{m=0}^{p-1} \sum_{k=0}^{p-1} (1 + \omega^m\omega^k)(1 + \omega^{2m}\omega^k)\cdots(1 + \omega^{2pm}\omega^k) - 2p^2}{p^2}.
\end{align*}
It's easy to see that the two sets

\[\{m+k, 2m+k, \cdots, pm+k\}\]
and

\[\{(p+1)m+k, (p+2)m+k, \cdots, 2pm+k\}\]
are equal to the set $\{0, 1, \cdots, p-1\}$ of residues modulo $p$ when $m$ is not equal to $0$. When $m=0$, this set is just the number $k$ repeated $p$ times. Therefore,

\begin{align*}
&\text{ }\sum_{m=0}^{p-1} \sum_{k=0}^{p-1} (1 + \omega^m\omega^k)(1 + \omega^{2m}\omega^k)\cdots(1 + \omega^{2pm}\omega^k)\\ = &\text{ }\sum_{k=0}^{p-1} (1+\omega^k)^{2p} +  p(p-1) \cdot \left((1 + 1)(1 + \omega)\cdots(1 + \omega^{p-1})\right)^2.
\end{align*}
Then we note that, by expanding using the binomial theorem and summing, we get that

\[\sum_{k=0}^{p-1} (1+\omega^k)^{2p} = p\cdot\binom{p}{0} + p\binom{2p}{p} + p\binom{p}{p} \omega^{kp} = p\left(\binom{2p}{p} + 2\right).\]
Moreover, since the polynomial

\[Q(x) = x^p-1\]
factors as

\[(x-1)(x-\omega)(x-\omega^2)\cdots (x-\omega^{p-1}),\]
we get that

\[(1 + 1)(1 + \omega)\cdots(1 + \omega^{p-1}) = (-1)^pQ(-1) = 2\]
so that

\[p(p-1) \cdot \left((1 + 1)(1 + \omega)\cdots(1 + \omega^{p-1})\right)^2 = 4p(p-1).\]
Therefore, we have

\[\sum_{m=0}^{p-1} \sum_{k=0}^{p-1} (1 + \omega^m\omega^k)(1 + \omega^{2m}\omega^k)\cdots(1 + \omega^{2pm}\omega^k) = p\left(\binom{2p}{p} + 2\right) + 4p(p-1)\]
so our answer is

\begin{align*}
\frac{\sum_{m=0}^{p-1} \sum_{k=0}^{p-1} (1 + \omega^m\omega^k)(1 + \omega^{2m}\omega^k)\cdots(1 + \omega^{2pm}\omega^k) - 2p^2}{p^2} & = \frac{p\left(\binom{2p}{p} + 2\right) + 4p(p-1) - 2p^2}{p^2}\\
& = \boxed{\frac{1}{p}\left(\binom{2p}{p} - 2\right) + 2}
\end{align*}
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
IAmTheHazard
5001 posts
#27 • 2 Y
Y by kamatadu, cubres
The answer is $\frac{1}{p}\left(\binom{2p}{p}-2\right)+2$. We will instead find the number of subsets $A$ such that $p$ divides $|A|$ and the sum of the elements of $A$ is also divisible by $p$. Note that this is just the answer plus two (for the empty set and $A=\{1,\ldots,2p\}$).
Consider the generating function
$$F(x,y)=(1+x^1y)(1+x^2y)\ldots (1+x^{2p}y),$$so the coefficient of $x^ay^b$ represents the number of subsets with sum $a$ and $b$ elements. Then by a roots of unity filter we wish to find
$$\frac{1}{p^2}\sum_{i=0}^{p-1}\sum_{j=0}^{p-1}F(z^i,z^j),$$where $z$ is a primitive $p$th root of unity.
Note that if $p \nmid i$, then
$$F(z^i,z^j)=(1+z^{1i+j})\ldots(1+z^{2pi+j})=(1+z^0)^2(1+z^1)^2\ldots(1+z^{p-1})^2.$$Since $(x-z^0)\ldots(x-z^{p-1})=x^p-1$ and $p$ is odd, the last product on the above line is equal to $(1^p+1)^2=4$. Thus we can write
$$\frac{1}{p^2}\sum_{i=0}^{p-1}\sum_{j=0}^{p-1}F(z^i,z^j)=\frac{1}{p^2}\left(4p(p-1)+\sum_{j=0}^{p-1}F(1,z^j)\right)=\frac{1}{p^2}\left(4p(p-1)+\sum_{j=0}^{p-1}(1+z^j)^{2p}\right).$$To find the value of the inner summation, consider the sum of the $x^{kp}$ coefficients of $(1+x)^{2p}$, which by another roots of unity filter is simply $\frac{1}{p}\sum_{j=0}^{p-1}(1+z^j)^{2p}$.
On the other hand by direct computation this quantity is equal to $\binom{2p}{p}+2$, so it follows that
$$\frac{1}{p^2}\left(4p(p-1)+\sum_{j=0}^{p-1}(1+z^j)^{2p}\right)=\frac{1}{p^2}\left(4p(p-1)+p\left(\binom{2p}{p}+2\right)\right)=\frac{1}{p}\left(4p-4+\binom{2p}{p}+2\right)=\frac{1}{p}\left(\binom{2p}{p}-2\right)+4.$$Subtracting $2$ yields the desired answer. $\blacksquare$
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
th1nq3r
146 posts
#28 • 1 Y
Y by cubres
This problem took me so long.

The idea is to partition $\{1, 2, \dots, 2p\} = \{1, 2, \dots, p\} \cup \{p + 1, p + 2, \dots, 2p\} = A \cup B$.

$\bold{Lemma}:$ $\binom{2p}{p} = \sum_{k = 0}^{p} \binom{p}{k} \binom{p}{p - k} = 2 + \sum_{k = 1}^{p - 1} \binom{p}{k} \binom{p}{p - k}$.
Proof

Consider the set $A_{\ell} = \{a_1 + \ell, a_2 + \ell, \dots, a_k + \ell\}$ for $k \neq p$ integers $a_1, a_2, \dots, a_k \in A$. Then we make the trivial but important observation that we have that the sequence $A_0, A_1, \dots A_{p - 1}$ form a complete set of residues modulo $p$. Hence if we were to count say, the number of subsets of $k$ elements for which they are $0 \pmod p$, there would be $\frac{1}{p} \binom{p}{k}$ such subsets. (For every $p$ subsets, there is only but one with sum divisible by $p$).

Consider then the set $B_{\ell'} = \{b_1 + \ell', b_2 + \ell', \dots, b_k + \ell'\}$ for $k \neq p$ integers $b_1, b_2, \dots, b_k \in B$. Similarly, this sequence of sets forms a complete set of residues modulo $p$.

Now if the set $A_i \equiv x \pmod p$, then we may find a suitable $B_j$ so that $B_j \equiv p - x \pmod p$, as both of the sequences $A_i$ and $B_j$ form a complete residue class modulo $p$. Thus there are $p \left (\frac{1}{p} \binom{p}{k} \frac{1}{p} \binom{p}{p - k} \right) = \frac{1}{p} \binom{p}{k} \binom{p}{p - k}$ ways to choose these sets. Summing over all $k$ gives us $\frac{1}{p} \left(\binom{2p}{p} - 2 \right)$.

Now we also have the original sets $A$ and $B$. (Both of these sets have the property pertaining to them that the sum of their elements is divisible by $p$ and contain $p$ elements). Hence the total number of such $p$ element subsets becomes $\boxed{2 + \frac{1}{p} \left(\binom{2p}{p} - 2 \right)}$. $\blacksquare$
This post has been edited 1 time. Last edited by th1nq3r, Jul 23, 2022, 7:11 PM
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
#29 • 1 Y
Y by cubres
Here's a somewhat shorter solution.

Consider the generating function $$F(k) = \prod_{i=1}^{2p} (1+k^i X)$$for which the coefficient of the $X^a k^b$ term denotes the number of $a$-element subsets with sum $B$. It suffices to find the coefficient of the $X^p$ term in this expansion for $a$ a multiple of $p$, which is given via roots of unity filter by $$\sum_{\omega^p = 1} f(\omega) = f(1) + \sum_{\omega^p =1, \omega \neq 1} f(\omega).$$Notice that $f(1) ={2p \choose p}$, and $f(\omega)$ for any arbitrary $p$th root of unity (necessarily primitive) denotes the coefficient of $X^p$ in $$\prod_{i=1}^{2p}(1+\omega^i X) = (-1)^{2p} \prod_{i=1}^{2p} (-1-\omega^i X) = (-1-X^p)^2 = (1+X^p)^2,$$which is just 2.

Thus, the answer is $$\frac{{2p \choose p} + 2(p-1)}p = \frac{{2p \choose p} - 2}p + 2$$subsets.
This post has been edited 1 time. Last edited by HamstPan38825, Jul 26, 2022, 12:36 AM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
bluelinfish
1446 posts
#31 • 1 Y
Y by cubres
Consider the generating function \[ F(x,y) = \prod_{i=0}^{2p}(1+x^iy).\]It suffices to find the sum of coefficients of all terms where the power of $x$ is a multiple of $p$ and the power of $y$ is equal to $p$. Let $\omega = e^{\frac{2\pi i}{p}}.$ Using roots of unity filter, the sum of coefficients of all terms where the power of $x$ is a multiple of $P$ is \[ \frac1p\sum_{i=0}^{p-1} F(\omega^i, y). \]The term when $y=0$ is equal to $(1+y)^{2p}$, for which the $y^p$ coefficient is $\binom{2p}p$. All other terms in this summation are equivalent to \[ \left(\prod_{i=0}^{p-1}(1+\omega^iy)\right)^2.\]The inside product is equivalent to evaluating the function with roots $\omega^iy$ (namely $x^p+y^p$) at $1$, hence the entire term is equal to $(1+y^p)^2$, with a $y^p$ coefficient of $2$. Since there are $p-1$ such terms, the total contribution is $2(p-1)$.

Our desired answer is the sum of the $y^p$ coefficients in the filter summation, which is equal to \[ \frac1p\left(\binom{2p}p+2(p-1)\right).\]
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
KevinYang2.71
411 posts
#32 • 6 Y
Y by brainfertilzer, LostDreams, megarnie, channing421, deduck, cubres
Consider
\[
\prod_{k=1}^{2p}(1+y^kx)=\cdots+f(y)x^p+\cdots.\tag{1}
\]Let $a_i$ denote the number of $p$-element subsets of $\{1,2,\ldots,2p\}$ which has the sum of elements equal to $i$. It follows that
\[
\sum_{n=0}^\infty a_ny^n=f(y).
\]We also have
\[
\sum_{p\mid n}a_n=\frac{f(1)+f(\omega)+f(\omega^2)+\cdots+f(\omega^{p-1})}{p}
\]where $\omega=e^\frac{2\pi i}{k}$. Plugging $y=1$ into (1) gives $(1+x)^{2p}=\cdots+f(1)x^p+\cdots$. By the binomial theorem, the coefficient of the $x^p$ term of $(1+x)^{2p}$ is $\binom{2p}{p}$. Now, for $1\leq j\leq p-1$, we have
\begin{align*}
\cdots+f(\omega^j)x^p+\cdots&=\prod_{k=1}^{2p}(1+\omega^{jk}x)\\
&=\prod_{k=1}^{2p}(1+\omega^kx)\\
&=\left(\prod_{k=1}^{p}(1+\omega^kx)\right)^2\\
&=(x^p+1)^2\\
&=x^{2p}+2x^p+1
\end{align*}so $f(\omega^j)=2$. Thus we have
\[
\sum_{p\mid n}a_n=\frac{2(p-1)+\binom{2p}{p}}{p}.\text{ }\square
\]
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
huashiliao2020
1292 posts
#33 • 1 Y
Y by cubres
Ha! The answer confirmation's so simple I knew there had to be a combinatorial way! So I'm not going to post some rouf solution.

By intuition we feel like our answer would be close to 1/p(2pCp) since it's around that expected value 1 in p subsets to be divisible by p; but since there are TWO elements same mod p, it kind of messes things up, while one distinct of each would help greatly. So we partition the sets into $\{1, 2, \dots, 2p\} = \{1, 2, \dots, p\} \cup \{p + 1, p + 2, \dots, 2p\} = M\cup N$; now, consider $M_k=\{m_1+k,m_2+k,...,m_m+k\}\forall k\ne p,m_1,m_2,...,m_m\in M$; do the similar thing for N. There are $p \left (\frac{1}{p} \binom{p}{k} \frac{1}{p} \binom{p}{p - k} \right) = \frac{1}{p} \binom{p}{k} \binom{p}{p - k}$ ways to choose some $N_i\equiv p-M_j\pmod p$; in particular, summing over all possible k simplifies to $\frac{1}{p} \left(\binom{2p}{p} - 2 \right)$; but since we also need to add set M and N, there are $2 + \frac{1}{p} \left(\binom{2p}{p} - 2 \right)$ many ways as our final answer. $\blacksquare$
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
sixoneeight
1137 posts
#34 • 1 Y
Y by cubres
Goofy gen func rouf

Consider a generating function $$F(x,y) = (1+xy)(1+x^2y)(1+x^3y)\dots (1+x^{2p}y)$$This generating function describes the subsets, where the exponent of $x$ is the sum of the elements and the exponent of $y$ is the size. Therefore, we want the sum of the coefficients of $x^{kp}y^p$ for positive integers $k$.


We now apply a Roots of Unity Filter. The generating function containing only the terms $x^{kp}$ can be obtained by taking
\[
\frac{1}{p}\sum_{k=0}^{p-1}F(e^{\frac{ik\pi}{p}}x,y)
\]and we want the sum of the terms with exponent $y^p$ when evaluated at $x=1$. We write
\[
    (1+xy)(1+x^2y)\dots (1+x^{2p}y) =
    y^{2p}\left(-\frac1y-x\right)\left(-\frac1y-x^2\right)\left(-\frac1y-x^3\right)\dots \left(-\frac1y-x^{2p}\right)
\]Let $P_x(t)$ be a monic polynomial in $t$ with roots $x^i$ for $i=1,2,\dots 2p$. When $x\neq 1$ is a $p^\text{th}$ root of unity, $P_x(t) = (t^p-1)^2$ Then, we find that $$F(x,y) = y^{2p}P_x\left(-\frac1y\right)$$Plugging in $x=1$, we calculate that
\begin{align*}
[y^p]\frac{1}{p}\sum_{k=0}^{p-1}F(e^{\frac{ik\pi}{p}},y) &= [y^p]\frac{y^{2p}}{p}P_{e^\frac{ik\pi}{p}}\left(-\frac1y\right)\\
&= [y^p]\frac{y^{2p}}{p}\left((p-1)\left(\frac{-1}{y^p}-1\right)^2+\left(1+\frac{1}{y}\right)^{2p}\right)\\
&= [y^p]\frac{1}{p}\left((p-1)(y^p+1)^2 + (y+1)^{2p}\right)\\
&= \boxed{\frac{1}{p}\left(2(p-1)+\binom{2p}{p}\right)}
\end{align*}
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
Spectator
657 posts
#35 • 4 Y
Y by OronSH, KevinYang2.71, KnowingAnt, cubres
Let $A(x,y)$ be the generating function
\[A(x,y) = (1+yx)(1+yx^2)\cdots(1+yx^{2p})\]We apply the roots of unity filter on $x$ to get
\[\frac{A(1,y)+A(w,y)+\cdots+A(w^{p-1},y)}{p} = \frac{(1+y)^{2p}+(p-1)(1+yw)\cdots(1+yw^{2p})}{p}\]We call this function on $y$, $B(y)$. Note that
\[(1+w)(1+w^2)\cdots(1+w^{p}) = 2\]Then, we apply the roots of unity filter on $y$ to get
\begin{align*}
    \frac{B(1)+B(w)+B(w^2)+\cdots B(w^{p-1})}{p} &= \frac{p+p\binom{2p}{p}+p+2^{2}(p-1)(p)}{p^2}
\end{align*}But, we need to subtract $2$ because it counts the empty set and the set with size $2p$. This gives us
\[\boxed{\frac{\binom{2p}{p}+2p-2}{p}}\]
This post has been edited 1 time. Last edited by Spectator, Nov 11, 2023, 3:50 PM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
GrantStar
815 posts
#36 • 1 Y
Y by cubres
Let $F(x,y)=\prod_{i=1}^{2p}(1+yx^i)$ be the gen func representing sums of subsets and their number of elements. Note that the answer is equal to \[\frac{1}{p^2}\left(\sum_{k=1}^p \sum_{k=1}^p F\left(e^{2\pi ij/p},e^{2\pi i k/p}\right)\right)-2\]by roots of unity filter, with the $-2$ coming from the empty set and $\{1,2,\dots,2p\}$ being included in this count. We thus compute this!!!
  • First, if $j=1,2,\dots,p-1$, then the sequence $j,2j,\dots, 2pj$ contains each residue modulo $p$ twice. Thus $j+k,2j+k,\dots, 2pj+k$ contains each residue twice. herefore, \[\sum_{k=1}^{p}F\left(e^{2\pi ij/p},e^{2\pi i k/p}\right)=p\prod_{k=1}^p \left(1+e^{2\pi i k/p}\right)^2=4p\]As \[\prod_{k=1}^p \left(1+e^{2\pi i k/p}\right)^2=\prod_{k=1}^p \left(-1-e^{2\pi i k/p}\right)^2=P(-1)^2=4\]in $P(x)=x^p-1$.
  • If $j=p$, then \[\sum_{k=1}^{p}F\left(1,e^{2\pi i k/p}\right)=p\sum_{k=1}^{p}F\left(1+e^{2\pi i k/p}\right)^{2p}\]By roots of unity filter on $(1+x)^{2p}$, we get that the above sum is $p\left(2+\binom{2p}{p}\right).$
Thus the total sum ignoring the division by $p^2$ and subtraction is \[p\left(2+\binom{2p}{p}\right)+4p(p-1)=p\binom{2p}{p}+4p^2-2p\]implying a final answer of \[\frac{p\binom{2p}{p}+4p^2-2p}{p^2}-2=\frac{\binom{2p}{p}-2}{p}+2.\]

Remark: N6 is crazy lol
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
blueprimes
325 posts
#37 • 1 Y
Y by cubres
We will create a generating function $f(x, y)$, where the coefficient $c_{i, j}$ of $x^i y^j$ represents the number of subsets $A \subseteq \{1, 2, \dots, 2p \}$ where the sum of the elements of $A$ is $i$, while $|A| = j$. By considering how many numbers we extract from each individual residue class, it is not hard to find that
$$f(x, y) = \prod_{n = 0}^{p - 1} (1 + 2x^ny + x^{2n}y^2) = \prod_{n = 0}^{p - 1} (1 + x^ny)^2.$$We will use a double roots of unity filter to add all coefficients $c_{i, j}$ where $p \mid i, j$, then subtract $2$ to account for the cases when $j = 0, 2p$. Let $\omega = e^{2 \pi i / p}$. We want to evaluate $\frac{1}{p^2} \sum_{r = 0}^{p - 1} \sum_{s = 0}^{p - 1} f(\omega^r, \omega^s)$. When $r \ne 0$, $f(\omega^r, \omega^s) = \left[\prod_{n = 0}^{p - 1} (1 + \omega^n) \right]^2 = 2^2 = 4$. All cases belonging to the latter yield a total of $4p(p - 1)$. On the other hand, when $r = 0$, we have $\sum_{s = 0}^{p - 1} f(1, \omega^s) = \sum_{s = 0}^{p - 1} (1 + \omega^s)^{2p}$. Using the binomial theorem, only the terms when the exponent of $\omega$ is divisible by $p$ are left behind, and we obtain $p \left[\binom{2p}{p} + 2 \right]$. Our final answer is
$$\frac{4p(p - 1) + p \left[\binom{2p}{p} + 2 \right]}{p^2} - 2 = \frac{\binom{2p}{p} - 2}{p} + 2.$$
This post has been edited 1 time. Last edited by blueprimes, Apr 29, 2024, 1:24 AM
Reason: omega definition
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
KnowingAnt
149 posts
#38 • 1 Y
Y by cubres
I think you only need one filter! We want to find the sum of the coefficients of $x^0y^p,x^py^p,x^{2p}y^p,\dots$ in
\[(1 + xy)(1 + x^2y)\dots(1 + x^{2p}y)\text{.}\]First fix $y$. Now let $\omega$ be a primitive $p$-th root of unity, we want the coefficient of $y^p$ in
\[\frac{P(1) + P(\omega) + \dots + P(\omega^{p - 1})}{p} = \frac{(1 + y)^{2p} + (p - 1)(1 + y^p)^2}{p}\]so the answer is
\[\frac1p\left(\binom{2p}{p} - 2\right) + 2\text{.}\]
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
Mathandski
738 posts
#39 • 1 Y
Y by cubres
Subjective Rating (MOHs) $       $
Attachments:
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
Maximilian113
525 posts
#40 • 1 Y
Y by cubres
niceee :-D
Let $A(x, y) = (1+xy)(1+x^2y)(\cdots)(1+x^{2p}y).$ Clearly, we want the sum of the coefficients of the terms with $x$ of degree divisible by $p$ and $y$ having degree $p.$ Let $z=e^{2\pi i/p}.$ Then by Roots of Unity Filter we have $$\frac{1}{p} \sum^{p-1}_{k=0}A(z^k, y).$$However, for $k = 1, 2, \cdots, p-1,$ clearly the set $\{1, z, z^2, \cdots z^{p-1}\}$ is a permutation of $\{ z^k, z^{2k}, \cdots z^{pk} \},$ so $$A(z^k, y) = \left( \prod_{k=0}^{p-1} (1+z^ky) \right)^2 = \left( y^{2p} \prod_{k=0}^{p-1} (\frac{1}{y}+z^k) \right)^2 = y^{2p} \cdot \left( -\frac{1}{y^p}-1 \right)^2 = (y^p+1)^2.$$Hence, our sum equals $$\frac{1}{p} \left((p-1)(y^p+1)^2+(y+1)^{2p} \right).$$Now, we simply extract the coefficient of $y^p$ from here, and this is just $$\boxed{\frac{2p-2+\binom{2p}{p}}{p}}.$$
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
golue3120
54 posts
#41 • 1 Y
Y by cubres
Here's the other genfunc solution.

Let $\textstyle\binom{n}{k}_q$ be the $q$-binomial coefficient and $\textstyle [n]_q=1+q+\dots+q^{n-1}=\frac{1-q^n}{1-q}$. Then it is well-known that
\[\sum_{\substack{S\subseteq\{1,2,\dots,2p\}\\|S|=p}}q^{\sum S}=q^{p(2p+1)}\binom{2p}{p}_q.\]
Let $\omega$ be a primitive $p$th root of unity. Then we have
\[\binom{2p}{p}_q=\frac{[2p]_q[2p-1]_q\dots[p+1]_q}{[p]_q[p-1]_q\dots[1]_q}=(1+q^p)\frac{[2p-1]_q\dots[p+1]_q}{[p-1]_q\dots[1]_q}.\]As we let $q\rightarrow\omega$, then the product cancels out, so we have $\textstyle\binom{2p}{p}_\omega=1+\omega^p=2$.

Hence by roots of unity filter, the desired result is $\textstyle\frac{1}{p}\sum_{i=0}^{n-1}\binom{n}{k}_{\omega^i}=\frac{\binom{2p}{p}-2}{p}+2$, since $\omega^0=1$ and all other powers are primitive $p$th roots of unity.
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
smileapple
1010 posts
#42 • 1 Y
Y by cubres
Define \[P(x,y)=\prod_{n=1}^{2p}(x+y^n).\]Note that if a subset $S\subseteq\{1,2,\dots,2p\}$ has $m$ elements that sum to $s$, the set $S$ will show up in the expansion of $P$ as $x^{2p-m}y^s$.

Now let $\zeta=e^{2\pi i/n}$. By roots of unity filter it suffices to find the coefficient $c_p$ of $x^p$ in the expansion of $Q(x)=\frac1p\sum_{n=0}^{p-1}P(x,\zeta^n)$. But note that $P(x,\zeta^n)$ is equal to $(x+1)^{2p}$ if $n=0$ and is equal to $(x^p+1)^2$ otherwise. Thus \[Q(x)=\frac{(x+1)^{2p}+(p-1)(x^p+1)^2}p,\]from which extracting $c_p$ yields \[c_p=\boxed{\frac{\binom{2p}p+2(p-1)}p},\]which is our answer. $\blacksquare$

Edit: 999th post?
This post has been edited 1 time. Last edited by smileapple, Feb 21, 2025, 1:35 AM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
eg4334
617 posts
#43 • 1 Y
Y by cubres
Lol what. Just take the generating function $(x+y)(x+y^2) \dots (x+y^{2p})$ where $x$ counts the number of elements we dont use and $y$ counts the exponent. We want $y$ to be a multiple of $p$, and $x$ to be $p$. To extract the first condition, take ROUF with a primitive $p$th root $\omega$. We get $\frac{(x+1)^{2p} + (p-1)((x+\omega)(x+\omega^2)\dots (x+\omega^p))^2}{p} = \frac{(x+1)^{2p} + (p-1)(x^p+1)^2}{p}$. Its obvious by binomial expansion that the answer from here is $\boxed{\frac{\binom{2p}{p} + 2(p-1)}{p}}$
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
cubres
104 posts
#44
Y by
Yapping
Storage - grinding IMO problems
Z K Y
N Quick Reply
G
H
=
a