login
Concatenation R(n)R(n-1)R(n-2)...R(2)R(1) read mod n, where R(x) is the digit-reversal of x (with leading zeros not omitted).
2

%I #37 Sep 21 2024 20:27:18

%S 0,1,0,1,1,3,3,1,0,1,4,9,5,7,6,1,6,9,17,1,15,15,19,9,21,1,18,13,28,21,

%T 26,17,15,3,16,9,30,3,15,1,1,33,10,37,36,43,22,33,19,21,48,45,2,45,26,

%U 49,27,33,33,21,48,25,36,49,36,15,22,5,27,11,42,9,2,73,21,17,59,57,5,1

%N Concatenation R(n)R(n-1)R(n-2)...R(2)R(1) read mod n, where R(x) is the digit-reversal of x (with leading zeros not omitted).

%H Indranil Ghosh, <a href="/A281066/b281066.txt">Table of n, a(n) for n = 1..20008</a>

%F a(n) = A138793(n) (mod n).

%e a(13) = 31211101987654321 (mod 13) = 5.

%t f[n_] := Mod[ FromDigits@ Fold[ Join[ Reverse@ IntegerDigits@#2, #1] &, {}, Range@ n], n]; Array[f, 80]

%o (Python)

%o def A281066(n):

%o s=""

%o for i in range(n, 0, -1):

%o s+=str(i)[::-1]

%o return int(s)%n # _Indranil Ghosh_, Jan 28 2017

%o (PARI) a(n) = my(s = ""); forstep (k=n,1,-1, sk = digits(k); forstep (j=#sk, 1, -1, s = concat(s, sk[j]))); eval(s) % n; \\ _Michel Marcus_, Jan 28 2017

%Y Cf. A004086, A061963, A095221, A114795, A138793.

%K nonn,easy,look,base

%O 1,6

%A _Robert G. Wilson v_, Jan 14 2017