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.

A088371 Position where n is inserted into the n-th row of triangle A088370, where the n-th row differs from the prior row only by the presence of n.

Original entry on oeis.org

1, 2, 2, 4, 2, 5, 4, 8, 2, 7, 5, 11, 4, 11, 8, 16, 2, 11, 7, 17, 5, 16, 11, 23, 4, 17, 11, 25, 8, 23, 16, 32, 2, 19, 11, 29, 7, 26, 17, 37, 5, 26, 16, 38, 11, 34, 23, 47, 4, 29, 17, 43, 11, 38, 25, 53, 8, 37, 23, 53, 16, 47, 32, 64, 2, 35, 19, 53, 11, 46, 29, 65, 7, 44, 26, 64, 17
Offset: 1

Views

Author

Paul D. Hanna, Sep 28 2003

Keywords

Examples

			A088370 rows: {1}, {1, 2}, {1, 3, 2}, {1, 3, 2, 4}, {1, 5, 3, 2, 4}, {1, 5, 3, 2, 6, 4}, {1, 5, 3, 7, 2, 6, 4}, ...
Row 5 is formed from row 3, {1, 3, 2} and row 2, {1, 2}: {1, 5, 3, 2, 4} = {1*2-1, 3*2-1, 2*2-1}|{1*2, 2*2}.
This sequence can form the following irregular triangle:
1;
2;
2, 4;
2, 5, 4, 8;
2, 7, 5, 11, 4, 11, 8, 16;
2, 11, 7, 17, 5, 16, 11, 23, 4, 17, 11, 25, 8, 23, 16, 32;
2, 19, 11, 29, 7, 26, 17, 37, 5, 26, 16, 38, 11, 34, 23, 47, 4, 29, 17, 43, 11, 38, 25, 53, 8, 37, 23, 53, 16, 47, 32, 64;
2, 35, 19, 53, 11, 46, 29, 65, 7, 44, 26, 64, 17, 56, 37, 77, 5, 46, 26, 68, 16, 59, 38, 82, 11, 56, 34, 80, 23, 70, 47, 95, 4, 53, 29, 79, 17, 68, 43, 95, 11, 64, 38, 92, 25, 80, 53, 109, 8, 65, 37, 95, 23, 82, 53, 113, 16, 77, 47, 109, 32, 95, 64, 128; ...
		

Crossrefs

Cf. A088370 (triangle).

Programs

  • Maple
    a:= proc(n) option remember; `if`(n<2, n,
         `if`(n::odd, a(n/2+1/2), a(n/2)+n/2))
        end:
    seq(a(n), n=1..128);  # Alois P. Heinz, Jul 26 2019
  • PARI
    L=100; b=vector(L,k,k); c=vector(L); a=vector(L,k,b); a[1]=[1]; print1(1,","); for(n=2,L,i=floor((n+1)/2); j=floor(n/2); b=a[i]; b=vector(i,k,b[k]=2*b[k]-1 ); c=a[j]; c=vector(j,k,c[k]=2*c[k]); a[n]=concat(b,c); t=a[n]; for(k=1,n,if(t[k]==n,print1(k,","); k=n+1)))

Formula

a(2^n)=2^n.
a(2*n-1)=a(n), a(2*n)=n+a(n).