Skip to main content
1 of 2

Does every integer appear in the modular sum sequence?

$\newcommand{\N}{\mathbb{N}}$Let $\N$ denote the set of non-negative integers. We inductively define a sequence $a:\N\to\N$ by:

  • $a(0) = 0, a(1) = 1$ and
  • $a(n) = \big(\sum_{k=0}^{n-1}a(k)\big)\text{ mod } n$.

This sequence starts with $0, 1, 1, 2, 0, 4, 2, 3,...$; more members can be calculated with this ${\mathtt{C}}$ file. So far this sequence doesn't seem to be listed in the online encyclopedia of integer sequences (OEIS).

Question. Is $a$ surjective? If yes, is $a^{-1}(\{m\})$ infinite for all $m\in\N$?