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
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, 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, 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 (list; table; graph; refs; listen; history; text; internal format)
OFFSET

1,2

LINKS

Georg Fischer, Table of n, a(n) for n = 1..1000

K. Matsumoto, T. Nakamigawa, M. Watanabe, On the switchback vertion of Josephus Problem, Yokohama Math. J. 53 (2007) 83, function f_k(n).

Index to sequences related to the Josephus problem

EXAMPLE

The triangle starts

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 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 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 7 1 5 9 13 14 12 10 8 6 4

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

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

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

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

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

MAPLE

sigr := proc(n, r)

floor(n/2^r) ;

end proc:

# A063695

f := proc(n)

local ndigs, fn, k ;

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

fn := 0 ;

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

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

end do;

fn ;

end proc:

g := proc(t, n)

local r;

if t =1 then

0 ;

elif t > 1 then

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

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

end if;

end proc:

ft := proc(t, n)

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

end proc:

for n from 1 to 20 do

for t from 1 to n-1 do

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

end do:

printf("\n") ;

end do:

CROSSREFS

Cf. A090569 (column k=1).

Sequence in context: A201662 A274473 A280526 * A306841 A095660 A290080

Adjacent sequences: A335549 A335550 A335551 * A335553 A335554 A335555

KEYWORD

nonn,tabl

AUTHOR

R. J. Mathar, Jun 22 2020

STATUS

approved

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 March 22 22:02 EDT 2023. Contains 361434 sequences. (Running on oeis4.)