OFFSET
1,1
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..1000
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) = 2 - 7 + 1 = -4.
MATHEMATICA
S[X_, n_] :=
Module[{f},
f[1] = First[RealDigits[ X, 10, 1]][[1]];
f[i_] :=
f[i] = (-1)^(i + 1) First[RealDigits[ X, 10, i]][[i]] + f[i - 1];
Table[f[m], {m, 1, n}]
]
S[E, 20] (* Generates the first 20 elements of the series *)
Accumulate[Times@@@Partition[Riffle[RealDigits[E, 10, 100][[1]], {1, -1}], 2]] (* Harvey P. Dale, May 08 2021 *)
CROSSREFS
KEYWORD
base,easy,sign
AUTHOR
Dirk Broeders, Oct 10 2020
STATUS
approved