This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A363447 #18 Jul 17 2024 20:28:36 %S A363447 0,1,0,3,2,5,4,1,0,9,8,11,10,7,0,15,14,17,16,13,6,3,2,23,22,1,0,27,26, %T A363447 29,28,25,0,33,32,35,34,31,24,21,2,41,40,1,0,45,44,47,46,43,0,51,50, %U A363447 53,52,49,42,39,20,5,4,1,0,63,62,65,64,61,0,69,68,71 %N A363447 a(0) = 0; a(n) = a(a(n-1))-1 mod (n+1) for all n >= 1. %C A363447 Question: Does every nonnegative integer appear in the sequence? Furthermore, does every nonnegative integer appear an infinite number of times? %H A363447 Curtis Bechtel, <a href="/A363447/b363447.txt">Table of n, a(n) for n = 0..10000</a> %e A363447 For n = 1, we have a(1) = a(a(0))-1 mod 2 = a(0)-1 mod 2 = 0-1 mod 2 = 1. %e A363447 For n = 20, assume we already know that a(19) = 13 and a(13) = 7. Then a(20) = a(a(19))-1 mod 21 = a(13)-1 mod 21 = 6. %e A363447 For n = 23, assume we already know that a(22) = 2 and a(2) = 0. Then a(23) = a(a(22))-1 mod 24 = a(2)-1 mod 24 = -1 mod 24 = 23. %t A363447 a[0]:=0; a[n_]:=a[n]=Mod[a[a[n-1]]-1, n+1]; Array[a,72,0] %o A363447 (Python) %o A363447 a = [0] %o A363447 for i in range(1, 100): %o A363447 a.append((a[a[i - 1]] - 1) % (i + 1)) %Y A363447 Cf. A145465, A268176. %K A363447 nonn,easy,look %O A363447 0,4 %A A363447 _Curtis Bechtel_, Jun 02 2023