login
a(n) = one-based position in the round in which n is removed in the Flavius sieve, 0 if n is never removed (when n is one of the terms of A000960).
6

%I #15 Jun 23 2020 10:27:46

%S 0,1,0,2,1,3,0,4,1,5,2,6,0,7,1,8,3,9,0,10,2,11,4,12,1,13,0,14,5,15,1,

%T 16,3,17,6,18,2,19,0,20,7,21,1,22,4,23,8,24,0,25,2,26,9,27,3,28,5,29,

%U 10,30,1,31,0,32,11,33,1,34,6,35,12,36,2,37,4,38,13,39,0,40,7,41,14,42,3,43,1,44,15,45,0,46,8,47,16,48,5,49,2,50,17,51,1,52

%N a(n) = one-based position in the round in which n is removed in the Flavius sieve, 0 if n is never removed (when n is one of the terms of A000960).

%C a(n) = index of the column where n is located in array A278507, 0 if n does not occur there (when n is one of the terms of A000960).

%H Antti Karttunen, <a href="/A278529/b278529.txt">Table of n, a(n) for n = 1..10707</a>

%H <a href="/index/J#Josephus">Index entries for sequences related to the Josephus Problem</a>

%F For n > 1, a(A100287(n)) = 1.

%o (Scheme)

%o ;; Very crude. Find it with two nested loops. (Maybe a closed form exists?)

%o (define (A278529 n) (cond ((not (zero? (A278169 n))) 0) ((even? n) (/ n 2)) (else (let searchrow ((row 2)) (let searchcol ((col 1)) (cond ((>= (A278507bi row col) n) (if (= (A278507bi row col) n) col (searchrow (+ 1 row)))) (else (searchcol (+ 1 col)))))))))

%o ;; Code for A278507bi given in A278507.

%Y One less than A278539.

%Y Cf. A278507, A278528 (the other index).

%Y Cf. A000960 (positions of zeros), A100287 (positions of 1's, after the initial 1).

%K nonn

%O 1,4

%A _Antti Karttunen_, Nov 23 2016