login
A309531
a(n) = Sum_{k=2..n} (-1)^k * A240236(n, k).
3
1, 1, 0, 0, 2, 2, -3, 1, 5, 5, -2, -2, 4, 10, -6, -6, 1, 1, -8, 0, 10, 10, -16, -8, 4, 18, 7, 7, 13, 13, -19, -7, 9, 19, -11, -11, 7, 21, -15, -15, -5, -5, -20, 10, 32, 32, -36, -24, -1, 17, 0, 0, 18, 32, -14, 6, 34, 34, -23, -23, 7, 45, -29, -13, 5, 5, -16, 8, 30, 30, -66
OFFSET
2,5
LINKS
FORMULA
a(n) = a(n-1) if and only if n is an odd prime.
EXAMPLE
a(2) = 1.
a(3) = 2 - 1 = 1.
a(4) = 1 - 2 + 1 = 0.
a(5) = 2 - 3 + 2 - 1 = 0.
a(6) = 2 - 2 + 3 - 2 + 1 = 2.
PROG
(PARI) {a(n) = sum(k=2, n, (-1)^k*sumdigits(n, k))}
CROSSREFS
KEYWORD
sign,base
AUTHOR
Seiichi Manyama, Aug 06 2019
STATUS
approved