login
a(n) = n mod (sum of digits of n).
14

%I #40 Feb 16 2024 10:21:45

%S 0,0,0,0,0,0,0,0,0,0,1,0,1,4,3,2,1,0,9,0,0,2,3,0,4,2,0,8,7,0,3,2,3,6,

%T 3,0,7,5,3,0,1,0,1,4,0,6,3,0,10,0,3,3,5,0,5,1,9,6,3,0,5,6,0,4,10,6,2,

%U 12,9,0,7,0,3,8,3,11,7,3,15,0,0,2,6,0,7,2,12,8

%N a(n) = n mod (sum of digits of n).

%H Reinhard Zumkeller, <a href="/A070635/b070635.txt">Table of n, a(n) for n = 1..10000</a>

%F a(A005349(n)) = 0. - _Reinhard Zumkeller_, Mar 10 2008

%F A188641(n) = A000007(a(n)); a(A065877(n)) > 0. - _Reinhard Zumkeller_, Apr 07 2011

%F a(A138791(n)) = n and a(m) <> n for m < A138791(n). - _Reinhard Zumkeller_, Nov 07 2011

%t Table[Mod[n,Total[IntegerDigits[n]]],{n,100}] (* _Harvey P. Dale_, Mar 11 2013 *)

%o (Haskell)

%o a070635 n = n `mod` (a007953 n)

%o -- _Reinhard Zumkeller_, Apr 07 2011

%o (PARI) a(n) = n % sumdigits(n); \\ _Michel Marcus_, Dec 30 2015

%o (Magma) [n mod (&+Intseq(n)): n in [1..100]]; // _Vincenzo Librandi_, Dec 30 2015

%Y Cf. A007953.

%Y Cf. A199238.

%K nonn,base

%O 1,14

%A _Reinhard Zumkeller_, May 13 2002