|
|
A338108
|
|
Numbers that follow from the alternating series a(n) = d(1) - d(2) + d(3) - d(4) + ... + (-1)^(n+1) d(n), where d(k) denotes the k-th term of the digit sequence of Euler's number e.
|
|
2
|
|
|
2, -5, -4, -12, -10, -18, -17, -25, -23, -31, -27, -32, -23, -23, -19, -24, -22, -25, -20, -23, -17, -17, -15, -23, -16, -20, -13, -14, -11, -16, -14, -20, -14, -16, -12, -21, -14, -21, -16, -23, -21, -25, -18, -18, -9, -12, -6, -15, -6, -15, -10, -19, -14, -21
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
LINKS
|
|
|
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
|
|
|
STATUS
|
approved
|
|
|
|