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

G
Topic
First Poster
Last Poster
k a May Highlights and 2025 AoPS Online Class Information
jlacosta   0
May 1, 2025
May is an exciting month! National MATHCOUNTS is the second week of May in Washington D.C. and our Founder, Richard Rusczyk will be presenting a seminar, Preparing Strong Math Students for College and Careers, on May 11th.

Are you interested in working towards MATHCOUNTS and don’t know where to start? We have you covered! If you have taken Prealgebra, then you are ready for MATHCOUNTS/AMC 8 Basics. Already aiming for State or National MATHCOUNTS and harder AMC 8 problems? Then our MATHCOUNTS/AMC 8 Advanced course is for you.

Summer camps are starting next month at the Virtual Campus in math and language arts that are 2 - to 4 - weeks in duration. Spaces are still available - don’t miss your chance to have an enriching summer experience. 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 upcoming events:
[list][*]May 9th, 4:30pm PT/7:30pm ET, Casework 2: Overwhelming Evidence — A Text Adventure, a game where participants will work together to navigate the map, solve puzzles, and win! All are welcome.
[*]May 19th, 4:30pm PT/7:30pm ET, What's Next After Beast Academy?, designed for students finishing Beast Academy and ready for Prealgebra 1.
[*]May 20th, 4:00pm PT/7:00pm ET, Mathcamp 2025 Qualifying Quiz Part 1 Math Jam, Problems 1 to 4, join the Canada/USA Mathcamp staff for this exciting Math Jam, where they discuss solutions to Problems 1 to 4 of the 2025 Mathcamp Qualifying Quiz!
[*]May 21st, 4:00pm PT/7:00pm ET, Mathcamp 2025 Qualifying Quiz Part 2 Math Jam, Problems 5 and 6, Canada/USA Mathcamp staff will discuss solutions to Problems 5 and 6 of the 2025 Mathcamp Qualifying Quiz![/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
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
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, 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
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
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
Tuesday, May 6 - Aug 19
Wednesday, Jun 4 - Sep 17
Sunday, Jun 22 - Oct 19
Friday, Jul 18 - Nov 14

Introduction to Geometry
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

Paradoxes and Infinity
Mon, Tue, Wed, & Thurs, Jul 14 - Jul 16 (meets every day of the week!)

Intermediate: Grades 8-12

Intermediate Algebra
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
Sunday, Jun 1 - Aug 24
Wednesday, Jun 18 - Sep 3

Precalculus
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
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
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

AIME Problem Series A
Thursday, May 22 - Jul 31

AIME Problem Series B
Sunday, Jun 22 - Sep 21

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
Mon, Tue, Wed & Thurs, Jun 23 - Jun 26 (meets every day of the week!)
0 replies
jlacosta
May 1, 2025
0 replies
Orthocenter
jayme   4
N 7 minutes ago by Sadigly
Dear Mathlinkers,

1. ABC an acuatangle triangle
2. H the orthcenter of ABC
3. DEF the orthic triangle of ABC
4. A* the midpoint of AH
5. X the point of intersection of AH and EF.

Prove : X is the orthocenter of A*BC.

Sincerely
Jean-Louis
4 replies
jayme
Mar 25, 2015
Sadigly
7 minutes ago
Concurrency
Dadgarnia   29
N 8 minutes ago by blueprimes
Source: Iranian TST 2020, second exam day 2, problem 4
Let $ABC$ be an isosceles triangle ($AB=AC$) with incenter $I$. Circle $\omega$ passes through $C$ and $I$ and is tangent to $AI$. $\omega$ intersects $AC$ and circumcircle of $ABC$ at $Q$ and $D$, respectively. Let $M$ be the midpoint of $AB$ and $N$ be the midpoint of $CQ$. Prove that $AD$, $MN$ and $BC$ are concurrent.

Proposed by Alireza Dadgarnia
29 replies
Dadgarnia
Mar 12, 2020
blueprimes
8 minutes ago
Good Numbers
ilovemath04   30
N 22 minutes ago by ihategeo_1969
Source: ISL 2019 N5
Let $a$ be a positive integer. We say that a positive integer $b$ is $a$-good if $\tbinom{an}{b}-1$ is divisible by $an+1$ for all positive integers $n$ with $an \geq b$. Suppose $b$ is a positive integer such that $b$ is $a$-good, but $b+2$ is not $a$-good. Prove that $b+1$ is prime.
30 replies
ilovemath04
Sep 22, 2020
ihategeo_1969
22 minutes ago
Sequences problem
BBNoDollar   1
N 42 minutes ago by BBNoDollar
Source: Mathematical Gazette Contest
Determine the general term of the sequence of non-zero natural numbers (a_n)n≥1, with the property that gcd(a_m, a_n, a_p) = gcd(m^2 ,n^2 ,p^2), for any distinct non-zero natural numbers m, n, p.

⁡Note that gcd(a,b,c) denotes the greatest common divisor of the natural numbers a,b,c .
1 reply
BBNoDollar
6 hours ago
BBNoDollar
42 minutes ago
s(I)=2019
math90   8
N 3 hours ago by MathSaiyan
Source: IMC 2019 Day 2 P8
Let $x_1,\ldots,x_n$ be real numbers. For any set $I\subset\{1,2,…,n\}$ let $s(I)=\sum_{i\in I}x_i$. Assume that the function $I\to s(I)$ takes on at least $1.8^n$ values where $I$ runs over all $2^n$ subsets of $\{1,2,…,n\}$. Prove that the number of sets $I\subset \{1,2,…,n\}$ for which $s(I)=2019$ does not exceed $1.7^n$.

Proposed by Fedor Part and Fedor Petrov, St. Petersburg State University
8 replies
math90
Jul 31, 2019
MathSaiyan
3 hours ago
Cauchy's functional equation with f({max{x,y})=max{f(x),f(y)}
tom-nowy   1
N 5 hours ago by Filipjack
Source: https://x.com/D_atWork/status/1788496152855560470, Problem 4
Determine all functions $f: \mathbb{R} \to \mathbb{R}$ satisfying the following two conditions for all $x,y \in \mathbb{R}$:
\[ f(x+y)=f(x)+f(y), \;\;\; f \left( \max \{x, y \} \right) = \max \left\{ f(x),f(y) \right\}. \]
1 reply
tom-nowy
Today at 2:23 PM
Filipjack
5 hours ago
A problem in point set topology
tobylong   1
N Today at 4:59 PM by alexheinis
Source: Basic Topology, Armstrong
Let $f:X\to Y$ be a closed map with the property that the inverse image of each point in $Y$ is a compact subset of $X$. Prove that $f^{-1}(K)$ is compact whenever $K$ is compact in $Y$.
1 reply
1 viewing
tobylong
Today at 3:14 AM
alexheinis
Today at 4:59 PM
D1026 : An equivalent
Dattier   0
Today at 1:39 PM
Source: les dattes à Dattier
Let $u_0=1$ and $\forall n \in \mathbb N, u_{2n+1}=\ln(1+u_{2n}), u_{2n+2}=\sin(u_{2n+1})$.

Find an equivalent of $u_n$.
0 replies
Dattier
Today at 1:39 PM
0 replies
Summation
Saucepan_man02   2
N Today at 12:57 PM by Etkan
If $P = \sum_{r=1}^{50} \sum_{k=1}^{r} (-1)^{r-1} \frac{\binom{50}{r}}{k}$, then find the value of $P$.

Ans
2 replies
Saucepan_man02
Today at 9:40 AM
Etkan
Today at 12:57 PM
sequences, n-sum of type 1/2
jasperE3   1
N Today at 11:38 AM by pi_quadrat_sechstel
Source: Putnam 1991 A6
An $n$-sum of type $1$ is a finite sequence of positive integers $a_1,a_2,\ldots,a_r$, such that:
$(1)$ $a_1+a_2+\ldots+a_r=n$;
$(2)$ $a_1>a_2+a_3,a_2>a_3+a_4,\ldots, a_{r-2}>a_{r-1}+a_r$, and $a_{r-1}>a_r$. For example, there are five $7$-sums of type $1$, namely: $7$; $6,1$; $5,2$; $4,3$; $4,2,1$. An $n$-sum of type $2$ is a finite sequence of positive integers $b_1,b_2,\ldots,b_s$ such that:
$(1)$ $b_1+b_2+\ldots+b_s=n$;
$(2)$ $b_1\ge b_2\ge\ldots\ge b_s$;
$(3)$ each $b_i$ is in the sequence $1,2,4,\ldots,g_j,\ldots$ defined by $g_1=1$, $g_2=2$, $g_j=g_{j-1}+g_{j-2}+1$; and
$(4)$ if $b_1=g_k$, then $1,2,4,\ldots,g_k$ is a subsequence. For example, there are five $7$-sums of type $2$, namely: $4,2,1$; $2,2,2,1$; $2,2,1,1,1$; $2,1,1,1,1,1$; $1,1,1,1,1,1,1$. Prove that for $n\ge1$ the number of type $1$ and type $2$ $n$-sums is the same.
1 reply
jasperE3
Aug 20, 2021
pi_quadrat_sechstel
Today at 11:38 AM
Equation of Matrices which have same rank
PureRun89   3
N Today at 8:51 AM by pi_quadrat_sechstel
Source: Gazeta Mathematica

Let $A,B \in \mathbb{C}_{n \times n}$ and $rank(A)=rank(B)$.
Given that there exists positive integer $k$ such that
$$A^{k+1} B^k=A.$$Prove that
$$B^{k+1} A^k=B.$$
(Note: The submition of the problem is end so I post this)
3 replies
PureRun89
May 18, 2023
pi_quadrat_sechstel
Today at 8:51 AM
D1023 : MVT 2.0
Dattier   1
N Today at 7:55 AM by Dattier
Source: les dattes à Dattier
Let $f \in C(\mathbb R)$ derivable on $\mathbb R$ with $$\forall x \in \mathbb R,\forall h \geq 0, f(x)-3f(x+h)+3f(x+2h)-f(x+3h) \geq 0$$
Is it true that $$\forall (a,b) \in\mathbb R^2, |f(a)-f(b)|\leq \max\left(\left|f'\left(\dfrac{a+b} 2\right)\right|,\dfrac {|f'(a)+f'(b)|}{2}\right)\times |a-b|$$
1 reply
Dattier
Apr 29, 2025
Dattier
Today at 7:55 AM
Find all continuous functions
bakkune   2
N Today at 7:22 AM by bakkune
Source: Own
Find all continuous function $f, g\colon\mathbb{R}\to\mathbb{R}$ satisfied
$$
(x - k)f(x) = \int_k^x g(y)\mathrm{d}y 
$$for all $x\in\mathbb{R}$ and all $k\in\mathbb{Z}$.
2 replies
bakkune
Today at 6:02 AM
bakkune
Today at 7:22 AM
ISI 2019 : Problem #2
integrated_JRC   40
N Today at 6:56 AM by Sammy27
Source: I.S.I. 2019
Let $f:(0,\infty)\to\mathbb{R}$ be defined by $$f(x)=\lim_{n\to\infty}\cos^n\bigg(\frac{1}{n^x}\bigg)$$(a) Show that $f$ has exactly one point of discontinuity.
(b) Evaluate $f$ at its point of discontinuity.
40 replies
integrated_JRC
May 5, 2019
Sammy27
Today at 6:56 AM
Perfect Square Function
Miku3D   16
N Apr 18, 2025 by MathLuis
Source: 2021 APMO P5
Determine all Functions $f:\mathbb{Z} \to \mathbb{Z}$ such that $f(f(a)-b)+bf(2a)$ is a perfect square for all integers $a$ and $b$.
16 replies
Miku3D
Jun 9, 2021
MathLuis
Apr 18, 2025
Perfect Square Function
G H J
G H BBookmark kLocked kLocked NReply
Source: 2021 APMO P5
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
Miku3D
57 posts
#1 • 3 Y
Y by centslordm, oVlad, megarnie
Determine all Functions $f:\mathbb{Z} \to \mathbb{Z}$ such that $f(f(a)-b)+bf(2a)$ is a perfect square for all integers $a$ and $b$.
This post has been edited 1 time. Last edited by Miku3D, Jun 9, 2021, 6:34 AM
Reason: Typo
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
gghx
1072 posts
#2 • 4 Y
Y by centslordm, tck_darkness, ZHEKSHEN, luutrongphuc
Let $P(a,b): f(f(a)-b)+bf(2a)$ is a perfect square.
Lemma: $f(0)=0$, $f(a)$ is a perfect square

Let $f(0)=c$
$P(0,f(0)):c^2+c=k^2$ for some $k$ so $(2c+1)^2=(2k)^2+1$.
The only time two perfect squares can be consecutive is $0,1$ so $k=0$ and thus $c=0/-1$

If $f(0)=-1$,
$P(0,-1-b): f(b)+b+1$ is a perfect square, $P(a,0): f(f(a))$ is a perfect square.
Thus, $f(f(a))+f(a)+1$ is a perfect square.
If $f(a)$ is $1\pmod{4}$, then $f(f(a))+f(a)+1\equiv 2/3 \pmod{4}$, so it cannot be a perfect square.
Thus $f(a)$ is not $1 \pmod{4}$

Now $P(0,0): f(-1)$ is a perfect square hence it is $0\pmod{4}$.
But $P(-1,f(-1)): f(-1)f(-2)-1$ is a perfect square but it is $3$ mod 4, contradiction.

This proves that $f(0)=0$.
Now $P(0,-a): f(a)$ is a perfect square.
Case 1: $f$ has a positive zero.
Suppose $f(c)=0, c>0$.
Then $P(a,f(a)-c): (f(a)-c)f(2a)=0$.
Taking $a=c$, since $f(c)-c=-c<0$, $f(2c)=0$.
Similarly, $f(4c),f(8c),...$ are all $0$.

Now $P(a,f(a)-2^kc): (f(a)-2^kc)f(2a)=0$. Since $f(a)-2^kc$ is negative for large enough $k$, we must have $f(2a)=0$ for all $a$. This gives the solution $f(2x)=0$, $f(2x+1)=g(x)^2$ for any function $g:\mathbb{Z}\rightarrow \mathbb{Z}$.
Case 2: $f(a)>0$ for any $a>0$
$P(a,f(a)-2a): (f(a)-2a+1)f(2a)$ is a perfect square. Hence for positive $a$, $f(a)-2a+1$ is a perfect square.
Take $k=\frac{p+1}{2}$ where $p$ is prime, since $f(k)$ and $f(k)-p$ are both perfect squares, $f(k)=k^2$. So $f(a)=a^2$ for infinitely many $a$.

Also, this means $f(a)\le a^2$ for positive $a$, as bigger than that, the difference of squares would be more than $2a-1$ so $f(a)-2a+1$ won't be a perfect square.

Take any $x,y$ such that $f(x)=x^2,f(y)=y^2$ and $x,y$ positive.
$P(x,x^2-y): y^2+(x^2-y)f(2x)=y^2-yf(2x)+x^2f(2x)$ is a perfect square. Fix $x$ and increase $y$ towards infinity, we have that $4(y^2-yf(2x)+x^2f(2x))=(2y-f(2x))^2-f(2x)^2+4x^2f(2x)$ which means $f(2x)=4x^2$.

Thus, taking any integer $a$, $P(x,x^2-a): f(a)+(x^2-a)(4x^2)$ is a perfect square, so $4x^4-4ax^2+f(a)=(2x^2-a)^2+f(a)-a^2$ is a perfect square. Taking $x$ to infinity, we have $f(a)=a^2$ for all integers $a$, the second solution.

1/3 done during the test, 1/3 done at home, 1/3 my senior told me
This post has been edited 1 time. Last edited by gghx, Jun 9, 2021, 6:46 AM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
TheUltimate123
1740 posts
#3 • 2 Y
Y by centslordm, HamstPan38825
Say \(f\) is even-vanishing if it sends all evens to zero, and let \(Q\) be the set of all \(q\) such that \(|q|=1\) or \(|q|\) is prime.

The answer is \(f(x)\equiv x^2\) or \(f\) is an even-vanishing function that sends odds to perfect squares. All such functions clearly work, so we show they are the only solutions. Let \(P(a,b)\) denote the assertion.
  • From \(P(0,f(0))\), we know \(f(0)+f(0)^2\) is a perfect square. If \(f(0)\ne0\), then we can bound this between \(f(0)^2\) and \((f(0)+1)^2\), so \(f(0)=0\).
  • Applying \(P(0,-x)\), we find that \(f(x)\) is a perfect square for all \(x\).
  • By \(P(x,f(x)-2x)\),we have \(f(2x)(f(x)-2x+1)\) is always a perfect square. In particular, for all \(x\), either \(f(2x)=0\) or \(f(x)-2x+1\) is a square. Call this property \((\star)\).

Claim 1: For \(q\in Q\), either \(f(q+1)=0\) or \(f(\frac{q+1}2)=(\frac{q+1}2)^2\).

Proof. By taking \(x=\frac{q+1}2\) in \((\star)\), we know that \(f(q+1)=0\) or \(f(\frac{q+1}2)-q\) is a square. In the latter case, take \(f(\frac{q+1}2)=u^2\) and \(f(\frac{q+1}2)-q=v^2\) for \(u,v\ge0\), so \(q=u^2-v^2=(u-v)(u+v)\). It follows that \(u+v=|q|\), and the conclusion readily follows. \(\blacksquare\)

Claim 2: If \(n\equiv1\pmod4\), if \(f(n+1)=0\), then \(f\) is even-vanishing.

Proof. Take \(P(f(a),f(a)-n-1)\) for arbitrary \(a\). Then \(f(2a)(f(a)-n-1)\) is a square, so either \(f(2a)=0\) or \(f(a)-n-1\) is a square. In the latter case, \(n+1\equiv2\pmod4\) is the difference between two squares, absurd. \(\blacksquare\)

Claim 3: If \(f(n)=0\) for any \(n\ne0\), then \(f\) is even-vanishing.

Proof. Take \(P(f(a),f(a)-n)\) for arbitrary \(a\). Then \(f(2a)(f(a)-n)\) is a square, so either \(f(2a)=0\) or \(f(a)-n-1\) is a square.

Assume for contradiction \(f\) is not even-vanishing, so we may choose a large prime \(q\equiv1\pmod4\) with \(f(q+1)\ne0\) by Claim 2, i.e.\ \(f(\frac{q+1}2)=(\frac{q+1}2)^2\) by Claim 1. Select \(a=\frac{q+1}2\), so \((\frac{q+1}2)^2-n\) is a square. For \(q\gg n\) this is absurd. \(\blacksquare\)

Assume \(f\) is not even-vanishing, so the goal is to show \(f(x)\equiv x^2\).

Claim 4: \(f(\frac{q+1}2)=(\frac{q+1}2)^2\) for all \(q\in Q\).

Proof. From Claim 3 above, we know \(f(n)\ne0\) for \(n\ne0\), and thus the desired result follows from Claim 1. \(\blacksquare\)

It is now easy to generalize via induction; first, we verify the following:

Claim 5: If \(f(n)=n^2\) then \(f(2n)=4n^2\).

Proof. There are infinitely many \(k\) with \(f(k)=k^2\) by Claim 4; for each \(k\), consider \(P(n,f(n)-k)\). Then \(k^2-f(2n)k+n^2f(2n)\) is a perfect square. Since this is a perfect square for infinitely many \(k\), it must itself be a perfect square trinomial in \(k\), so \(f(2n)^2=4n^2f(2n)\), i.e.\ \(f(2n)=4n^2\). \(\blacksquare\)

Now we proceed by induction to show \(f(n)=f(-n)=n^2\) for \(n\ge0\); base cases \(n=0,1,2,3\) readily follow from Claim 4. Let \(a=n-1\), and consider \(P(f(a),f(a)-n)\): we know \(f(n)+4a^2(a^2-n)\) is a square.

Recall from \((\star)\) that \(f(n)-2n+1\) is a square; hence \(0\le f(n)\le n^2\). Then it is easy to verify that \[\left(2a^2-n-1\right)^2<f(n)+4a^2(a^2-n)\le\left(2a^2-n\right)^2,\]so equality holds on the right and \(f(n)=n^2\).

Analogously, \(P(f(a),f(a)+n)\) will show \(f(-n)=n^2\), so the induction is complete.
This post has been edited 1 time. Last edited by TheUltimate123, Jun 9, 2021, 8:15 AM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
MarkBcc168
1595 posts
#4 • 2 Y
Y by centslordm, Mango247
All answers are the benign $f(x) = x^2$ and any $f$ that sends $\text{even}\mapsto 0$ and $\text{odd}\mapsto\text{perfect square}$, all of which clearly works. We divide the proof into multiple claims.
Claim: $f(0)=0$ and $f(x)$ is perfect square for any $x$

Proof: Plugging $a=0$ and $b=f(0)$ gives $f(0)^2+f(0)$ is a perfect square, which is enough to force that $f(0)=0,-1$. To rule out $-1$, we plug in $a=0$ to find out that $f(x)+x+1$ is a perfect square. Moreover, plugging in $b=0$ gives $f(f(x))$ is a perfect square. Thus, we have that
\begin{align*}
f(f(f(2))) + f(f(2)) + 1 &= \text{ perfect square} \\
f(f(2)) + f(2) + 1 &= \text{ perfect square} \\
f(2) + 3 &= \text{ perfect square} \\
\end{align*}Considering the first equation in mod $4$ forces $f(f(f(2))) \equiv f(f(2)) \equiv 0\pmod 4$. The second equation then gives $f(2)\equiv -1,0\pmod 4$, and lastly, the third equation gives the contradiction. Hence, $f(0)=0$.

Finally, plugging in $a=0$ gives the second assertion. $\blacksquare$

Now, we give the main step.

Claim: Either one of the following assertions must be true.
  • There exists an infinite sequence of positive integers $x_1<x_2<\hdots$ such that $f(2x_1) = f(2x_2) = \hdots = 0$.
  • There exists an infinite sequence of positive integers $x_1<x_2<\hdots$ such that $f(x_i) = x_i^2$ and $f(2x_i)\ne 0$ for all $i$.
Proof: The main idea of the proof hinges from the substitution $b=f(a)-2a$. This gives
$$f(2a) + (f(a)-2a)f(2a) = f(2a)(f(a)-2a+1) \text{ is a perfect square}.$$Therefore, for each $a$, either $f(2a)=0$ or $f(a)-2a+1$ is a perfect square. Motivated by this, we commit to select $a = \tfrac{p+1}{2}$ for an odd prime $p$. Thus, either $f(p+1)=0$ or $f\left(\tfrac{p+1}{2}\right) = p$ is a perfect square.

However, if the latter happens, then both $f\left(\tfrac{p+1}{2}\right)$ and $f\left(\tfrac{p+1}{2}\right)-p$ must be a perfect square, which forces (by difference of squares) $f\left(\tfrac{p+1}{2}\right) = \left(\tfrac{p+1}{2}\right)^2$. In conclusion, for any prime $p$, either $f(p+1)=0$ or $f\left(\tfrac{p+1}{2}\right) = \left(\tfrac{p+1}{2}\right)^2$, which is enough to imply the claim. $\blacksquare$
Of course, we do both cases separately. The following claim finishes the first case.

Claim: Suppose the first assertion: there exists an infinite sequence of positive integers $x_1<x_2<\hdots$ such that $f(2x_1) = f(2x_2) = \hdots = 0$. Then, $f(\text{even}) = 0$.

Proof: We plug in $b = f(a)-2x_i$ to get that $(f(a)-2x_i)f(2a)$ is a perfect square. However, if $2x_i > f(a)$, then it forces $f(2a)=0$ for sign reason. $\blacksquare$
Now, assume the second case: there exists an infinite sequence of positive integers $x_1<x_2<\hdots$ such that $f(x_i) = x_i^2$ and $f(2x_i)\ne 0$ for all $i$ . We need the following well-known lemma.

Lemma: Suppose that $a,b$ are integers such that $a^2\ne 4b$. Then, there are finitely many $x$ such that $x^2+ax+b$ is perfect square.

Proof: Just complete the square. I don't bother writing the details. $\blacksquare$

To finish, we prove the following two claims.

Claim: For any $i$, $f(2x_i) = 4x_i^2$.

Proof: Vary $j$ through all positive integers and plug in $a=x_i$ and $b=x_i^2-x_j$ to obtain that
$$f(x_j) + (x_i^2-x_j)f(2x_i) = x_j^2 - x_jf(2x_i) + x_i^2f(2x_i) \text{ is a perfect square},$$so by the lemma, $f(2x_i)^2 = 4x_i^2f(2x_i)\implies f(2x_i) = 4x_i^2$ (reminder: $f(2x_i)\ne 0$). $\blacksquare$

Claim: $f(k)=k^2$ for any $k$

Proof: Vary $i$ through all positive integers and plug in $a = x_i$ and $b = x_i^2-k$ to obtain that
$$f(k) + 4x_i^2(x_i^2-k) = (2x_i^2)^2 + (2x_i^2)\cdot 2k + f(k) \text{ is perfect square},$$so by the lemma once again, we get that $(2k)^2 = 4f(k)\implies f(k)=k^2$. $\blacksquare$
This post has been edited 1 time. Last edited by MarkBcc168, Jun 9, 2021, 12:52 PM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
Mr.C
539 posts
#5 • 2 Y
Y by centslordm, Wizard0001
My solution at the exam :

Let
$$P(a,b)^2=f(b)+f(a)f(2a)-bf(2a)$$from $P(0,0)^2$ we have $f(0) \in \{0,-1\}$.
Assume $f(0)=0$. now if $a>0,f(a)=0$ we have from $P(a,a)^2$ that $-af(2a)$ is a perfect square.
Also from $P(0,2a)^2$ we have $f(2a)$ is a perfect square aswell.
Hence $f(2a)=0$. now from $P(x,2^n a)^2$ we have $f(x)f(2x)-2^naf(2x)$ is a perfect square. hence $f(2x)=0$ for all integers $x$.
now the condition goes : $P(a,b)^2=f(b)$ hence $f(2k+1)=g(k)^2,f(2k)=0$ works for every arbitrary function $g$.
Now if $f(a)$ is non zero for positive $a$ we have :
$$P(a,2a)^2=f(2a)(1+f(a)-2a)$$$$P(0,2a)^2=f(2a)>0$$hence $T(a)^2=1+f(a)-2a$ also let $f(a)=g(a)^2$ clearly $(g(a)-1)^2 \ge f(a)-2a+1$ hence $a \ge g(a)$. which gives $f(1)=1$.
Now from $P(a,1)=1+f(a)f(2a)-f(2a)$ is a perfect square. if $f(2a)=1$ then $f(2a)-4a+1 <-1$ so it is not a perfect square. hence :
$$(g(a)g(2a)-1)^2 \ge f(a)f(2a)-f(2a)+1$$hence :
$$f(2a) \ge 4f(a)$$which gives clearly :
$$f(2^n) \ge 4^n$$but we also had $g(a) \le a$ so $f(2^n)=4^n$. now from $P(2^n,b)^2=f(b)+(2^{2n+1})^2-2b.2^{2n+1}$ so we have :
$$P(2^n,b)^2+b^2=f(b)+(2^{2n+1} -b)^2$$so $f(b)-b^2$ is the difference of infinitely many perfect squares hence it is $0$. so $f(x)=x^2$ is also a solution.
Now if $f(0)=-1$ we have :
$$P(a,0)^2=f(a)f(2a)-1$$hence if $q$ is a positive devisor of $f(a)$ for some $a$, then $q=4k+2$ or $q=4k+1$.
Now from $P(0,a)^2=f(b)+b+1$ now $f(4k)+1+4k$ is a perfect square. so $f(4k) \in \{4a,4a-1\}$ which is imposible if $f(4k)>0$ so $f(4k)$ should be negative.
Now we prove $f(2a) \le 0$ which is trivial since $f(4a)f(2a)-1$ is perfect square hence non negative. assume $f(2a)=0$ then we have $f(b)$ is a perfect square itself so $f(4k)=0$ hence $f(0)=0$ and it is a contradiction. so $f(2a)<0$ now since
$f(2a)f(a)-1$ is a perfect square we get that for all integers $n$ we have $f(n) \le 0$ now we have $f(1)+2$ is a perfect square.
So $f(1) \in \{-1,-2\}$ if $f(1)=-2$ we have $-2f(2)-1$ is a perfect square. also $f(2)+3$ is a perfect square aswell. which is impossible .
Hence $f(1)=-1$ and it also gives $f(2)=-2$ . now from $P(1,1)^2=-1+4$ is a perfect square which is a contradiction.
so in this case we have no solutions.
This post has been edited 1 time. Last edited by Mr.C, Jun 9, 2021, 11:50 AM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
Orestis_Lignos
558 posts
#6 • 2 Y
Y by centslordm, SerdarBozdag
Let $P(x,y)$ be the assertion that $f(f(x)-y)+yf(2x)$ is a perfect square for all $x,y \in \mathbb{Z}$.

Then, we proceed with some Claims.

Claim 1: $f(0)=0$.
Proof: Considering $P(0,f(0))$ we obtain that $f^2(0)+f(0)$ is a perfect square, hence $f(0) \in \{-1,0 \}$.

Suppose FTSOC that $f(0)=-1$. Then, $P(0,-x-1)$ implies $f(x)+x+1$ is a perfect square. In addition, by $P(x,f(x)$ we obtain that $f(x)f(2x)-1$ is also a perfect square.

Now, take a $x \equiv 0 \pmod 4$. Then, $f(x)+x+1 \equiv f(x)+1 \pmod 4$, therefore $f(x) \equiv 0 \, \, \rm or \, \,  3 \pmod 4$.

If $f(x) \equiv 0 \pmod 4$, then $f(x)f(2x)-1 \equiv 3 \pmod 4$, which can never be a perfect square.
If $f(x) \equiv 3 \pmod 4$, then if $f(x)f(2x)-1=m^2$, we obtain that $f(x) \mid (m^2+1)$, hence if $p \equiv 3 \pmod 4$ is a prime dividing $f(x)$, we obtain $p \mid (m^2+1)$. By Fermat's Christmas Theorem, this gives $p \mid 1$, a contradiction $\blacksquare$

Claim 2: $f(x)$ is a perfect square for all $x$.
Proof: Consider $P(0,-x)$ $\blacksquare$

Now, we may let $f(x)=g^2(x)$, with $g: \mathbb{Z} \rightarrow \mathbb{N}$ i.e., $g$ takes only nonnegative values.

$P(x,y)$ rewrites as $g^2(g^2(x)-y)+yg^2(2x)$ is a perfect square. Taking $y \rightarrow g^2(x)-y$ and then swapping $x$ and $y$ we obtain that $g^2(x)+(g^2(y)-x)g^2(2x)$ is a perfect square, for all $x,y \in \mathbb{Z}$. Let this be $Q(x,y)$.

We distinguish two cases.

Case 1: There exists a $k \neq 0$ such that $g(k)=0$. Then, we make the following Claim:

Claim 3: $g(2k)=0$.
Proof: Suppose not. Then, $g(2k) \neq 0$. If there exists an $\ell >0$ such that $g(\ell)=0$, then $Q(\ell,k)$ implies $-\ell g^2(2k)$ is a perfect square. Since $g(2k) \neq 0$ and $\ell>0$, this expression is $<0$, a contradiction.

Therefore, $g(x) >0$, for all $x>0$.

Now, take a $x>0$ and consider $Q(k,x)$. This gives that $(g^2(x)-k)g^2(2x)$ is a perfect square. Since $g(2x)>0$ from the above discussion, we obtain that $g^2(x)-k$ is also a perfect square, which implies that $g(x)$ takes finitely many values for all $x>0$ (specifically, $g(x)$ is of the form $\dfrac{d_i+d_j}{2}$ where $d_i,d_j$ are divisors of $k$ such that $d_id_j=k$).

Let the maximum value of $g(x)$ for $x>0$ be $S$. Then, fixing $y$ and taking a pretty large $x$, we obtain that $$g^2(x)+(g^2(y)-x)g^2(2y) \leq S^2+g^2(y)g^2(2y)-xg^2(2y)<0,$$a contradiction.

Hence, the Claim is proved $\blacksquare$

To the problem, the Claim implies that $g(k)=0 \Rightarrow g(2k)=0 \Rightarrow g(4k)=0 \Rightarrow \ldots g(2^tk)=0$, for all $t>0$.

Hence, $Q(2^tk,x)$ implies that $(g^2(x)-2^tk)g(2x)$ is a perfect square.

If, for some $x$, $g(2x) \neq 0$, then $g^2(x)>2^tk$ for all $t$, which is an immediate contradiction.

Therefore, $g(2x)=0$ for all $x \in \mathbb{Z}$. It is trivial to verify now that any function of the form $
g(x) =
\begin{cases}
0 &  \text{if} \,\, x \,\, \text{is even} \\
\text{anything} & \text{if} \,\, x  \,\, \text{is odd}
\end{cases}
$ satisfies.

Equivalently, we obtain that $
f(x) =
\begin{cases}
0 &  \text{if} \,\, x \,\, \text{is even} \\
\text{any perfect square} & \text{if} \,\, x  \,\, \text{is odd}
\end{cases}
$ is a solution to the problem.

Case 2: $g(x)=0$ only if $x=0$. Then $g(x) >0$ when $x \neq 0$. Considering $Q(2x,x)$ when $x \neq 0$, we obtain that $(g^2(x)-2x+1)g^2(2x)$ is a perfect square, hence $g^2(x)-2x+1$ is also a perfect square $(*)$.

Now, we prove a series of Claims.

Claim 4: $g(\dfrac{p+1}{2})=\dfrac{p+1}{2}$ for all odd primes $p$.
Proof: Taking $x=\dfrac{p+1}{2}$ in $(*)$ we obtain that $g^2(\dfrac{p+1}{2})-p=a^2$, hence $$(g(\dfrac{p+1}{2})-a)(g(\dfrac{p+1}{2})+a)=p,$$implying that $$g(\dfrac{p+1}{2})-a=1, \,\, g(\dfrac{p+1}{2})+a=p,$$which readily gives the desired $\blacksquare$

Claim 5: $g(2x)$ is even for all $x$.
Proof: By $(*)$, $g^2(2x)-4x+1$ is a perfect square. If $g(2x)$ is odd, then $g^2(2x)-4x+1 \equiv 2 \pmod 4$, a contradiction $\blacksquare$

Claim 6: $g(2x)=2g(x)$.
Proof: Fix a $x$ and let $g(x)=M$ and $g(2x)=N$. Then, by considering $Q(\dfrac{p+1}{2},x)$, we obtain that $$M^2N^2-\dfrac{p+1}{2}N^2+(\dfrac{p+1}{2})^2$$is a perfect square for all odd primes $p$.

The latter rewrites as $$(\dfrac{N^2}{2}-\dfrac{p+1}{2})^2+M^2N^2-\dfrac{N^4}{4},$$where the expressions in the brackets and the one outside of them are integers due to Claim 5.

If $M^2N^2-\dfrac{N^4}{4} \neq 0$, then by letting $p \rightarrow +\infty$ we obtain a clear contradiction, since then $\dfrac{N^2}{2}-\dfrac{p+1}{2}$ should attain finitely many values, a contradiction.

Therefore, $M^2N^2-\dfrac{N^4}{4}=0$, which easily rearranges to $N=2M$, i.e. $g(2x)=2g(x)$, as desired $\blacksquare$

Claim 7: $g^2(x)=x^2$.
Proof: Using Claim 6, $Q(x,y)$ rewrites as $g^2(x)+4(g^2(y)-x)g^2(y)$ being a perfect square.

Taking in the latter $y=\dfrac{p+1}{2}$ and fixing $x$ and rearranging, we obtain that $$(\dfrac{p+1}{2}-x)^2+g^2(x)-x^2$$is a perfect square, which when $g^2(x)-x^2 \neq 0$ is a contradiction after taking $p \rightarrow +\infty$ $\blacksquare$

Therefore, we conclude that $g^2(x)=x^2$, i.e. $f(x)=x^2$ which is a solution.

To conclude, $f(x)=x^2$ and $
f(x) =
\begin{cases}
0 &  \text{if} \,\, x \,\, \text{is even} \\
\text{any perfect square} & \text{if} \,\, x  \,\, \text{is odd}
\end{cases}
$ are the only solutions to the problem.
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
hyay
181 posts
#7 • 2 Y
Y by centslordm, somebodyyouusedtoknow
The only such functions are $f(x) = x^2$ for all $x$ and $f(x) = \begin{cases} 0 & \text{if } 2 \mid x \\ g(x)^2 & \text{otherwise} \end{cases}$ for all $x$, where $g(x)$ is any function from the integers to itself.

Let $P(a, b) = f(f(a) - b) + bf(2a)$.

First of all, $P(0, 0) = f(0)(f(0) + 1)$ is a square. If $f(0) \neq 0, -1$, then both $|f(0)|$ and $|f(0) + 1|$ are squares since they are relatively prime, but this is only possible when $f(0) = 0/-1$, contradiction. If $f(0) = -1$, then $P(0, -x - 1) = f(x) + x + 1$ and $P(x, 0) = f(f(x))$ are both squares for all $x$. Recall that $n^2 \equiv 0/1 \pmod{4}$ for all $n$, so since $f(2) + 3$ is a square, then $f(2) \equiv 1/2 \pmod{4}$. Also, since $f(f(f(2))) + f(f(2)) + 1$ is a square and all of the terms are squares, then we must have $f(f(f(2))) \equiv f(f(2)) \equiv 0 \pmod{4}$. But then $f(f(2)) + f(2) + 1 \equiv 2/3 \pmod{4}$ is a square, contradiction. So, $f(0) = 0$.

Then, $P(0, -x) = f(x)$ is a square for all $x$. Furthermore, $P(x, f(x) - 2x) = f(2x)(f(x) - 2x + 1)$, so either $f(2x) = 0$ or $f(x) - 2x + 1$ is a square.

Case 1. $f(2x) = 0$ for infinitely many positive integers $x$.

We claim that $f(2x) = 0$ for all $x$. Assume that there exists $t$ such that $f(2t) \neq 0$. For all $k$ with $f(2k) = 0$, $P(t, f(t) - 2k) = (f(t) - 2k)f(2t)$ is a square. However by taking $k$ sufficiently large the value becomes negative (recall that $f(2t)$ is a square), contradiction. Hence, $f(x) = 0$ for all even $x$, while $f(x)$ is a square for all $x$. This is exactly the second solution.

Case 2. There exists $N$ such that $f(x) - 2x + 1$ is a square for all $x \geq N$

Suppose $x \geq N$ and $2x - 1$ is a prime, then let $f(x) = a^2$ and $f(x) - 2x + 1 = b^2$ where $a, b \geq 0$. Then $2x - 1 = (a + b)(a - b)$, which implies $a + b = 2x - 1$ and $a - b = 1$, thus $a = x$ and $f(x) = x^2$. This implies there exists infinitely many $x \geq 0$ such that $f(x) = x^2$.

Then, for all $a$ and $x \geq 0$ with $f(x) = x^2$, $P(a, f(a) - x) = x^2 - xf(2a) + f(a)f(2a)$ is a square. If $f(2a) = 2k + 1$ for some $k \in \mathbb{Z}$, then notice that $(x - k - 1)^2 < P(a, f(a) - x) < (x - k)^2$ for all $x$ sufficiently large, contradiction. So, $f(2a) = 2k$ and $(x - k - 1)^2 < P(a, f(a) - x) < (x - k + 1)^2$ for all large $x$, which means $x^2 - xf(2a) + f(a)f(2a) = (x - f(2a)/2)^2$ for all large $x$. Comparing coefficients, we get $f(2a) = 4f(a)$.

Now, for all $a$ with $f(a) = a^2$, $P(a, f(a) - x) = f(x) - 4a^2x + 4a^4$ is a square. Then for all $a$ sufficiently large, we have $(2a^2 - x - 1)^2 < P(a, f(a) - x) < (2a^2 - x + 1)^2$, so $P(a, f(a) - x) = (2a^2 - x)^2$ for all large $a$, and thus $f(x) = x^2$ for all $x$.

Done.
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
Supercali
1261 posts
#8 • 3 Y
Y by centslordm, PRMOisTheHardestExam, Mango247
Kinda annoying problem ngl.

By substituting $x=f(a)-b$, rewrite the original condition as $$f(x)-xf(2a)+f(a)f(2a) \text{ is a perfect square}$$Let $P(x,a)$ denote the above. Also we will use "PS" for perfect square.

Claim 1: $f(0)=0$
Proof: $P(0,0)$ $\implies$ $f(0)(f(0)+1)$ is a PS $\implies$ $f(0) =0$ or $-1$. Assume FTSOC that $f(0)=-1$. Then $P(-4,0)$ $\implies$ $f(-4)-3$ is a PS; in particular, $f(-4)>0$. Taking this modulo $4$, we get $f(-4) \equiv 3 \text{ or } 0 \pmod 4$. Now $P(0,-4)$ gives $f(-4)f(-8) =k^2+1$ for some $k \in \mathbb{Z}$. It is well known that all positive factors of a number of the form $k^2+1$ are congruent to $1$ or $2$ modulo $4$, which contradicts the previous congruence. So $f(0)=0$. $\blacksquare$

Claim 2: $f(x)$ is a PS for all integers $x$.
Proof: $P(x,0)$. $\blacksquare$

Let $y=\frac{p+1}{2}$ for any odd prime $p$. Then $P(2y,y)$ gives $f(2y)(f(y)-p)$ is a PS. This means either $f(2y)=0$, or $f(y)-p$ is a PS. But it is easy to see that $p$ can be written in a unique way as a difference of two squares - $\left ( \frac{p+1}{2} \right)^2-\left ( \frac{p-1}{2} \right)^2$, so we must have $$f(y)=\left ( \frac{p+1}{2} \right)^2=y^2$$in this case. Using the deep, highly non-trivial, and recently discovered result known as "the infinitude of primes", we can say that either $f(2y)=0$, or $f(2y) \neq 0$ and $f(y)=y^2$ for infinitely many positive integers $y$.


Case I: $f(2y)=0$ for infinitely many $y>0$

Fix any arbitrary integer $a$, and choose a $y>f(a)+200000$ satisfying $f(2y)=0$. Then $P(2y,a)$ gives $f(2a)(f(a)-2y)$ is a PS. Since $f(a)-2y<0$, this can only be true if $f(2a)=0$. Thus $f$ is $0$ on even numbers, and using Claim 2, we get the following solution: $$\boxed{f(x) = \left( \frac{1-(-1)^x}{2} \right ) g(x)^2 \ \ \forall x \in \mathbb{Z} }$$for any arbitrary $g: \mathbb{Z} \rightarrow \mathbb{Z}$.


Case II $f(2y) \neq 0$ and $f(y)=y^2$ for infinitely many $y>0$

Call all such $y$ good.

Claim 3: $f(2y)=4y^2$ for all good $y$.
Proof: Fix any arbitrary good $y$, and let $q(t)$ be the polynomial $t^2-tf(2y)+y^2f(2y)$. There exists a positive integer $M$ satisfying $(t-M)^2<q(t)<(t+M)^2$ for all $t>0$ (for instance, you can take $M=(y^2f(2y))^{1000}+1000+y^{999}+99f(2y)^9$). If $t$ is good, then by $P(t,y)$, $q(t)$ is a PS $\implies$ $q(t)=(t+n)^2$ for some integer $n \in [-M,M]$. But since there are infinitely many good $t$, by another deep result known as "pigeonhole principle", there exists an integer $k \in [-M,M]$ such that $q(t)=(t+k)^2$ for infinitely many good $t$. Since this is a polynomial equation with infinitely many roots, we can compare coefficients to get $f(2y)^2=4y^2f(2y)$ $\implies$ $f(2y)=4y^2$ since $f(2y) \neq 0$. $\blacksquare$

Now, let $x \in \mathbb{Z}$ be arbitrary. Then for any good $y$, $P(x,y)$ gives $$f(x)-4xy^2+4y^4=f(x)-x^2+(2y^2-x)^2 \text{  is a PS}$$Assume $f(x)-x^2 = m \neq 0$ for some $x$. Take a large good $y$, then there must be some PS at a distance of $m$ from $(2y^2-x)^2$. Since the nearest perfect square to $(2y^2-x)^2$ is $2(2y^2-x)-1$ away, we must have $m \geq 2(2y^2-x)-1$, which clearly cannot hold for sufficiently large $y$, contradiction! Therefore we get the solution $$\boxed{f(x)=x^2 \ \ \forall x \in \mathbb{Z}}$$$\blacksquare$
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
MathForesterCycle1
79 posts
#9 • 1 Y
Y by centslordm
dame dame
This post has been edited 5 times. Last edited by MathForesterCycle1, Oct 17, 2021, 5:06 PM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
jasperE3
11288 posts
#11
Y by
Let $\mathbb S=\{x^2\mid x\in\mathbb Z\}$, and let $P(a,b)$ be the assertion $f(f(a)-b)+bf(2a)\in\mathbb S$.
$P(0,f(0))\Rightarrow f(0)+f(0)^2=k_1^2$
If $f(0)\ge1$ then $f(0)^2<k_1^2<(f(0)+1)^2$, contradiction. Similarly, if $f(0)\le-2$ then $(f(0)+1)^2<k_1^2<f(0)^2$, another contradiction, so this leaves $f(0)\in\{-1,0\}$.

$\textbf{Case 1: }f(0)=-1$
$P(0,-1-f(x))\Rightarrow f(f(x))+f(x)+1\in\mathbb S$, so $f(x)+1$ is a difference of squares since $P(x,0)\Rightarrow f(f(x))\in\mathbb S$. Since squares are always either $0$ or $1\pmod4$, we have that $f(x)+1\not\equiv2\pmod4$, so $f(x)\not\equiv1\pmod4$. Note that if $f(x)\in\mathbb S$ now, we must have $f(x)\equiv0\pmod4$. An example is $P(0,0)\Rightarrow f(-1)\equiv0\pmod4$. However, then we have $P(-1,f(-1))\Rightarrow f(-1)f(-2)-1=k_2^2$, so taking this equation$\pmod4$ gives us $k_2^2\equiv3$, absurd.

$\textbf{Case 2: }f(0)=0$
$P(0,-x)\Rightarrow f(x)\in\mathbb S\Rightarrow f(x)\ge0$

$\textbf{Case 2.1: }\exists k>0:f(k)=0$
$P(k,-2k)\Rightarrow(1-2k)f(2k)\ge0$, so $f(2k)\le0$, hence $f(2k)=0$ with $2k>0$. Simple induction gives $f(2^nk)=0$ for all $n\in\mathbb N$.
$P(x,f(x)-2^nk)\Rightarrow f(2x)(f(x)-2^nk)\ge0$, but since $f(2x)\ge0$ and $f(x)-2^nk$ is negative for sufficiently large $n$, we must have $f(2x)=0$. Combined with the fact that $f$ is always square, we have the solution $\boxed{f(x)=\left(\frac{1-(-1)^x}2\right)h(x)}$, where $h$ is any function from $2\mathbb Z+1\to\mathbb S$, which works since $P(a,b)$ reduces to $f(f(a)-b)\in\mathbb S$, which is true since $f$ is always a square.

$\textbf{Case 2.2: }f(x)>0\forall x>0$
$P(x,f(x)-2x)\Rightarrow f(2x)(f(x)-2x+1)\in\mathbb S$
Choose $x=\frac{p+1}2$ for an odd prime $p$, then $f(p+1)(f(x)-p)\in\mathbb S$, and since $f(p+1)$ is square, either $f(p+1)=0$ or $f(x)-p$ is a square. The latter must be true in this case. Since $f(x)$ and $f(x)-p$ are both square, we get $p=m^2-n^2$ for $m,n$ such that $f(x)=m^2$ and $f(x)-p=n^2$. Then, since $p$ is prime, we require $m=n+1$, so $f(x)=n^2+2n+1=n^2+p$, so $p=2n+1=2x-1$, hence $x=n+1=m$. Then $f(x)=m^2=x^2$.
To summarize, $\exists g:\mathbb N\to\mathbb N$ strictly increasing such that $f(g(n))=g(n)^2$ for all $n\in\mathbb N$ (where $g(n)=\frac{p+1}2$ and $p$ is the $n$th odd prime).

Now $P(x,f(x)-2x)\Rightarrow f(x)-2x+1\in\mathbb S\Rightarrow f(x)\le x^2$
$P(g(x),g(x)^2-g(y))\Rightarrow g(y)^2-g(y)f(2g(x))+g(x)^2f(2g(x))\in\mathbb S$, setting $y$ such that $g(y)$ is sufficiently large gives that $f(2x)=4x^2$.
Then $P(x,y)$ becomes $Q(x,y):f(f(x)-y)+4x^2y$.
$Q(x,f(x)-y)\Rightarrow f(y)+4x^2f(x)-4x^2y\in\mathbb S$, setting $x=g(n)$ large enough gives us that $(2g(n)^2-y)^2+f(y)-y^2\in\mathbb S$, so $\boxed{f(x)=x^2}$, which also works since $f(f(a)-b)+bf(2a)=(a^2+b)^2\in\mathbb S$.
This post has been edited 4 times. Last edited by jasperE3, Apr 18, 2025, 6:59 AM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
ZETA_in_olympiad
2211 posts
#12 • 2 Y
Y by Mango247, Mango247
Let $P(a,b)$ denote the given assertion and let $\mathcal{T}=\{t^2: t\in \mathbb{Z}\},$ i.e \ the set of squares.

$P(0,f(0))$ gives $f(0)+f(0)^2\in \mathcal{T}.$ So $f(0)=0$ or $f(0)=-1.$ Assume the latter, $P(0,a)$ gives $f(a)+a+1 \in \mathcal{T}.$ And $P(a,0)$ gives $f(f(x))\in \mathcal{T}.$ But comparing $P(0,2)$ then $P(0,f(f(2)))$ then $P(0,f(2))$ gives $f(2)\equiv 1\pmod{4}$ and $f(2)\equiv -1$ or $0 \pmod{4},$ absurd. So $f(0)=0.$ And $P(0,-a)$ gives $f(a)\in \mathcal{T}.$

Incomplete...
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
ZETA_in_olympiad
2211 posts
#13
Y by
Completing...

A. $f(x)=0$ for some $x>0:$ Fix some arbitrary $u$ and let $f(v)=0.$ $P(u,f(u)-v)$ gives $f(2u)(f(u)-v)\in \mathcal{T}.$ Taking large $v$ forces $f(2u)=0.$ So $f(x_{2\mid x})=0$ and $f(x_{2\nmid x})\in \mathcal{T}$ which works.

B. $f(x)> 0~~\forall x>0:$ Then let $p$ be a prime. $P(\frac{p+1}{2}, f(\frac{p+1}{2})-p+1)$ yields $(f(\frac{p+1}{2})-p)(f(p+1))\in \mathcal{T}.$ Taking $p\to \infty$ gives $f(p+1)\in \mathcal{T}.$ It follows that $f(\frac{p+1}{2})-p \in \mathcal{T}$ and $f(\frac{p+1}{2})\in \mathcal{T}.$ Let $f(\frac{p+1}{2})=a^2$ and $f(\frac{p+1}{2})-p=b^2.$ Then solving for $p$ gives $a=\frac{p+1}{2}.$ So $f(\frac{p+1}{2})=(\frac{p+1}{2})^2.$

Take fixed $x$ and an arbitrary $y$ such that $f(x)=x^2$ and $f(y)=y^2.$ $P(x,f(x)-y)$ gives $y^2+x^2f(2x)-yf(2x).$ Note that taking $y\to \infty$ (it is not hard) forces $f(2x)=4x^2.$ Now $P(y,f(y)-x)$ gives $f(x)-x^2+(2y^2-x)^2\in \mathcal{T}.$ Again $y\to \infty$ gives $f(x)=x^2,$ which works.
This post has been edited 2 times. Last edited by ZETA_in_olympiad, Jun 4, 2022, 11:07 AM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
Inconsistent
1455 posts
#16
Y by
Solution is $f(x) = 0$ for all even $x$ and equals any perfect square for all odd $x$.

First, notice $f(0)^2 + f(0)$ is a perfect square. So if $x = f(0), y^2 = f(0)^2+f(0)$, then $(2x+1)^2-(2y)^2 = 1$ so $y = 0$ so $x = 0, -1$.

If $x = -1$, then plugging $b = f(a)$ gives $f(a)f(2a)-1$ is a perfect square. Plugging $a = 0$ gives $f(x)+x+1$ is a perfect square. Thus $f(4k) \equiv 0, 3 \pmod 4$, but if $4 \mid f(4k)$ then $f(4k)f(8k) - 1 \equiv 3 \pmod 4$ contradiction, so $f(4k) \equiv 3 \pmod 4$ for all $k$. However, $f(4k+2) \equiv 1, 2 \pmod 4$ for all $k$ but if $f(4k + 2) \equiv 1 \pmod 4$ then $f(4k+2)f(8k+4) - 1 \equiv 2 \pmod 4$ contradiction so $f(4k+2) \equiv 2 \pmod 4$ for all $k$. However since with $b = 0$ we have $f(f(a))$ is a perfect square for all $a$, it follows that $f(f(4k+2))$ is a perfect square but is $2 \pmod 4$, which is a contradiction.

Thus $x = 0$. Assume there exists $c \neq 0$ such that $f(c) = 0$. With $a = 0$ we get $f(x)$ is a perfect square for all $x$. Now notice plugging $b = f(a) - 2a$ gives $f(2a)(f(a)-2a+1)$ is a perfect square for all $a$. So either $f(2a) = 0$ or $f(a) \geq 2a - 1$. Consider the set $S$ of $a$ such that $f(2a) \neq 0$. If $S$ is infinite then it is unbounded. However plugging in, for $c \neq 0$ such that $f(c) = 0$, $a = f(a) - c$ gives $(f(a)-x)f(2a)$ is a perfect square, so $f(a) - x$ is a perfect square for all $a$ in $S$. However since $f(a)$ and $f(a) - x$ are both perfect squares for fixed $x$, $f(a)$ is bounded. However since $f(a) \geq 2a - 1$ for all $a \in S$, it follows that $S$ is bounded, contradiction. Thus $S$ is finite, so for all $a > N$ for some fixed $N$, we have $f(2a) = 0$.

Now suppose $f(2a) \neq 0$ for some $a$. Then plugging in $c = -b$ gives $f(f(a)+c) - cf(2a) \geq 0$. However for large positive $c$ of certain parity, $f(f(a)+c) = 0$, so it follows that $f(2a) = 0$. Contradiction. Thus $f(2a)$ is $0$ for all $a$, giving the desired solution.

Finally consider the case where $f(x) \neq 0$ for all $x \neq 0$. Then as before, it follows that $f(a)-2a+1$ is a perfect square for all $a$. So $f(1) = 1, f(2) = 4$ and $f(a) \leq a^2$. Thus $f(x) - 4x+4$ is a perfect square with $a = 1$. It follows for $n = 3$ that $f(3) = 9$, $f(4) = 16$ by size. Thus again we have $f(x) - 16x + 64$ is a perfect square for all $x$. Again by size and $f(a) - 2a + 1$, $f(x) = x^2$ for all $x \leq 8$. It is easy to verify from small cases that $f(9) = 81$ and $f(10) = 100$. Now we strong induct: supposing it is true up to $2a$, we have

$f(c) - 4a^2c+4a^4$ is a perfect square, but LHS differs at most $c^2$ from $(2a^2 - c)^2$. Thus for $c = 2a+1$, we have that $f(c) = c^2$, $4a^2+4a+1 \geq 2(2a^2 - 2a - 1) - 1$ (possibly true), or $4a^2+4a+1 \geq 4(2a^2-2a-1)-4 = 8a^2 - 8a-8 \Longleftrightarrow 4a^2-12a-9 \leq 0$ which fails for $a \geq 5$. But in the middle case, it follows that $f(2a+1)^2 = 8a+4$, but then $f(2a+1)-16(2a+1)+64 < 0$ contradiction. Thus $f(2a+1) = (2a+1)^2$. Now for $c = 2a+2$, we have that $f(c) = c^2$, $4a^2+8a+4 \geq 2(2a^2-2a-1)-1$ (possibly true), or $4a^2+8a+4 \geq 4(2a^2-2a-1)-4 = 8a^2-8a-8 \Longleftrightarrow 4a^2-16a-12 \leq 0$ which fails for $a \geq 5$. But in the middle case, it follows that $f(2a+2)^2 =  12a + 7$. This is impossible mod $4$, so it must be that $f(2a+2) = (2a+2)^2$. Now the inductive step is complete, so $f(x) = x^2$ for all positive $x$.

Plugging $b = f(a)+c$ for positive $a$ gives $f(-c) + (f(a)+c)f(2a) = f(-c)+ 4a^2c+4a^2$ is a perfect square, so through the analogous argument as above (same rule used), the same conclusion follows through induction.
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
CircleInvert
654 posts
#19
Y by
There are two types of solutions: one is $f(x)=x^2$ and the other is $f(x)=0$ for all even $x$ and for all odd $x$ we choose $f(x)$ to be any perfect square (choice may be dependent on $x$). Clearly both types of solutions work. It remains to prove they are the only ones.

Plug in $a=0$ and $b=f(0)$. This gives $f(0)+(f(0))^2=f(0)(f(0)+1)$ is a perfect square. Now, observe that the factors are relatively prime; thus either one is $0$ or both are positive perfect squares, but no two positive perfect squares differ by exactly $1$, so either $f(0)=0$ or $f(0)=-1$.

Let's deal with $f(0)=-1$: plugging in $b=f(a)$, we get $f(a)f(2a)-1$ is always a perfect square, say $f(a)f(2a)=k^2+1$. Then $f(a)$ must be either $1$ or $2$ mod $4$ for all $a$, but now if we plug in $a=0$ and $b=3$, we get $f(-4)-3$ is a perfect square, so it is $0$ or $1$ mod $4$, but this gives that $f(-4)$ is $0$ or $3$ mod $4$, contradiction.

Hence $f(0)=0$.

Plugging in $a=0$ we get that the range of $f$ is a subset of the set of perfect squares.

Assume that there exists $2c$ such that $f(2c)\ne 0$ (otherwise we are in a solution set we have already identified). Then as $f(c)$ is a perfect square, $f(c)>0$.

Plugging in $a=c$, we get $f(f(c)-b)+bf(2c)$ is always a perfect square, and thus $f(f(c)-b)+bf(2c)\ge 0$. Then $f(f(c)-b)\ge -bf(2c)$. Hence, if we send $b$ to $-\infty$, this shows that as $x\to\infty$ we have $f(x)\to\infty$.

Suppose for the sake of contradiction that $k\ne 0$ and $f(k)=0$. Then then, letting $b=f(a)-k$ we get that for every $a$ we have $(f(a)-k)f(2a)$ is a perfect square. For sufficiently large (positive) $a$, we have $f(2a)>0$, and of course $f(2a)$ is a perfect square, so this implies that $f(a)-k$ is a perfect square. However, as $a\to\infty$, $f(a)\to\infty$, and $f(a)$ is also a perfect square, so this would imply arbitrarily large perfect squares that are a constant $k$ apart, which is absurd, hence we get our contradiction, and conclude that $f$ is positive besides at $0$.

Now, letting $b=f(a)-2a$, we get that $f(2a)(1+f(a)-2a)$ is a perfect square. This means that for $a\ne 0$, $1+f(a)-2a$ is a perfect square (and actually $a=0$ can be checked seperately so this statement just holds for all $a$). Now, suppose $2a-1$. Then let $1+f(a)-2a=A^2$ and $f(a)=B^2$ where $A,B\ge 0$. We then have $2a-1=B^2-A^2=(B-A)(B+A)$, so $B-A=1$ and $B+A=2a-1$, hence $B=a$ so $f(a)=a^2$. Hence, for infinitely many positive $a$, we have $f(a)=a^2$.

Now, changing $b$ to $f(a)-b$ in the original equation gives $f(b)-bf(2a)+f(a)f(2a)$ is always a perfect square. Now, letting $a$ range over the infinitely many positive integers for which we have shown $f(a)=a^2$, this becomes $f(b)-4a^2b+4a^4$ is always a perfect square. Now, let $r=f(b)-b^2$, and observe that $b^2-4a^2b+4a^4=(b-2a^2)$ is always a perfect square, and is always $r$ away from $f(b)-4a^2b+4a^4$. As $f(b)-4a^2b+4a^4$ can get arbitrarily large (positive), the only square within $r$ away will be $f(b)-4a^2b+4a^4$ itself, so in fact $r=0$ and hence $f(b)=b^2$ for all $b$. This concludes the proof.
This post has been edited 1 time. Last edited by CircleInvert, Dec 5, 2023, 12:20 AM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
megarnie
5603 posts
#20
Y by
The only solutions are $\boxed{f(x) = x^2}$ and $\boxed{ \begin{cases} f(x)  = 0  & \text{ if } x \text{ is even } \\
f(x) \text{ is a perfect square } & \text{ if } x \text{ is odd} \\ \end{cases}}$, where the perfect squares can be arbitrarily chosen. It's easy to check that these work. Now we prove they are the only solutions.


Let $P(a,b)$ denote the given assertion.

$P(a,0): f(f(a))$ is a perfect square.

Claim: $f(0) = 0$.
Proof: Suppose otherwise.
$P(0,f(0)): f(0) + f(0)^2$ is a perfect square. If $f(0)^2 + f(0) = m^2$, then $(2f(0) + 1)^2 = (2m)^2 + 1$, meaning that $(2f(0) + 1 - 2m)(2f(0) + 1 + 2m) = 1$. Since any two integers multiplying to one are equal we have that $2f(0) + 1 - 2m = 2f(0) + 1 + 2m$, so $m = 0$. Since $f(0) \ne 0$, $f(0) = -1$ must hold.

$P(0,a): f(-a - 1) - a$ is a perfect square, or in other words $f(a) +  a + 1$ is a perfect square.
Then $f(f(a)) + f(a) + 1$ and $f(f(a))$ are perfect squares. Since the difference between two squares cannot be $2\pmod 4$, $f(a)$ cannot be $1\pmod 4$ for any $a$.

$P(a, f(a)): f(a) f(2a) - 1$ is a perfect square. This implies that if $f(a) \equiv 0\pmod 4$, then there is a perfect square that is $3\pmod 4$, absurd. Hence for each $a$, $f(a) \equiv \{2,3 \}\pmod 4$.

Consider $f(3)$. Since $f(3) + 3 + 1$ is a perfect square, $f(3)$ is a quadratic residue mod $4$, so it must be $0$ or $1$ modulo $4$, contradiction. Hence $f(0) = -1$ is impossible, so $f(0) = 0$ must hold. $\square$

$P(0,-a)$ implies that $f(a)$ is a perfect square for each $a$, so also $f(a) \ge 0$ for each $a$.

$P(a, f(a) - 2a): f(2a)(f(a) - 2a + 1)$ is a perfect square, so either $f(2a) = 0$ or $f(a) - 2a + 1$ is a perfect square.

Case 1: There exists a positive root of $f$.
Claim: For any positive integer $k$ with $f(k) = 0$, $f(2k) = 0$ must hold.
Proof: We have $f(2k)(f(k) - 2k + 1)$ is a perfect square, meaning that $f(2k)(1 - 2k)$ is a perfect square. If $f(2k) \ne 0$, then $f(2k)(1 - 2k) < 0$ (because $f(2k) \ge 0$), contradiction. $\square$

$P(a,  f(a) - k): (f(a) - k) f(2a)$ is a perfect square for any integer $a$. If some integer $a$ satisfied $f(2a) \ne 0$, then $f(a) - k > 0$ must hold. However, by our previous claim, we can replace $k$ with $k \cdot 2^n$ for any positive integer $n$. Choosing $n$ such that $k \cdot 2^n > f(a)$ gives a contradiction. Thus, $f(2a) = 0$ for all integers $a$, so $f(x) = 0$ for all even $x$. Since we had already proven $f(a)$ is a perfect square, this case implies the second solution described in the beginning.

Case 2: There does not exist a positive root of $f$.
Then for any positive integer $a$, $f(a) - 2a + 1$ is a perfect square.

Call positive integers $x$ with $f(x) = x^2$ special.

Claim: There are infinitely many special positive integers $x$.
Proof: Consider any positive integer $x$ where $2x - 1 = p$ is a prime (clearly infinitely many $x$ exist).

Then $f(x) - 2x + 1$ and $f(x)$ are perfect squares with a difference of $2x - 1$. Notice if $m^2 - n^2 = p$ for some prime $p$, then $(m-n)(m+n) = p$ hence $(m-n) + (m+n) = (-1) + (-p)$ or $(m-n) + (m+n) = (1 + p)$, meaning that $m =\pm \frac{p+1}{2}$.

Since $f(x) - (f(x) - 2x + 1) = 2x -1$ is a prime, we have $f(x) =  \left( \frac{2x - 1 + 1}{2} \right) = x^2$. $\square$

Claim: If $x$ is special, then $2x$ is special.
Proof: If $x$ is special, then $f(x^2  - a) + af(2x)$ is always a perfect square and $x^2 + (f(a) - x) f(2a)$ is also a perfect square.

If $x^2 -a $ is special then $(x^2 - a) ^2 + a f(2x)$ is a square. Let $f(2x) = 4x^2 + c$. $(2x-1)^2 + c$ is a square

We have $x^4 - 2ax^2 + a^2 + 4x^2 a + a\cdot c$ is a square.

$x^4  + 2ax^2 + a^2 + a\cdot c = (x^2 + a)^2 + a\cdot c$ is a square for infinitely many (negative) $a$. Hence $P(a) = (a-x^2)^2  - a\cdot c$ is a perfect square for infinitely many positive integers $a> x^2$.

We have $P(a) = a^2 - (2x^2 + c) a + x^4$ is a perfect square.

If $f(2x)$ was odd, then $f(2x) - 4x + 1\equiv 2\pmod 4$, so it isn't a perfect square, absurd. Hence $f(2x)$ is even, implying that $c$ is also even. Let $c = 2m$.

Hence we have $P(a) = a^2 - 2(x^2 + m) a + x^4 = (a - (x^2 + m))^2  - ((x^2 + m)^2 - x^4))$.

Therefore, $(a - (x^2 + m))^2 - P(a) = (x^2 + m)^2 - x^4$, so infinitely many distinct squares have a difference of $(x^2 + m)^2 - x^4$, meaning that $(x^2 + m)^2 = x^4$, so $m \in \{-2x^2, 0\}$.

If $m = -2x^2$, then $f(2x) = 4x^2 - 2m = 0$, so contradiction since $x$ is a positive integer. Thus, $m = 0$ and $2x$ is also special. $\square$

Now we prove that $f(x) = x^2$ for all integers $x$. Suppose otherwise. Let $k$ be any integer with $f(k) \ne k^2$ and let $f(k) = k^2 + c$.

For any special $x$, $P(x, x^2 - k): k^2 + c + 4x^2 (x^2 - k) = (2x^2 - k)^2  + c$ is a perfect square.

This implies that infinitely many pairs of two squares have a difference of $c$, so $c=0$, absurd since $f(k) \ne k^2 $.

Therefore, all integers $x$ satisfy $f(x) = x^2$ 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.
bin_sherlo
716 posts
#21 • 1 Y
Y by MS_asdfgzxcvb
Answer are $f(a)=a^2$ for all positive integers and $f(2a)=0, \ f(2a+1)\in \mathbb{Z}^2$. We have $f(b)+(f(a)-b)f(2a)\in \mathbb{Z}^2$.
Lemma: If $k^2x^2+px+q$ is a perfect square for infinitely many positive integer $x$, then there exists an integer $r$ such that $2r=p, \ r^2=q$.

Claim: $f(0)=0$.
Proof: $P(0,0)$ gives $f(0)^2+f(0)$ is a perfect square hence $f(0)\in \{0,-1\}$. Suppose that $f(0)=-1$. Plugging $P(0,b)$ yields $f(b)+b+1\in \mathbb{Z}^2$. Also $P(a,0)$ implies $f(a)f(2a)-1\in \mathbb{Z}^2$ thus, $4\not | f(a)$. Hence $f(4a)\equiv -1(mod \ 4)$. Since $f(2)+3\in \mathbb{Z}^2$ and $f(2)f(4)-1\in \mathbb{Z}^2$ we have $f(2)\equiv 2(mod \ 4)$. However, $P(2,2)$ gives $f(2)+f(2)f(4)-2f(4)\equiv 2(mod \ 4)$ cannot be a perfect square. Thus, $f(0)=0$.
Claim: $f(a)$ is perfect square.
Proof: $P(0,b)$ gives the result. Let $f(a)=g(a)^2$ where $g\geq 0$.
\[g(2a)^2g(a)^2-bg(2a)^2+g(b)^2\in \mathbb{Z}^2\]Claim: If $g(m)=0$ for $m\neq 0$, then $g(2a)=0$ holds.
Proof: Suppose that $g(2l)\neq 0$. $P(l,m)$ gives $g(2l)^2(g(l)^2-m)\in \mathbb{Z}^2$ or $g(l)^2-m\in \mathbb{Z}^2$. We observe that $g(m)=0$ implies $m<g(a)^2$ hence $g(x)>0$ for $x>g(a)^2$. Pick sufficiently large $x$. Since $g(2x)\neq 0$, we get $g(x)^2-m\in \mathbb{Z}^2$ and this implies $g(x)<m+10^{15!}$. By $P(x,2x)$ we also see that $g(x)^2-2x+1\in \mathbb{Z}^2$ however $g(x)-2x+1<0$.
Since all even integers map to zero, $f(b)\in \mathbb{Z}^2$ sufficies for odds.

Now suppose that $g$ is injective at $0$.
Claim: $g(\frac{p-1}{2})=\frac{p-1}{2}$.
Proof: Plugging $P(\frac{p-1}{2},p-1)$ gives $g(\frac{p-1}{2})^2-p\in \mathbb{Z}^2$ and since $x^2-y^2=p$ or $(x-y)(x+y)=p$ implies $x=\frac{p+1}{2}, \ y=\frac{p-1}{2}$ over positive integers, we get $g(\frac{p-1}{2})=\frac{p-1}{2}$.
Claim: $g(2a)=2g(a)$.
Proof: $P(a,\frac{p-1}{2})$ implies $(\frac{p-1}{2})^2-g(2a)^2.(\frac{p-1}{2})+g(a)^2g(2a)^2\in \mathbb{Z}^2$. Hence $x^2-g(2a)^2x+g(a)^2g(2a)^2\in \mathbb{Z}^2$ has infinitely many positive integer solutions. By the lemma, $2|g(a)g(2a)|=g(2a)^2$ or $2g(a)=g(2a)$.
Claim: $g(a)=|a|\iff f(a)=a^2$.
Proof: We obtain $4g(a)^4-4g(a)^2b+g(b)^2\in \mathbb{Z}^2$. Now pick $a=\frac{p-1}{2}$ to see that $4x^2-4bx+g(b)^2\in \mathbb{Z}^2$ has infinitely many solutions over positive integers. Thus, $g(b)=|b|$ or $f(a)=a^2$ as desired. $\blacksquare$
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
MathLuis
1522 posts
#22
Y by
Oh boi, time to have some real fun and avenge child Luis.
Denote $P(a,b)$ the assertion of the given F.E.
$P(0,f(0))$ gives $f(0)^2+f(0)=k^2$ but then $(2f(0)+1)^2=(2k)^2+1$ which means that since only consecutive squares are $0,1$ we must have that $k=0$ and thus $f(0)=0$ or $f(0)=-1$.
If $f(0)=-1$ then from $P(a,0)$ we always get (regardless of the case btw) that $f(f(a))$ is a perfect square but also $P(0,-b-1)$ gives that $f(b)+b+1$ is always a perfect square and thus $f(f(a))+f(a)+1$ is always a perfect square so if $f(a)$ was ever $1 \pmod 4$ then we would have $c^2 \equiv f(f(a))+2 \equiv 2,3 \pmod 4$ and of course this is a contradiction, therefore $f(a)$ is not $1 \pmod 4$ at any time which means that $4 \mid f(f(a))$ always holds and thus $4 \mid f(-1)$ and also $f(a)$ will always be $-1,0 \pmod 4$ and thus by $P(a,4k)$ we have that $f(f(a)-4k) \equiv 0 \pmod 4$ and thus $4 \mid f(4\ell)$ for any integer $\ell$ (follows by fixing $a$) however now $P(2\ell, b)$ gives $f(f(2\ell)-b)+bf(4\ell)$ is a square congrutn to $f(f(2\ell)-b)) \pmod 4$ and this can be $0,1$ but all $f$'s are $-1,0$ so since $b$ is any integer we must have $4 \mid f(z)$ for all integers $z$ and of course $4 \not \; \mid f(0)=-1$ thus a contradiction!.
Therefore $f(0)=0$ and from $P(0,a)$ we get that $f(a)$ is always a perfect square.
Now consider $P(a,f(a)-2a)$ which gives that $f(2a)=0$ or $f(a)-2a+1$ is a perfect square, now let $\mathcal D$ the set of numbers with at most two positive divisors then for any $d \in \mathcal D$ that is not $\pm 2$ it happens that $f(d+1)=0$ or $f \left(\frac{d+1}{2} \right)-d$ is a perfect square and in the latter case it means that there exists $k, \ell$ such that $d=k^2-\ell^2$ which leads to $k+\ell=\pm d$ and $k-\ell=\pm 1$ and in either case we would end up having that either $f(d+1)=0$ or $f \left(\frac{d+1}{2} \right)= \left(\frac{d+1}{2} \right)^2$.
Now the next thing to see is that a difference of squares is always $0 \pmod 4$ or odd this leaves us to consider that if there was a zero $c$ then we would have from $P(a, f(a)-c)$ that $(f(a)-c)f(2a)$ is a perfect square and if $f(a)-c$ was a perfect square then $-c$ is a difference of squares so $c \equiv 2 \pmod 4$ is never going to happen, this also proves that $f(2) \ne 0$ and thus $f(1)=1$ but also for every prime $p \equiv 1 \pmod 4$ we have that $f \left(\frac{p+1}{2} \right)= \left(\frac{p+1}{2} \right)^2$ or else we would have $f(p+1)=0$ in which case it is a contradiction unless we always had $f(2k)=0$ and $f(2k+1)$ a perfect square for all $k \in \mathbb Z$ which indeed works so we will stop considering this solution. And now we also have for all primes $q \equiv 3 \pmod 4$ that $f \left(\frac{1-q}{2} \right)=\left(\frac{1-q}{2} \right)^2$, and using this and the thing above we will check that if such $c \ne 0$ existed then the sol we said we won't mention anymore will happen again.
Indeed if it weren't the case then we would have that $\left(\frac{p+1}{2} \right)^2-c$ is always a perfect square but setting $p$ large enough we can get its bounded between two squares so we get a contradiction!.
Therefore this means for every $d \in \mathcal D$ we have that $f \left(\frac{d+1}{2} \right)=\left(\frac{d+1}{2} \right)^2$ in this case, the most useful part from this is getting infinitely many $\ell \in \mathbb Z$ such that $f(\ell)=\ell^2$ and plug $P(a,f(a)-\ell)$ to get that $\ell^2-\ell f(2a)+f(a)f(2a)$ is a perfect square and for fixed $a$ this means that by some trivial size argument we have that when $f(a)f(2a)=d^2$ then $f(2a)=2d$ this means $d=2d_1^2$ but also $f(2a)^2=4f(a)f(2a)$ so $f(2a)=4f(a)$. Thus giving $f(2\ell)=4\ell^2$.
Also notice from $f(a)-2a+1$ being a perfect square we must have that $0 \le f(a) \le a^2$ for all $a \in \mathbb Z$ by simple size checking and therefore now if we considered $P(\ell, \ell^2-a)$ we get that $f(a)+4(\ell^2-a)\ell^2$ is always a perfect square, sorting this we have $(2\ell^2)^2-2a(2\ell^2)+f(a)$ being a perfect square for infinitely many $\ell$ and thus again from a size argument this implies that $4f(a)=(2a)^2$ and thus $f(a)=a^2$ for all $a \in \mathbb Z$ is the second solution which indeed works, thus we are done :cool:.
Z K Y
N Quick Reply
G
H
=
a