login
A380714
a(n) = n*(n-1) mod (10^m-1) where m is the number of decimal digits in n.
1
0, 2, 6, 3, 2, 3, 6, 2, 0, 90, 11, 33, 57, 83, 12, 42, 74, 9, 45, 83, 24, 66, 11, 57, 6, 56, 9, 63, 20, 78, 39, 2, 66, 33, 2, 72, 45, 20, 96, 75, 56, 39, 24, 11, 0, 90, 83, 78, 75, 74, 75, 78, 83, 90, 0, 11, 24, 39, 56, 75, 96, 20, 45, 72, 2, 33, 66
OFFSET
1,2
COMMENTS
a(n) = 0 if and only if n is a Kaprekar number (A053816).
LINKS
Giorgos Kalogeropoulos, Table of n, a(n) for n = 1..9999
FORMULA
a(n) = A002378(n-1) mod A002283(A055642(n)).
MAPLE
a:= n-> n*(n-1) mod (10^length(n)-1):
seq(a(n), n=1..67); # Alois P. Heinz, Mar 27 2025
MATHEMATICA
Table[Mod[n(n-1), 10^IntegerLength@n - 1], {n, 67}]
PROG
(Python)
def a(n): return n*(n-1)%(10**len(str(n))-1)
print([a(n) for n in range(1, 68)]) # Michael S. Branicky, Mar 27 2025
CROSSREFS
KEYWORD
nonn,base,look
AUTHOR
STATUS
approved