login
A103168
a(n) is the remainder when (n written backwards) is divided by n.
6
0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 9, 5, 13, 6, 13, 3, 9, 15, 2, 12, 0, 9, 18, 2, 10, 18, 26, 5, 3, 13, 23, 0, 9, 18, 27, 36, 7, 15, 4, 14, 24, 34, 0, 9, 18, 27, 36, 45, 5, 15, 25, 35, 45, 0, 9, 18, 27, 36, 6, 16, 26, 36, 46, 56, 0, 9, 18, 27, 7, 17, 27, 37, 47, 57, 67, 0, 9, 18, 8, 18, 28, 38
OFFSET
1,12
LINKS
EXAMPLE
a(n) = 0 for palindromic numbers.
MATHEMATICA
rd[x_]:=FromDigits[Reverse[IntegerDigits[x]]] Table[Mod[rd[n], n], {n, 1, 256}]
PROG
(PARI) a(n, base=10) = my (r=fromdigits(Vecrev(digits(n, base)), base)); r%n \\ Rémy Sigrist, Apr 05 2020
(Python)
def a(n): return int(str(n)[::-1])%n
print([a(n) for n in range(1, 84)]) # Michael S. Branicky, Dec 12 2021
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Labos Elemer, Jan 28 2005
EXTENSIONS
Definition corrected by N. J. A. Sloane, Jul 14 2007
STATUS
approved