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.

A359728 a(1) = 1; a(n) is the smallest positive number not among the first k terms where k is the number of times a(n-1) has occurred.

This page as a plain text file.
%I A359728 #25 Mar 13 2023 06:07:54
%S A359728 1,2,2,3,2,3,3,3,4,2,4,3,4,3,4,4,4,4,4,4,5,2,4,5,3,4,5,3,4,5,4,5,4,5,
%T A359728 4,5,4,5,4,5,5,5,5,5,5,5,5,5,5,5,5,5,6,2,4,5,6,3,5,6,3,5,6,4,5,6,4,5,
%U A359728 6,4,6,4,6,4,6,5,6,5,6,5,6,5,6,5,6,5,6
%N A359728 a(1) = 1; a(n) is the smallest positive number not among the first k terms where k is the number of times a(n-1) has occurred.
%C A359728 A new number is always followed by a 2.
%H A359728 Samuel Harkness, <a href="/A359728/b359728.txt">Table of n, a(n) for n = 1..10000</a>
%e A359728 a(4) is 3 because the previous term (2) appears two times; we therefore look at the first 2 terms (1,2). 3 is the smallest number not among them, so a(4) is 3.
%e A359728 a(21) is 5: We see that a(20)=4 appears 9 times; the smallest number not among the first 9 terms (1,2,2,3,2,3,3,3,4) is 5.
%t A359728 K = {1}; While[Length@K < 87, T = Take[K, Count[K, Last@K]]; i = 1; While[MemberQ[T, i], i++]; AppendTo[K, i]]; Print[K] (* _Samuel Harkness_, Mar 12 2023 *)
%o A359728 (PARI) lista(nn) = my(va=vector(nn)); va[1] = 1; for (n=2, nn, my(k=#select(x->(x==va[n-1]), va)); my(vb=Vec(va, k), m); for(j=1, vecmax(vb)+1, if (! #select(x->(x==j), vb), m=j; break)); va[n] = m;); va; \\ _Michel Marcus_, Jan 13 2023
%Y A359728 Cf. A358921.
%K A359728 nonn
%O A359728 1,2
%A A359728 _Neal Gersh Tolunsky_, Jan 11 2023