The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A274580 Digital difference of n: the most significant decimal digit of n minus the sum of the other digits. 0
 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 0, -1, -2, -3, -4, -5, -6, -7, -8, 2, 1, 0, -1, -2, -3, -4, -5, -6, -7, 3, 2, 1, 0, -1, -2, -3, -4, -5, -6, 4, 3, 2, 1, 0, -1, -2, -3, -4, -5, 5, 4, 3, 2, 1, 0, -1, -2, -3, -4, 6, 5, 4, 3, 2, 1, 0, -1, -2, -3, 7, 6, 5, 4, 3, 2, 1 (list; graph; refs; listen; history; text; internal format)
 OFFSET 1,2 COMMENTS If A007953(n) is seen as giving the resulting sum when inserting "+" signs between the digits of n, then a(n) gives the resulting difference when inserting "-" signs between the digits of n. a(n) = 0 if and only if n is in A193772. Signed version of A040997. First differs from A225693 at n = 101. abs(a(n)) first differs from abs(A055017(n)) at n = 102. LINKS FORMULA a(n) = A000030(n) - A007953(A217657(n)). EXAMPLE a(13) = 1 - 3 = -2. a(74) = 7 - 4 = 3. a(211) = 2 - 1 - 1 = 0. MATHEMATICA Table[Fold[#1 - #2 &, IntegerDigits@ n], {n, 76}] (* Michael De Vlieger, Jun 30 2016 *) PROG (PARI) diffdigits(n) = my(d=digits(n), dd=d[1]); for(k=2, #d, dd=dd-d[k]); dd a(n) = diffdigits(n) CROSSREFS Cf. A007953, A007954. Sequence in context: A189823 A325479 A001073 * A241494 A076313 A055017 Adjacent sequences:  A274577 A274578 A274579 * A274581 A274582 A274583 KEYWORD sign,easy,base AUTHOR Felix FrÃ¶hlich, Jun 29 2016 STATUS approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

Last modified January 27 17:58 EST 2020. Contains 331296 sequences. (Running on oeis4.)