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.

A213183 Initialize a(1)=R=1. Repeat: copy the last R preceding terms to current position; increment R; do twice: append the least integer that has not appeared in the sequence yet.

This page as a plain text file.
%I A213183 #29 May 22 2021 04:30:12
%S A213183 1,1,2,3,2,3,4,5,3,4,5,6,7,4,5,6,7,8,9,5,6,7,8,9,10,11,6,7,8,9,10,11,
%T A213183 12,13,7,8,9,10,11,12,13,14,15,8,9,10,11,12,13,14,15,16,17,9,10,11,12,
%U A213183 13,14,15,16,17,18,19,10,11,12,13,14,15,16,17,18,19,20,21,11,12
%N A213183 Initialize a(1)=R=1. Repeat: copy the last R preceding terms to current position; increment R; do twice: append the least integer that has not appeared in the sequence yet.
%C A213183 Every positive integer k occurs floor((k+3)/2) times: 1 and 2 occur twice, 3 and 4 thrice, 5 and 6 four times, and so on.
%e A213183 a(1) = 1  -- initial value
%e A213183 a(2) = 1  -- copied one last term
%e A213183 a(3)=2, a(4)=3  -- appended two terms
%e A213183 a(5)=2, a(6)=3  -- copied two last terms
%e A213183 a(7)=4, a(8)=5  -- appended two terms
%e A213183 a(9)=3, a(10)=4, a(11)=5  -- copied three last terms
%e A213183 a(12)=6, a(13)=7  -- appended two terms
%e A213183 a(14)=4, a(15)=5, a(16)=6, a(17)=7  -- copied four last terms
%e A213183 a(18)=8, a(19)=9  -- appended two terms, and so on.
%e A213183 Comments from _N. J. A. Sloane_, Apr 28 2020, following a suggestion from _Paul Curtz_: (Start)
%e A213183 With an initial -1, 0, this may also be regarded as a triangle read by rows:
%e A213183   -1;
%e A213183    0,  1;
%e A213183    1,  2,  3;
%e A213183    2,  3,  4,  5;
%e A213183    3,  4,  5,  6,  7;
%e A213183    4,  5,  6,  7,  8,  9;
%e A213183    5,  6,  7,  8,  9, 10, 11;
%e A213183    6,  7,  8,  9, 10, 11, 12, 13;
%e A213183   ...
%e A213183 or as an array read by upward antidiagonals:
%e A213183   -1,  1,  3,  5,  7,  9, 11, ...
%e A213183    0,  2,  4,  6,  8, 10, ...
%e A213183    1,  3,  5,  7,  9, ...
%e A213183    2,  4,  6,  8, ...
%e A213183    3,  5,  7, ...
%e A213183    4,  6, ...
%e A213183    5, ...
%e A213183   ...
%e A213183 (End)
%o A213183 (Python)
%o A213183 a = [1]*992
%o A213183 R = 1
%o A213183 i = 2
%o A213183 while i<900:
%o A213183         for t in range(R):
%o A213183                 a[i] = a[i-R]
%o A213183                 i += 1
%o A213183         R += 1
%o A213183         a[i] = a[i-1] + 1
%o A213183         i += 1
%o A213183         a[i] = a[i-1] + 1
%o A213183         i += 1
%o A213183 for i in range(1,99):
%o A213183         print(a[i], end=',')
%Y A213183 If we prefix this with -1, 0, and then add 1 to every term, we get A051162.
%K A213183 nonn,easy,tabf
%O A213183 1,3
%A A213183 _Alex Ratushnyak_, Mar 05 2013