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.
%I A040997 #33 Aug 09 2024 01:54:57 %S A040997 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 A040997 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 A040997 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,8,0,1,2,3,4,5,6,7,8,9,1,2,3,4,5,6,7,8,9,10 %N A040997 Absolute value of first digit of n minus sum of other digits of n. %C A040997 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 A040997 Reinhard Zumkeller, <a href="/A040997/b040997.txt">Table of n, a(n) for n = 1..10000</a> %F A040997 If decimal expansion of n is x1 x2 ... xk then a(n) = |x1-x2-x3- ... -xk|. %F A040997 a(n) = abs(A000030(n) - A007953(A217657(n))). - _Reinhard Zumkeller_, Oct 10 2012 %e A040997 a(371) = |3-7-1| = 5. %o A040997 (Haskell) a040997 n = abs $ a000030 n - a007953 (a217657 n) -- _Reinhard Zumkeller_, Oct 10 2012 %o A040997 (PARI) apply( A040997(n)={abs(vecsum(n=digits(n))-n[1]*2)}, [1..199]) \\ _M. F. Hasler_, Nov 09 2019 %Y A040997 Cf. A037904, A040114, A040115, A040163, A055017. %Y A040997 Cf. A000030, A007953, A217657. %K A040997 nonn,base,easy %O A040997 1,2 %A A040997 _Felice Russo_ %E A040997 Name edited and incorrect formula deleted by _M. F. Hasler_, Nov 09 2019