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.

A357531 Final value obtained by traveling clockwise around a circular array with positions numbered clockwise from 1 to n. Each move consists of traveling clockwise k places, where k is the position at the beginning of the move. The first move begins at position 1. a(n) is the position at the end of the n-th move.

This page as a plain text file.
%I A357531 #68 Apr 27 2024 09:37:44
%S A357531 1,2,2,4,2,4,2,8,8,4,2,4,2,4,8,16,2,10,2,16,8,4,2,16,7,4,26,16,2,4,2,
%T A357531 32,8,4,18,28,2,4,8,16,2,22,2,16,17,4,2,16,30,24,8,16,2,28,43,32,8,4,
%U A357531 2,16,2,4,8,64,32,64,2,16,8,44,2,64,2,4,68,16,18,64,2,16,80,4,2,64,32,4,8,80
%N A357531 Final value obtained by traveling clockwise around a circular array with positions numbered clockwise from 1 to n. Each move consists of traveling clockwise k places, where k is the position at the beginning of the move. The first move begins at position 1. a(n) is the position at the end of the n-th move.
%C A357531 This is only an empirical observation, but when we graph this sequence, a point always exists at the intersection of y = 2^b and y = -x + 2^(b+1), where b is any integer greater than or equal to 1. This means that a(2^b) = 2^b. This is shown in a link.
%C A357531 Many of the terms seem to be of the form 2^b.
%H A357531 Moosa Nasir, <a href="https://raw.githubusercontent.com/TealEgg/MoosaNasir/main/Examplen5v2.png">Example of a(5) = 2</a>
%H A357531 Moosa Nasir, <a href="https://raw.githubusercontent.com/TealEgg/MoosaNasir/main/Intersections.png">a(2^b) = 2^b</a>
%F A357531 a(n) = ((2^n - 1) mod n) + 1 = A082495(n) + 1. - _Jon E. Schoenfield_, Nov 20 2022
%e A357531 For n = 5, with a circular array of positions numbered clockwise from 1 to 5, start at position 1.
%e A357531 On move 1, travel 1 unit clockwise, reaching position 2.
%e A357531 On move 2, travel 2 units clockwise, reaching position 4.
%e A357531 On move 3, travel 4 units clockwise (almost a full circle), reaching position 3.
%e A357531 On move 4, travel 3 units clockwise, reaching position 1.
%e A357531 On move 5, travel 1 unit clockwise, reaching position 2.
%e A357531 Since the final position at the end of the 5th move is 2, a(5) = 2. (See the illustration in the links.)
%o A357531 (C)
%o A357531 int a(int n)
%o A357531 {
%o A357531     int current = 1;
%o A357531     for (int j = 0; j < n; j++) {
%o A357531         current += current;
%o A357531         if (current > n) {
%o A357531             current = current - n;
%o A357531         }
%o A357531     }
%o A357531     return current;
%o A357531 }
%o A357531 (PARI) a(n) = lift(Mod(2,n)^n - 1) + 1; \\ _Kevin Ryde_, Nov 20 2022
%o A357531 (Python)
%o A357531 def A357531(n): return m if (m:=pow(2,n,n)) else n # _Chai Wah Wu_, Dec 01 2022
%Y A357531 Cf. A015910, A082495.
%Y A357531 Cf. A358647 (stepping in digits of n).
%Y A357531 Equals {A082495} + 1. - _Hugo Pfoertner_, Nov 30 2022
%K A357531 nonn,easy
%O A357531 1,2
%A A357531 _Moosa Nasir_, Nov 19 2022