OFFSET
1,2
FORMULA
a(1) = d(1) = 2; a(n) = a(n-1) + (-1)^(n+1) d(n) for n > 1.
EXAMPLE
a(3) = d(1) - d(2) + d(3) = 1 - 6 + 1 = -4.
MATHEMATICA
S[X_, n_] :=
Accumulate[(-1)^Range[0, n - 1]*RealDigits[X, 10, n][[1]]]
S[GoldenRatio, 54] (*This generates the first 54 elements of this sequence*)
CROSSREFS
KEYWORD
base,easy,sign,less
AUTHOR
Dirk Broeders, Oct 14 2020
STATUS
approved