OFFSET
1,5
COMMENTS
Partial sums of A308077.
LINKS
Seiichi Manyama, Table of n, a(n) for n = 1..10000
Ilya Gutkovskiy, Scatterplot of a(n) up to n=10000
FORMULA
G.f. A(x) satisfies: A(x) = (1/(1 - x)) * (x - Sum_{k>=2} (-1)^k * (1 - x^k) * A(x^k)).
MATHEMATICA
a[n_] := a[n] = 1 - Sum[(-1)^k a[Floor[n/k]], {k, 2, n}]; Table[a[n], {n, 1, 75}]
nmax = 75; A[_] = 0; Do[A[x_] = (1/(1 - x)) (x - Sum[(-1)^k (1 - x^k) A[x^k], {k, 2, nmax}]) + O[x]^(nmax + 1) // Normal, nmax + 1]; CoefficientList[A[x], x] // Rest
PROG
(Python)
from functools import lru_cache
@lru_cache(maxsize=None)
def A347031(n):
if n <= 1:
return n
c, j = 1, 2
k1 = n//j
while k1 > 1:
j2 = n//k1 + 1
c += (j2-j&1)*(1 if j&1 else -1)*A347031(k1)
j, k1 = j2, n//j2
return c+(n+1-j&1)*(1 if j&1 else -1) # Chai Wah Wu, Apr 04 2023
CROSSREFS
KEYWORD
sign
AUTHOR
Ilya Gutkovskiy, Aug 11 2021
STATUS
approved