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 A340134 #7 Dec 30 2020 03:04:13 %S A340134 0,0,1,1,1,2,1,2,2,2,3,2,3,2,3,3,3,4,3,4,3,4,3,4,4,4,5,4,5,4,5,4,5,4, %T A340134 5,5,5,6,5,6,5,6,5,6,5,6,5,6,6,6,7,6,7,6,7,6,7,6,7,6,7,6,7,7,7,8,7,8, %U A340134 7,8,7,8,7,8,7,8,7,8,7,8,8,8,9,8,9,8,9 %N A340134 a(n+1) = a(n-2*a(n)) + 1, starting with a(1) = a(2) = 0. %F A340134 a(n) = floor(sqrt(n-1)) + ((-1)^(n+floor(sqrt(n)))-1)/2. %e A340134 a(3) = a(2-2*a(2))+1 = a(2)+1 = 1. %e A340134 a(4) = a(3-2*a(3))+1 = a(1)+1 = 1. %e A340134 a(5) = a(4-2*a(4))+1 = a(2)+1 = 1. %e A340134 a(6) = a(5-2*a(5))+1 = a(3)+1 = 2. %t A340134 Table[Floor[Sqrt[n-1]] + ((-1)^(n+Floor[Sqrt[n]])-1)/2,{n,87}] (* _Stefano Spezia_, Dec 29 2020 *) %o A340134 (Python) %o A340134 a = [0, 0] %o A340134 for n in range(1, 1000): %o A340134 a.append(a[n-2*a[n]]+1) %Y A340134 For a(n+1) = a(n-a(n)) + 1, starting with a(1) = 0, see A003056. %Y A340134 Cf. A339929, A330772, A005206. %K A340134 nonn %O A340134 1,6 %A A340134 _Rok Cestnik_, Dec 29 2020 %E A340134 More terms from _Stefano Spezia_, Dec 29 2020