OFFSET
0,3
COMMENTS
First differs from A349422 at a(101). - Sebastian Karlsson, Dec 31 2021
LINKS
Sebastian Karlsson, Table of n, a(n) for n = 0..10000
EXAMPLE
a(102345) = 004124 = 4124. For example, 4 gets replaced by 2 because moving 4 steps to the right gives: 4 -> 5 -> 1 -> 0 -> 2. Note that from 5 we went to the first digit of the number.
MATHEMATICA
Table[FromDigits@Table[v[[If[(p=Mod[k+v[[k]], t])==0, t, p]]], {k, t=Length[v=IntegerDigits[n]]}], {n, 0, 67}] (* Giorgos Kalogeropoulos, Oct 08 2021 *)
PROG
(Haskell)
import Data.Char (digitToInt)
a n = let s = show n; l = length s in
read [s !! (mod (i + digitToInt (s !! i)) l) | i <- [0..l-1]] :: Integer
(Python)
def a(n):
s, l = str(n), len(str(n))
return int("".join(s[(i + int(s[i])) % l] for i in range(l)))
(PARI) f(k, d) = d[(k+d[k]-1)%#d + 1];
a(n) = my(d=digits(n), dd=vector(#d, k, f(k, d))); fromdigits(dd); \\ Michel Marcus, Oct 07 2021
CROSSREFS
KEYWORD
AUTHOR
Sebastian Karlsson, Oct 05 2021
EXTENSIONS
a(68)-a(101) from Sebastian Karlsson, Dec 31 2021
STATUS
approved