Skip to main content
2 of 2
added 15 characters in body

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$, for $n\geq 2$.

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$?