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.

Showing 1-1 of 1 results.

A358647 Final digit reached by traveling right (with wraparound) through the digits of n. Each move steps right k places, where k is the digit at the beginning of the move. Moves begin at the most significant digit and d moves are made, where d is the number of digits in n.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 1, 4, 1, 6, 1, 8, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 3, 2, 3, 4, 3, 6, 3, 8, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0, 5, 2, 5, 4, 5, 6, 5, 8, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 0, 7, 2, 7, 4, 7, 6, 7, 8, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 0, 9, 2, 9, 4, 9, 6, 9, 8, 9
Offset: 0

Views

Author

Moosa Nasir, Nov 24 2022

Keywords

Examples

			For n = 11323, start at the most significant digit, which is 1.
On move 1, travel 1 unit right, reaching the second digit 1.
On move 2, travel 1 unit right, reaching the middle digit 3.
On move 3, travel 3 units right (wrapping around), reaching the most significant 1 digit again.
On move 4, travel 1 unit right, reaching the second digit 1 (again).
On move 5, travel 1 unit right, reaching the middle digit 3 (again).
Thus, a(11323) = 3.
		

Crossrefs

Cf. A357531 (stepping in 1..n).

Programs

  • Python
    def A358647(n):
        s = list(map(int,str(n)))
        l, i = len(s), 0
        for _ in range(l):
             i = (i+s[i])%l
        return s[i] # Chai Wah Wu, Nov 30 2022
Showing 1-1 of 1 results.