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.
%I A357217 #9 Sep 18 2022 11:22:15 %S A357217 1,1,2,1,1,3,1,2,2,4,1,1,1,2,5,1,2,2,2,1,6,1,1,1,2,1,1,7,1,2,2,2,1,2, %T A357217 4,8,1,1,3,2,3,3,3,2,9,1,2,2,2,3,2,2,2,1,10,1,1,1,2,1,3,3,2,3,5,11,1, %U A357217 2,2,2,3,2,2,4,5,2,2,12,1,1,1,2,3,1,3,2,3,1,3,2,13 %N A357217 Array read by descending antidiagonals: T(n,k) is the number of cycles of the permutation given by the order of elimination in the Josephus problem for n numbers and a count of k; n, k >= 1. %C A357217 n >= 2 is a Josephus_k prime if and only if T(n,k) = 1; see A163782-A163800. %H A357217 Pontus von Brömssen, <a href="/A357217/b357217.txt">Antidiagonals n = 1..100, flattened</a> %H A357217 James Dowdy and Michael E. Mays, <a href="https://www.researchgate.net/publication/266756060">Josephus permutations</a>, Journal of Combinatorial Mathematics and Combinatorial Computing 6 (1989), 125-130. %H A357217 Wikipedia, <a href="https://en.wikipedia.org/wiki/Josephus_problem">Josephus problem</a> %H A357217 <a href="https://oeis.org/wiki/Index_to_OEIS:_Section_J#Josephus">Index entries for sequences related to the Josephus Problem</a> %F A357217 T(n,k+A003418(n)) = T(n,k), i.e., the n-th row is periodic with period A003418(n). %e A357217 Array begins: %e A357217 n\k| 1 2 3 4 5 6 7 8 9 10 %e A357217 ---+------------------------------ %e A357217 1 | 1 1 1 1 1 1 1 1 1 1 %e A357217 2 | 2 1 2 1 2 1 2 1 2 1 %e A357217 3 | 3 2 1 2 1 2 3 2 1 2 %e A357217 4 | 4 2 2 2 2 2 2 2 2 2 %e A357217 5 | 5 1 1 1 3 3 1 3 3 3 %e A357217 6 | 6 1 2 3 2 3 2 1 2 3 %e A357217 7 | 7 4 3 2 3 2 3 2 5 2 %e A357217 8 | 8 2 2 2 4 2 2 4 6 2 %e A357217 9 | 9 1 3 5 3 3 3 3 3 3 %e A357217 10 | 10 5 2 1 2 3 2 1 2 3 %e A357217 For n = 4, k = 2, the order of elimination is (2,4,3,1) (row 4 of A321298). This permutation has two cycles, (1 2 4) and (3), so T(4,2) = 2. %o A357217 (Python) %o A357217 from sympy.combinatorics import Permutation %o A357217 def A357217(n,k): %o A357217 return Permutation.josephus(k,n).cycles %Y A357217 Cf. A003418, A006694 (column k=2), A163782-A163800 (Josephus primes), A198789, A321298 (the Josephus permutations for k=2). %K A357217 nonn,tabl %O A357217 1,3 %A A357217 _Pontus von Brömssen_, Sep 18 2022