OFFSET
1,5
LINKS
FORMULA
a(n) = n mod A034968(n).
MATHEMATICA
a[n_] := Module[{k = n, m = 2, r, s = 0}, While[{k, r} = QuotientRemainder[k, m]; k != 0|| r != 0, s += r; m++]; Mod[n, s]]; Array[a, 100] (* Amiram Eldar, Feb 21 2024 *)
PROG
(Python)
def a007623(n, p=2): return n if n<p else a007623(n//p, p+1)*10 + n%p
def a(n):
return n % sum(int(k) for k in str(a007623(n)))
print([a(n) for n in range(1, 201)]) # Indranil Ghosh, Jun 21 2017
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Antti Karttunen, Jun 18 2017
STATUS
approved