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.

A356647 Concatenation of runs {y..x} for each x>=1, using each y from 1 to x before moving on to the next value for x.

This page as a plain text file.
%I A356647 #42 Feb 27 2023 22:51:42
%S A356647 1,1,2,2,1,2,3,2,3,3,1,2,3,4,2,3,4,3,4,4,1,2,3,4,5,2,3,4,5,3,4,5,4,5,
%T A356647 5,1,2,3,4,5,6,2,3,4,5,6,3,4,5,6,4,5,6,5,6,6,1,2,3,4,5,6,7,2,3,4,5,6,
%U A356647 7,3,4,5,6,7,4,5,6,7,5,6,7,6,7,7,1,2,3
%N A356647 Concatenation of runs {y..x} for each x>=1, using each y from 1 to x before moving on to the next value for x.
%C A356647 Alternate definition: Flattened list of all suffixes (ordered longest to shortest) of the list of all prefixes (ordered shortest to longest) of the list of positive integers. A prefix here is defined as any contiguous sublist of a list which includes the first element, and a suffix as any contiguous sublist of a list which includes the last element.
%C A356647 Also, concatenation of runs A002260(n)..A002024(n) for each n>=1.
%H A356647 The Nineteenth Byte Stack Exchange chat room, <a href="https://chat.stackexchange.com/transcript/message/61821392">Message regarding this sequence.</a> Some replies are programs to generate terms of the sequence.
%F A356647 a(n) = A000120(A087118(n + 1)). - _Thomas Scheuerle_, Feb 16 2023
%F A356647 a(n*(n^2 + 5)/6) = a(A004006(n)) = n. This is the earliest appearance of n. - _Thomas Scheuerle_, Sep 30 2022
%e A356647 1
%e A356647 1 2
%e A356647 _ 2
%e A356647 1 2 3
%e A356647 _ 2 3
%e A356647 _ _ 3
%e A356647 1 2 3 4
%e A356647 _ 2 3 4
%e A356647 _ _ 3 4
%e A356647 _ _ _ 4...
%t A356647 Print @ Flatten @ (Reverse@FoldList[Join[#2,#]&, {#}&/@Reverse@#]& /@ FoldList[Join, Table[{n},{n,1,10}]])
%o A356647 (JavaScript) a=n=>{for(let i=1;++i;){for(let j=0;++j<i;){for(let k=j;k<i;k++){if(!--n){return k}}}}}
%o A356647 (MATLAB)
%o A356647 function a = A356647( max_x )
%o A356647     a = cell2mat(arrayfun(@(x)(cell2mat(arrayfun(@(y)([y:x]),[1:x],'UniformOutput', false))) ...
%o A356647         ,[1:max_x],'UniformOutput', false));
%o A356647 end % _Thomas Scheuerle_, Sep 30 2022
%o A356647 (Python)
%o A356647 from itertools import count, islice
%o A356647 def agen(): # generator of terms
%o A356647     for k in count(1):
%o A356647         for j in range(1, k+1):
%o A356647             yield from range(j, k+1)
%o A356647 print(list(islice(agen(), 87))) # _Michael S. Branicky_, Oct 11 2022
%Y A356647 Cf. A000120, A004006, A087118.
%K A356647 nonn,easy
%O A356647 1,3
%A A356647 _Jonathan Kal-El Peréz_, Aug 19 2022