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.

A100798 n occurs n times, as early as possible subject to the constraint that two successive occurrences of n are separated by at least by n terms.

This page as a plain text file.
%I A100798 #12 Nov 26 2016 10:38:47
%S A100798 1,2,3,4,2,5,3,6,4,7,3,5,8,4,6,9,10,5,4,7,11,6,8,5,12,9,13,7,6,5,10,8,
%T A100798 11,14,15,6,7,9,12,16,8,10,6,13,7,11,17,9,14,8,15,12,7,10,18,19,16,9,
%U A100798 8,11,7,13,20,14,10,12,15,8,9,17,21,11,22,16,18,10,8,13,9,12,14,19,15,11
%N A100798 n occurs n times, as early as possible subject to the constraint that two successive occurrences of n are separated by at least by n terms.
%C A100798 Subsidiary sequences: first (A100919) and the last (A100920) occurrences of n.
%H A100798 Ivan Neretin, <a href="/A100798/b100798.txt">Table of n, a(n) for n = 1..10000</a>
%e A100798 Index of the first occurrence of 2 is 2 and that of the second occurrence is 5, separated by a(3) and a(4), two terms.
%t A100798 mx = 22; lst = cnt = ConstantArray[0, mx + 1]; a = {}; Do[k = Min@Select[Range[mx + 1], lst[[#]] <= n && cnt[[#]] < # &]; AppendTo[a, k]; lst[[k]] = n + k + 1; cnt[[k]]++; If[k > mx, Break[]], {n, mx^2}]; a (* _Ivan Neretin_, Nov 25 2016 *)
%Y A100798 Cf. A061925, A074148, A100795.
%K A100798 easy,nonn
%O A100798 1,2
%A A100798 _Amarnath Murthy_, Dec 05 2004
%E A100798 Extended by _Ray Chandler_, Dec 08 2004