---
title: "Remainder of 2027^2027 + 2023^2023 Modulo 45"
organization: "NityaDhi Digital Mathematics Lab (Asa Edtech Private Limited)"
url: "https://www.nityadhi.com/problems/hard-olympiad-nt-w1-euler-mod-45-symmetry"
board: "Olympiad"
grade: "Olympiad"
published_at: "2026-11-23T16:30:00+05:30"
---

# Remainder of 2027^2027 + 2023^2023 Modulo 45

Find the remainder when
$$N = 2027^{2027} + 2023^{2023}$$
is divided by $45$.

## Textbook Solution

Notice that $2025 = 45^2$, so $2025 \equiv 0 \pmod{45}$. Consequently:
$$2027 \equiv 2 \pmod{45} \quad \text{and} \quad 2023 \equiv -2 \pmod{45}.$$
Thus
$$N \equiv 2^{2027} + (-2)^{2023} = 2^{2027} - 2^{2023} \pmod{45}.$$
Since $\gcd(2, 45) = 1$, Euler's theorem gives $2^{\varphi(45)} \equiv 1 \pmod{45}$, where $\varphi(45) = \varphi(9)\varphi(5) = 6 \times 4 = 24$.
Reducing the exponents modulo $24$:
- $2027 = 24 \times 84 + 11 \implies 2^{2027} \equiv 2^{11} = 2048 \pmod{45}$.
  Since $2025$ is divisible by $45$, $2048 = 2025 + 23 \equiv 23 \pmod{45}$.
- $2023 = 24 \times 84 + 7 \implies 2^{2023} \equiv 2^7 = 128 \pmod{45}$.
  Since $128 = 45 \times 2 + 38$, $2^{2023} \equiv 38 \pmod{45}$.

Combining both parts modulo $45$:
$$N \equiv 23 - 38 = -15 \equiv 30 \pmod{45}.$$
Therefore, the remainder is **$30$**.

## Vedic Shortcut

Factor out $2^{2023}$ first!
$$2^{2027} - 2^{2023} = 2^{2023}(2^4 - 1) = 15 \cdot 2^{2023}.$$
Because there is already a factor of $15$, we only need $2^{2023} \pmod 3$! (Since $15a \bmod 45 = 15(a \bmod 3)$.)
Modulo $3$, $2 \equiv -1$, so:
$$2^{2023} \equiv (-1)^{2023} = -1 \equiv 2 \pmod 3.$$
Hence:
$$15 \cdot 2^{2023} \equiv 15 \cdot 2 = 30 \pmod{45}.$$
A two-line mental finish!

## Common Mistakes

- **Missing that $45^2 = 2025$**: Dividing $2027$ and $2023$ by $45$ manually wastes time and invites arithmetic slips.
- **Sign error on $(-2)^{2023}$**: Writing $(-2)^{2023} \equiv 2^{2023}$ instead of $-2^{2023}$, or forgetting that $23 - 38 = -15$ corresponds to $+30 \pmod{45}$.