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.

A335552 Triangle T(n,k) read by rows: in the Josephus problem with n initial numbers on a line: eliminate each second and reverse left-right-direction of elimination. T(n,k) is the (n-k+1)st element removed, 1<=k<=n.

This page as a plain text file.
%I A335552 #49 Jun 27 2020 05:10:52
%S A335552 1,3,1,3,1,4,1,5,3,4,1,5,3,6,4,3,7,1,5,6,4,3,7,1,5,8,6,4,9,1,5,3,7,8,
%T A335552 6,4,9,1,5,3,7,10,8,6,4,11,3,7,1,5,9,10,8,6,4,11,3,7,1,5,9,12,10,8,6,
%U A335552 4,9,1,13,5,3,7,11,12,10,8,6,4,9,1,13,5,3,7,11,14,12,10,8,6,4,11,3,15
%N A335552 Triangle T(n,k) read by rows: in the Josephus problem with n initial numbers on a line: eliminate each second and reverse left-right-direction of elimination. T(n,k) is the (n-k+1)st element removed, 1<=k<=n.
%H A335552 Georg Fischer, <a href="/A335552/b335552.txt">Table of n, a(n) for n = 1..1000</a>
%H A335552 K. Matsumoto, T. Nakamigawa, M. Watanabe, <a href="http://hdl.handle.net/10131/5785">On the switchback vertion of Josephus Problem</a>, Yokohama Math. J. 53 (2007) 83, function f_k(n).
%H A335552 <a href="/index/J#nome">Index to sequences related to the Josephus problem</a>
%e A335552 The triangle starts
%e A335552    1
%e A335552    3   1
%e A335552    3   1   4
%e A335552    1   5   3   4
%e A335552    1   5   3   6   4
%e A335552    3   7   1   5   6   4
%e A335552    3   7   1   5   8   6   4
%e A335552    9   1   5   3   7   8   6   4
%e A335552    9   1   5   3   7  10   8   6   4
%e A335552   11   3   7   1   5   9  10   8   6   4
%e A335552   11   3   7   1   5   9  12  10   8   6   4
%e A335552    9   1  13   5   3   7  11  12  10   8   6   4
%e A335552    9   1  13   5   3   7  11  14  12  10   8   6   4
%e A335552   11   3  15   7   1   5   9  13  14  12  10   8   6   4
%e A335552   11   3  15   7   1   5   9  13  16  14  12  10   8   6   4
%e A335552    1  17   9  13   5   3   7  11  15  16  14  12  10   8   6   4
%e A335552    1  17   9  13   5   3   7  11  15  18  16  14  12  10   8   6   4
%e A335552    3  19  11  15   7   1   5   9  13  17  18  16  14  12  10   8   6   4
%e A335552    3  19  11  15   7   1   5   9  13  17  20  18  16  14  12  10   8   6   4
%p A335552 sigr := proc(n,r)
%p A335552     floor(n/2^r) ;
%p A335552 end proc:
%p A335552 # A063695
%p A335552 f := proc(n)
%p A335552     local ndigs,fn,k ;
%p A335552     ndigs := convert(n,base,2) ;
%p A335552     fn := 0 ;
%p A335552     for k from 2 to nops(ndigs) by 2 do
%p A335552         fn := fn+op(k,ndigs)*2^(k-1)
%p A335552     end do;
%p A335552     fn ;
%p A335552 end proc:
%p A335552 g := proc(t,n)
%p A335552     local r;
%p A335552     if t =1 then
%p A335552         0 ;
%p A335552     elif t > 1 then
%p A335552         r := ilog2( (n-1)/(t-1) ) ;
%p A335552         (-2)^r*(f( sigr(2*n-1,r) )+f( sigr(n-1,r) )-2*t+3) ;
%p A335552     end if;
%p A335552 end proc:
%p A335552 ft := proc(t,n)
%p A335552     f(n-1)+1+g(t,n) ;
%p A335552 end proc:
%p A335552 for n from 1 to 20 do
%p A335552     for t from 1 to n-1 do
%p A335552         printf("%3d ", ft(t,n)) ;
%p A335552     end do:
%p A335552     printf("\n") ;
%p A335552 end do:
%Y A335552 Cf. A090569 (column k=1).
%K A335552 nonn,tabl
%O A335552 1,2
%A A335552 _R. J. Mathar_, Jun 22 2020