login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A297158
Ludic ladder sequence: a(n) = Sum_{k=1..n} (-1)^LudicPi(k), where LudicPi(n) = A192512(n)-1 gives the number of Ludic numbers > 1 and <= n.
2
0, 1, 0, 1, 2, 1, 0, 1, 2, 3, 4, 3, 2, 3, 4, 5, 6, 5, 4, 3, 2, 1, 0, 1, 2, 1, 0, -1, -2, -1, 0, 1, 2, 3, 4, 5, 6, 5, 4, 3, 2, 3, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 5, 4, 3, 2, 1, 0, -1, -2, -1, 0, 1, 2, 3, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 5, 4, 5, 6, 7, 8, 9, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1
OFFSET
0,5
COMMENTS
This is an analogous sequence to A065358, but involving Ludic numbers (A003309) instead of primes. Compare the scatter-plots.
FORMULA
a(n) = Sum_{k=1..n} (-1)^(A192512(k)-1).
PROG
(Scheme, with memoization-macro definec)
(definec (A297158 n) (if (zero? n) n (+ (expt -1 (+ -1 (A192512 n))) (A297158 (- n 1)))))
CROSSREFS
Differs from A065358 for the first time at n=19, where a(19) = 3, while A065358(19) = 5.
Sequence in context: A080776 A376813 A360659 * A065358 A062329 A022958
KEYWORD
sign
AUTHOR
Antti Karttunen, Feb 22 2018
STATUS
approved