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.

Original entry on oeis.org

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, 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, 7, 3, 4, 5, 6, 7, 4, 5, 6, 7, 5, 6, 7, 6, 7, 7, 1, 2, 3
Offset: 1

Views

Author

Jonathan Kal-El Peréz, Aug 19 2022

Keywords

Comments

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.
Also, concatenation of runs A002260(n)..A002024(n) for each n>=1.

Examples

			1
1 2
_ 2
1 2 3
_ 2 3
_ _ 3
1 2 3 4
_ 2 3 4
_ _ 3 4
_ _ _ 4...
		

Crossrefs

Programs

  • JavaScript
    a=n=>{for(let i=1;++i;){for(let j=0;++j
    				
  • MATLAB
    function a = A356647( max_x )
        a = cell2mat(arrayfun(@(x)(cell2mat(arrayfun(@(y)([y:x]),[1:x],'UniformOutput', false))) ...
            ,[1:max_x],'UniformOutput', false));
    end % Thomas Scheuerle, Sep 30 2022
    
  • Mathematica
    Print @ Flatten @ (Reverse@FoldList[Join[#2,#]&, {#}&/@Reverse@#]& /@ FoldList[Join, Table[{n},{n,1,10}]])
  • Python
    from itertools import count, islice
    def agen(): # generator of terms
        for k in count(1):
            for j in range(1, k+1):
                yield from range(j, k+1)
    print(list(islice(agen(), 87))) # Michael S. Branicky, Oct 11 2022

Formula

a(n) = A000120(A087118(n + 1)). - Thomas Scheuerle, Feb 16 2023
a(n*(n^2 + 5)/6) = a(A004006(n)) = n. This is the earliest appearance of n. - Thomas Scheuerle, Sep 30 2022