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”).

A328967
a(n+1) = 1 - Sum_{k=1..n} a(floor(n/k)).
2
1, 0, 0, -1, 0, -2, 0, -3, 1, -4, 0, -5, 3, -6, 1, -8, 5, -9, 3, -10, 8, -13, 4, -14, 15, -16, 7, -21, 15, -22, 14, -23, 27, -28, 14, -32, 32, -33, 20, -42, 41, -43, 32, -44, 50, -57, 33, -58, 71, -61, 46, -75, 70, -76, 59, -82, 98, -95, 62, -96, 117, -97, 81, -122, 131
OFFSET
1,6
FORMULA
G.f. A(x) satisfies: A(x) = (x/(1 - x)) * (1 - Sum_{k>=1} (1 - x^k) * A(x^k)).
MATHEMATICA
a[n_] := a[n] = 1 - Sum[a[Floor[(n - 1)/k]], {k, 1, n - 1}]; Table[a[n], {n, 1, 65}]
A281487[1] = 1; A281487[n_] := A281487[n] = -Sum[A281487[d], {d, Divisors[n - 1]}]; Table[A281487[n], {n, 1, 65}] // Accumulate
PROG
(Python)
from functools import lru_cache
@lru_cache(maxsize=None)
def A328967(n):
if n == 0:
return 1
c, j = n-1, 1
k1 = (n-1)//j
while k1 > 1:
j2 = (n-1)//k1 + 1
c += (j2-j)*A328967(k1)
j, k1 = j2, (n-1)//j2
return j-c # Chai Wah Wu, Mar 31 2021
CROSSREFS
Cf. A003318, A281487 (first differences).
Sequence in context: A135157 A360692 A135156 * A358171 A277707 A357634
KEYWORD
sign
AUTHOR
Ilya Gutkovskiy, Feb 25 2020
STATUS
approved