login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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. 1

%I #49 Jun 27 2020 05:10:52

%S 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 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 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 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 Georg Fischer, <a href="/A335552/b335552.txt">Table of n, a(n) for n = 1..1000</a>

%H 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 <a href="/index/J#nome">Index to sequences related to the Josephus problem</a>

%e The triangle starts

%e 1

%e 3 1

%e 3 1 4

%e 1 5 3 4

%e 1 5 3 6 4

%e 3 7 1 5 6 4

%e 3 7 1 5 8 6 4

%e 9 1 5 3 7 8 6 4

%e 9 1 5 3 7 10 8 6 4

%e 11 3 7 1 5 9 10 8 6 4

%e 11 3 7 1 5 9 12 10 8 6 4

%e 9 1 13 5 3 7 11 12 10 8 6 4

%e 9 1 13 5 3 7 11 14 12 10 8 6 4

%e 11 3 15 7 1 5 9 13 14 12 10 8 6 4

%e 11 3 15 7 1 5 9 13 16 14 12 10 8 6 4

%e 1 17 9 13 5 3 7 11 15 16 14 12 10 8 6 4

%e 1 17 9 13 5 3 7 11 15 18 16 14 12 10 8 6 4

%e 3 19 11 15 7 1 5 9 13 17 18 16 14 12 10 8 6 4

%e 3 19 11 15 7 1 5 9 13 17 20 18 16 14 12 10 8 6 4

%p sigr := proc(n,r)

%p floor(n/2^r) ;

%p end proc:

%p # A063695

%p f := proc(n)

%p local ndigs,fn,k ;

%p ndigs := convert(n,base,2) ;

%p fn := 0 ;

%p for k from 2 to nops(ndigs) by 2 do

%p fn := fn+op(k,ndigs)*2^(k-1)

%p end do;

%p fn ;

%p end proc:

%p g := proc(t,n)

%p local r;

%p if t =1 then

%p 0 ;

%p elif t > 1 then

%p r := ilog2( (n-1)/(t-1) ) ;

%p (-2)^r*(f( sigr(2*n-1,r) )+f( sigr(n-1,r) )-2*t+3) ;

%p end if;

%p end proc:

%p ft := proc(t,n)

%p f(n-1)+1+g(t,n) ;

%p end proc:

%p for n from 1 to 20 do

%p for t from 1 to n-1 do

%p printf("%3d ", ft(t,n)) ;

%p end do:

%p printf("\n") ;

%p end do:

%Y Cf. A090569 (column k=1).

%K nonn,tabl

%O 1,2

%A _R. J. Mathar_, Jun 22 2020

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 25 11:39 EDT 2024. Contains 371969 sequences. (Running on oeis4.)