[go: up one dir, main page]

login
A281066
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
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, 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, 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
OFFSET
1,6
LINKS
FORMULA
a(n) = A138793(n) (mod n).
EXAMPLE
a(13) = 31211101987654321 (mod 13) = 5.
MATHEMATICA
f[n_] := Mod[ FromDigits@ Fold[ Join[ Reverse@ IntegerDigits@#2, #1] &, {}, Range@ n], n]; Array[f, 80]
PROG
(Python)
def A281066(n):
s=""
for i in range(n, 0, -1):
s+=str(i)[::-1]
return int(s)%n # Indranil Ghosh, Jan 28 2017
(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
CROSSREFS
KEYWORD
nonn,easy,look,base
AUTHOR
Robert G. Wilson v, Jan 14 2017
STATUS
approved