Question
Question: Let $f(a, b)$ be a function with the following properties for all positive integers $a \neq b$: $f(...
Let f(a,b) be a function with the following properties for all positive integers a=b:
f(1,2)=f(2,1) f(a,b)+f(b,a)=0 f(a+b,b)=f(b,a)+b
Compute:
∑i=12019f(4i−1,2i)+f(4i+1,2i)

2^{2021}-6
Solution
The function f(a,b) has the properties:
- f(1,2)=f(2,1)
- f(a,b)+f(b,a)=0⟹f(a,b)=−f(b,a)
- f(a+b,b)=f(b,a)+b
From (1) and (2), f(1,2)=−f(1,2)⟹2f(1,2)=0⟹f(1,2)=0. Also, f(2,1)=0.
From (3), substitute f(b,a)=−f(a,b): f(a+b,b)=−f(a,b)+b. Let X=a+b, then a=X−b. So, f(X,b)=−f(X−b,b)+b for X>b. Applying this repeatedly: f(X,b)=−(−f(X−2b,b)+b)+b=f(X−2b,b). This implies f(a,b)=f(a−2b,b)=f(a−4b,b)=…. Let a=qb+r, where q=⌊a/b⌋ and r=a(modb).
- If q is even, f(a,b)=f(r,b).
- If q is odd, f(a,b)=b−f(r,b).
If r=0, i.e., a is a multiple of b: Using f(2,1)=0, where q=2 (even) and r=0, suggests f(0,1)=0. Using f(3,1)=f(1+2,1)=f(2,1)+1=0+1=1, where q=3 (odd) and r=0, suggests 1=1−f(0,1), implying f(0,1)=0. So, we assume f(0,b)=0 for any b. Thus, if a is a multiple of b:
- If q=a/b is even, f(a,b)=0.
- If q=a/b is odd, f(a,b)=b.
We need to compute S=∑i=12019(f(4i−1,2i)+f(4i+1,2i)).
-
Evaluate f(4i−1,2i): Let a=4i−1 and b=2i. Since i≥1, a>b. a=(2i)2−1. The quotient q=⌊((2i)2−1)/2i⌋=⌊2i−1/2i⌋=2i−1. The remainder r=(2i)2−1(mod2i)=2i−1. Since q=2i−1 is always odd for i≥1: f(4i−1,2i)=b−f(r,b)=2i−f(2i−1,2i). Now, evaluate f(2i−1,2i). Let a′=2i−1 and b′=2i. Here a′<b′. f(a′,b′)=−f(b′,a′)=−f(2i,2i−1). For f(2i,2i−1), let A=2i and B=2i−1. A>B. A=1⋅B+1. So q′=1 (odd), r′=1. f(2i,2i−1)=B−f(r′,B)=(2i−1)−f(1,2i−1). For f(1,2i−1), let A′′=1 and B′′=2i−1. Here A′′<B′′. f(1,2i−1)=−f(2i−1,1). For f(2i−1,1), let A′′′=2i−1 and B′′′=1. A′′′>B′′′. q′′′=(2i−1)/1=2i−1 (odd for i≥1), r′′′=0. So, f(2i−1,1)=B′′′=1. Therefore, f(1,2i−1)=−1. Substitute back: f(2i,2i−1)=(2i−1)−(−1)=2i. Thus, f(2i−1,2i)=−2i. Finally, f(4i−1,2i)=2i−(−2i)=2⋅2i=2i+1. This formula holds for i>1. For i=1: f(41−1,21)=f(3,2)=21−f(1,2)=2−0=2. So for i=1, f(4i−1,2i)=2i. For i>1, f(4i−1,2i)=2i+1.
-
Evaluate f(4i+1,2i): Let a=4i+1 and b=2i. Since i≥1, a>b. a=(2i)2+1. The quotient q=⌊((2i)2+1)/2i⌋=⌊2i+1/2i⌋=2i. The remainder r=(2i)2+1(mod2i)=1. Since q=2i is always an even number for i≥1: f(4i+1,2i)=f(r,b)=f(1,2i). For f(1,2i), let a′=1 and b′=2i. Here a′<b′. f(1,2i)=−f(2i,1). For f(2i,1), let A=2i and B=1. A>B. q′=2i/1=2i (even for i≥1), r′=0. So, f(2i,1)=0. Therefore, f(1,2i)=−0=0. Thus, f(4i+1,2i)=0 for all i≥1.
-
Compute the sum: S=∑i=12019(f(4i−1,2i)+f(4i+1,2i)) S=∑i=12019(f(4i−1,2i)+0) S=f(41−1,21)+∑i=22019f(4i−1,2i) S=2+∑i=220192i+1 The sum is 2+(22+1+23+1+⋯+22019+1) S=2+(23+24+⋯+22020) The terms (23+24+⋯+22020) form a geometric series with first term a=23=8, common ratio r=2, and number of terms n=2020−3+1=2018. The sum of this geometric series is 82−122018−1=8(22018−1)=23⋅22018−23=22021−8. Therefore, S=2+(22021−8)=22021−6.