P925
projecteuler.net

Larger Digit Permutation III

ℹ️Published on Saturday, 28th December 2024, 07:00 pm; Solved by 154;
Difficulty rating: 55%

Let $B(n)$ be the smallest number larger than $n$ that can be formed by rearranging digits of $n$, or $0$ if no such number exists. For example, $B(245) = 254$ and $B(542) = 0$.

Define $\displaystyle T(N) = \sum_{n=1}^N B(n^2)$. You are given $T(10)=270$ and $T(100)=335316$.

Find $T(10^{16})$. Give your answer modulo $10^9 + 7$.



Soluzione

Last modified: May 01, 2025. Website built with Franklin.jl and the lovely Julia programming language.