login
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.
2

%I #14 Jul 26 2019 18:23:05

%S 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,

%T 23,16,32,2,19,11,29,7,26,17,37,5,26,16,38,11,34,23,47,4,29,17,43,11,

%U 38,25,53,8,37,23,53,16,47,32,64,2,35,19,53,11,46,29,65,7,44,26,64,17

%N 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.

%H Alois P. Heinz, <a href="/A088371/b088371.txt">Table of n, a(n) for n = 1..16384</a> (first 1024 terms from Paul D. Hanna)

%F a(2^n)=2^n.

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

%e 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}, ...

%e 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}.

%e This sequence can form the following irregular triangle:

%e 1;

%e 2;

%e 2, 4;

%e 2, 5, 4, 8;

%e 2, 7, 5, 11, 4, 11, 8, 16;

%e 2, 11, 7, 17, 5, 16, 11, 23, 4, 17, 11, 25, 8, 23, 16, 32;

%e 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;

%e 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; ...

%p a:= proc(n) option remember; `if`(n<2, n,

%p `if`(n::odd, a(n/2+1/2), a(n/2)+n/2))

%p end:

%p seq(a(n), n=1..128); # _Alois P. Heinz_, Jul 26 2019

%o (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)))

%Y Cf. A088370 (triangle).

%K nonn

%O 1,2

%A _Paul D. Hanna_, Sep 28 2003