cp's OEIS Frontend

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.

A360268 A version of the 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 5 places clockwise from i. Repeat, counting 5 places from the next undeleted integer, until only one integer remains.

This page as a plain text file.
%I A360268 #51 Mar 17 2023 07:23:32
%S A360268 1,1,1,3,4,4,3,1,7,3,9,3,9,1,7,13,2,8,14,20,5,11,17,23,4,10,16,22,28,
%T A360268 4,10,16,22,28,34,4,10,16,22,28,34,40,3,9,15,21,27,33,39,45,51,5,11,
%U A360268 17,23,29,35,41,47,53,59,3,9,15,21,27,33,39,45,51,57,63,69,1,7,13,19,25
%N A360268 A version of the 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 5 places clockwise from i. Repeat, counting 5 places from the next undeleted integer, until only one integer remains.
%H A360268 Wikipedia, <a href="http://en.wikipedia.org/wiki/Josephus_problem">Josephus problem</a>.
%H A360268 <a href="/index/J#Josephus">Index entries for sequences related to the Josephus Problem</a>.
%F A360268 a(n) = (a(n-1) + 5) mod n + 1 if n > 1, a(1) = 1.
%e A360268 a(7) = 3 because the elimination process gives (^1,2,3,4,5,6,7) -> (1,2,3,4,5,^7) -> (1,2,3,4,^7) -> (^1,2,3,4) -> (1,^3,4) -> (^3,4) -> (3), where ^ denotes the counting reference position.
%e A360268 a(13) = 9 => a(14) = (a(13) + 5) mod 14 + 1 = 1.
%t A360268 a[1] = 1; a[n_] := a[n] = Mod[a[n - 1] + 5, n] + 1; Array[a, 100] (* _Amiram Eldar_, Feb 03 2023 *)
%o A360268 (Python)
%o A360268 def A360268_up_to_n(n):
%o A360268   val = 1
%o A360268   return [val := (val + 5) % i + 1 for i in range(1,n+1)]
%Y A360268 6th column of A198789.
%Y A360268 Cf. A006257, A054995, A088333, A181281.
%K A360268 nonn
%O A360268 1,4
%A A360268 _Benjamin Lilley_, Jan 31 2023