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 A187788 #30 Jan 19 2023 09:35:17 %S A187788 2,5,2,4,3,11,2,3,8,16,4,21,6,5,2,11,20,34,8,15,10,7,13,11,13,45,18, %T A187788 23,8,3,2,25,75,42,13,5,23,13,50,16,18,89,38,8,39,30,29,38,7,45,23, %U A187788 137,46,63,17,48,5,46,34,140,33,39,2,28,29,79,33,48,3,10,46,120,6,37,17,8,44,15,160,20,35,144,104,179,153,24,8,265,19,9,62,7,139,19,44,93,182,27,158,185 %N A187788 a(n) is the least step for the Sankt-Petrus-game with n white and n black stones. %C A187788 Beginning at the position A187789(n) with step a(n), (n-1) white stones were eliminated; then from the position 1 of the last white stone, n black stones were eliminated. %D A187788 W. Ahrens, Das Josephusspiel, Archiv für Kulturgeschichte, Jg 11(1913), 129-151. %H A187788 R. Baumann, <a href="https://www.yumpu.com/de/document/read/460296/nr-165">Das Josephus-Problem</a>, LOG IN, Heft Nr. 165, pp. 68-71, 2010 (in German). %H A187788 <a href="/index/J#Josephus">Index entries for sequences related to the Josephus Problem</a> %e A187788 n=4; WBWWBBWB; startposition=A187789(4)=8; least step=a(4)=4; elimination: white stones: {3,7,4}; black stones: {6,5,8,2}. %p A187788 s:=1: M:={}: %p A187788 for n from 1 to 100 do M:=M union {n}: %p A187788 while (M <> {}) do %p A187788 s1:=s: s:=s+1: f[1]:=1: %p A187788 for n from 2 to 101 do n1:=n-1: %p A187788 f[n]:=(f[n1]+s1) mod n +1: %p A187788 if (f[n]=1) and (n1 in M) then %p A187788 a[n1]:=s: M:=M minus {n1}: %p A187788 end if: %p A187788 end do: %p A187788 end do: %Y A187788 Cf. A187789, A206602. %Y A187788 First column in A321781. %K A187788 nonn %O A187788 1,1 %A A187788 _Paul Weisenhorn_, Jan 06 2013