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 A181281 #20 Jun 23 2020 18:35:36 %S A181281 1,2,1,2,2,1,6,3,8,3,8,1,6,11,1,6,11,16,2,7,12,17,22,3,8,13,18,23,28, %T A181281 3,8,13,18,23,28,33,1,6,11,16,21,26,31,36,41,46,4,9,14,19,24,29,34,39, %U A181281 44,49,54,1,6,11,16,21,26,31,36,41,46,51,56,61,66,71,3,8,13,18,23,28,33,38 %N A181281 A version of Josephus problem: a(n) is the surviving integer under the following elimination process. Arrange 1,2,3,...,n in a circle, increasing clockwise. Starting with i=1, delete the integer 4 places clockwise from i. Repeat, counting 4 places from the next undeleted integer, until only one integer remains. %D A181281 Paul Weisenhorn, Josephus und seine Folgen, MNU Journal (Der mathematische und naturwissenschaftliche Unterricht), 59 (2006), 18-19. %H A181281 <a href="/index/J#Josephus">Index entries for sequences related to the Josephus Problem</a> %F A181281 a(n) = (a(n-1) + 4) mod n + 1 if n>1, a(1) = 1. %e A181281 a(7) = 6: (^1,2,3,4,5,6,7) -> (1,2,3,4,^6,7) -> (1,2,^4,6,7) -> (1,^4,6,7) -> (1,^6,7) -> (^1,6) -> (^6). %e A181281 a(14) = 11 => a(15) = (a(14)+4) mod 15 + 1 = 1. %p A181281 a:= proc(n) option remember; %p A181281 `if` (n=1, 1, (a(n-1)+4) mod n +1) %p A181281 end: %p A181281 seq (a(n), n=1..100); %t A181281 a[1] = 1; a[n_] := a[n] = Mod[a[n-1]+4, n]+1; Table[a[n], {n, 1, 80}] (* _Jean-François Alcover_, Oct 18 2013 *) %Y A181281 Cf. A006257, A054995, A088333. %K A181281 nonn %O A181281 1,2 %A A181281 _Paul Weisenhorn_, Oct 10 2010 %E A181281 Edited by _Alois P. Heinz_, Sep 06 2011