cp's OEIS Frontend

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.

A358431 a(0) = 1; a(n+1) = 1 if a(n) > n, otherwise a(n+1) = a(n) + a(a(n)).

This page as a plain text file.
%I A358431 #13 Jan 02 2023 17:32:07
%S A358431 1,1,2,4,1,2,4,5,7,12,1,2,4,5,7,12,16,32,1,2,4,5,7,12,16,32,1,2,4,5,7,
%T A358431 12,16,32,48,1,2,4,5,7,12,16,32,48,1,2,4,5,7,12,16,32,48,55,1,2,4,5,7,
%U A358431 12,16,32,48,55,57,62,110,1,2,4,5,7,12,16,32,48,55,57,62,110
%N A358431 a(0) = 1; a(n+1) = 1 if a(n) > n, otherwise a(n+1) = a(n) + a(a(n)).
%t A358431 a[0] = 1; a[n_] := a[n] = If[a[n - 1] > n - 1, 1, a[n - 1] + a[a[n - 1]]]; Array[a, 80, 0] (* _Amiram Eldar_, Dec 06 2022 *)
%o A358431 (Python)
%o A358431 from functools import cache
%o A358431 @cache
%o A358431 def a(n): return 1 if n==0 else (1 if a(n-1) > n-1 else a(n-1) + a(a(n-1)))
%o A358431 print([a(n) for n in range(76)]) # _Michael S. Branicky_, Nov 15 2022
%Y A358431 Cf. A062039.
%K A358431 nonn
%O A358431 0,3
%A A358431 _Aidan Clarke_, Nov 15 2022