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.

A384773 a(1) = 1, a(2) = 1. For n > 2 if a(n-1) = k is a novel term, a(n) = a(n-1-k). Otherwise if a(n-1) is a repeat term a(n) = number of m; 1 <= m <= n-2 such that a(m) = a(n-1).

This page as a plain text file.
%I A384773 #32 Jun 17 2025 21:52:00
%S A384773 1,1,1,2,1,3,1,4,2,1,5,3,1,6,4,1,7,1,8,5,1,9,1,10,6,1,11,1,12,7,1,13,
%T A384773 8,1,14,1,15,9,1,16,10,1,17,1,18,11,1,19,12,1,20,1,21,13,1,22,1,23,14,
%U A384773 1,24,15,1,25,1,26,16,1,27,1,28,17,1,29,18,1,30
%N A384773 a(1) = 1, a(2) = 1. For n > 2 if a(n-1) = k is a novel term, a(n) = a(n-1-k). Otherwise if a(n-1) is a repeat term a(n) = number of m; 1 <= m <= n-2 such that a(m) = a(n-1).
%C A384773 a(n) <= n for all n, with equality for n = 1. Same as A364749 until a(12).
%C A384773 The sequence of indices of terms a(n-1-k) following novel terms k (starting: 2,3,4,6,8,10,11,13,...) appears to be A335999.
%C A384773 Records subsequence is A000027, with records occurring at indices 1, A026278.
%H A384773 Michael De Vlieger, <a href="/A384773/b384773.txt">Table of n, a(n) for n = 1..10000</a>
%e A384773 a(1) = a(2) = 1 implies a(3) = 1 since 1 has been repeated once. Then a(4) = 2 because now 1 has been repeated twice. Since 2 is a novel term a(5) = a(4-2) = a(2) = 1. Since 1 has been repeated three times a(6) = 3, another novel term so a(7) = a(6-3) = a(3) = 1.
%t A384773 nn = 2^16; c[_] := 0; a[1] = a[2] = 1; c[1]++; {1, 1}~Join~Do[(If[c[#] == 0, k = a[n - # - 1], k = c[#] ]; c[#]++) &[a[n - 1] ]; a[n] = k, {n, 3, nn}]; Array[a, nn] (* _Michael De Vlieger_, Jun 10 2025 *)
%Y A384773 Cf. A000027, A026278, A335999, A364749.
%K A384773 nonn,easy
%O A384773 1,4
%A A384773 _David James Sycamore_, Jun 09 2025