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 A384660 #12 Jun 07 2025 08:22:27 %S A384660 1,1,2,1,2,3,2,2,3,4,1,2,3,4,5,2,2,3,4,5,6,3,2,3,4,5,6,7,2,2,3,4,5,6, %T A384660 7,8,2,2,3,4,5,6,7,8,9,3,2,3,4,5,6,7,8,9,10,4,2,3,4,5,6,7,8,9,10,11,1, %U A384660 2,3,4,5,6,7,8,9,10,11,12,2,2,3,4,5,6,7 %N A384660 a(1) = 1. Thereafter a(n) = a(a(n-1)) if a(n-1) is a novel term, or n - S(n) if a(n-1) is a repeat term. S(n) is the sum of distinct terms in multiset {a(1),a(2),..a(n-1)}. %C A384660 Because of condition pertaining to novel terms the sequence contains a proper subsequence identical to itself, and consequently infinitely many such copies. %H A384660 Michael De Vlieger, <a href="/A384660/b384660.txt">Table of n, a(n) for n = 1..10000</a> %H A384660 Michael De Vlieger, <a href="/A384660/a384660.png">Log log plot of a(n)</a>, n = 1..1000. %e A384660 a(1) = 1 is a novel term so a(2) = a(a(1)) = 1, which is a repeat term so a(3) = 3 - 1 = 2, another novel term so a(4) = a(a(2)) = a(1) = 1. %t A384660 nn = 1000; c[_] := False; a[1] = 1; s = 0; Do[If[c[#], k = n - s, s += #; k = a[#] ] &[a[n - 1]]; Set[{a[n], c[a[n - 1]]}, {k, True}], {n, 2, nn}]; Array[a, nn] (* _Michael De Vlieger_, Jun 06 2025 *) %Y A384660 Cf. A002260. %K A384660 nonn,easy %O A384660 1,3 %A A384660 _David James Sycamore_, Jun 06 2025 %E A384660 More terms from _Alois P. Heinz_, Jun 06 2025