P821
projecteuler.net

123-Separable

ℹ️Published on Saturday, 17th December 2022, 07:00 pm; Solved by 162;
Difficulty rating: 65%

A set, $S$, of integers is called 123-separable if $S$, $2S$ and $3S$ are disjoint. Here $2S$ and $3S$ are obtained by multiplying all the elements in $S$ by $2$ and $3$ respectively.

Define $F(n)$ to be the maximum number of elements of $$(S\cup 2S \cup 3S)\cap \{1,2,3,\ldots,n\}$$ where $S$ ranges over all 123-separable sets.

For example, $F(6) = 5$ can be achieved with either $S = \{1,4,5\}$ or $S = \{1,5,6\}$.
You are also given $F(20) = 19$.

Find $F(10^{16})$.



Soluzione

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