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!)
 A256851 First-order differences for the cumulative sum of the digits of the integers when alternately adding and subtracting each digit of a particular value. 2
 1, 2, 3, 4, 5, 6, 7, 8, 9, -1, 0, -1, -4, -3, -6, -5, -8, -7, -10, 2, -1, 0, 5, 2, 7, 4, 9, 6, 11, -3, 2, -5, 0, -1, -8, -3, -10, -5, -12, 4, -3, 6, -1, 0, 9, 2, 11, 4, 13, -5, 4, -7, 2, -9, 0, -1, -12, -3, -14, 6, -5, 8, -3, 10, -1, 0, 13, 2, 15, -7, 6, -9, 4, -11, 2, -13, 0, -1, -16, 8, -7, 10, -5, 12, -3, 14, -1, 0, 17, -9, 8, -11, 6, -13, 4, -15 (list; graph; refs; listen; history; text; internal format)
 OFFSET 1,2 COMMENTS The sequence was suggested by Wolfdieter Lang and represents a(n) - a(n-1) for the sequence A256379, which alternately adds and subtracts each digit of a particular value in the integers. LINKS Anthony Sand, Table of n, a(n) for n = 1..1000 FORMULA a(n) = Sum_{m=1..r(n)} ((-1)^(a(n,m) + 1)* digit(n,m), where a(n,m) = A256100(n,m) read as an array with row length r(n) (number of digits of n), and digit(n,m) is the m-th digit of n (see the formula for A256379). - Wolfdieter Lang, Apr 15 2015 EXAMPLE a(0) = 0, therefore a(1) - a(0) = 1 - 0 = 1. For n = 1..9, the function is encountering each digit for the first time, therefore a(9) = 45. For n = 10, the function encounters the digit 1 for the second time and subtracts it. Therefore a(10) = 44 and a(10) - a(9) = -1. PROG (PARI) { nmx=1000; b=10; dig=vector(b); si=0; for(i=1, b, dig[i]=1); n=0; s=0; while(n

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 July 4 01:48 EDT 2020. Contains 335436 sequences. (Running on oeis4.)