cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A274580 Digital difference of n: the most significant decimal digit of n minus the sum of the other digits.

This page as a plain text file.
%I A274580 #12 Dec 27 2022 15:21:54
%S A274580 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,
%T A274580 -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,
%U A274580 -1,-2,-3,-4,6,5,4,3,2,1,0,-1,-2,-3,7,6,5,4,3,2,1
%N A274580 Digital difference of n: the most significant decimal digit of n minus the sum of the other digits.
%C A274580 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.
%C A274580 a(n) = 0 if and only if n is in A193772.
%C A274580 Signed version of A040997.
%C A274580 First differs from A225693 at n = 101.
%C A274580 abs(a(n)) first differs from abs(A055017(n)) at n = 102.
%F A274580 a(n) = A000030(n) - A007953(A217657(n)).
%e A274580 a(13) = 1 - 3 = -2.
%e A274580 a(74) = 7 - 4 = 3.
%e A274580 a(211) = 2 - 1 - 1 = 0.
%t A274580 Table[Fold[#1 - #2 &, IntegerDigits@ n], {n, 76}] (* _Michael De Vlieger_, Jun 30 2016 *)
%t A274580 Table[-Differences[(Total/@TakeDrop[IntegerDigits[n],1])],{n,100}]//Flatten (* _Harvey P. Dale_, Dec 27 2022 *)
%o A274580 (PARI) diffdigits(n) = my(d=digits(n), dd=d[1]); for(k=2, #d, dd=dd-d[k]); dd
%o A274580 a(n) = diffdigits(n)
%Y A274580 Cf. A007953, A007954.
%K A274580 sign,easy,base
%O A274580 1,2
%A A274580 _Felix Fröhlich_, Jun 29 2016