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

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A040997 Absolute value of first digit of n minus sum of other digits of n. 15

%I

%S 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,

%T 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,

%U 3,7,6,5,4,3,2,1,0,1,2,8,7,6,5,4,3,2,1,0,1,9,8,7,6,5,4,3,2,1,0,1,0,1,2,3,4,5,6,7

%N Absolute value of first digit of n minus sum of other digits of n.

%C This is different from |A055017(n)| = |(x1 + x3 + ...) - (x2 + x4 + ...)|, where x1,...,xk are the digits of n. - _M. F. Hasler_, Nov 09 2019

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

%F If decimal expansion of n is x1 x2 ... xk then a(n) = |x1-x2-x3- ... -xk|.

%F a(n) = abs(A000030(n) - A007953(A217657(n)). - _Reinhard Zumkeller_, Oct 10 2012

%e a(371) = |3-7-1| = 5.

%o (Haskell) a040997 n = abs $ a000030 n - a007953 (a217657 n) -- _Reinhard Zumkeller_, Oct 10 2012

%o (PARI) apply( A040997(n)={abs(vecsum(n=digits(n))-n[1]*2)}, [1..199]) \\ _M. F. Hasler_, Nov 09 2019

%Y Cf. A037904, A040114, A040115, A040163.

%K nonn,base

%O 1,2

%A _Felice Russo_

%E Name edited and incorrect formula deleted by _M. F. Hasler_, Nov 09 2019

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.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 31 21:42 EDT 2020. Contains 334748 sequences. (Running on oeis4.)