login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A347031 a(n) = 1 - Sum_{k=2..n} (-1)^k * a(floor(n/k)). 4
1, 0, 1, 1, 2, -1, 0, 0, 2, -1, 0, 2, 3, 0, 3, 3, 4, -4, -3, -1, 2, -1, 0, 0, 2, -1, 3, 5, 6, -7, -6, -6, -3, -6, -3, 7, 8, 5, 8, 8, 9, -4, -3, -1, 7, 4, 5, 5, 7, -1, 2, 4, 5, -15, -12, -12, -9, -12, -11, 7, 8, 5, 13, 13, 16, 3, 4, 6, 9, -4, -3, -7, -6, -9, -1 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,5
COMMENTS
Partial sums of A308077.
LINKS
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
Sequence in context: A281188 A323439 A054008 * A125676 A291955 A291904
KEYWORD
sign
AUTHOR
Ilya Gutkovskiy, Aug 11 2021
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 25 01:35 EDT 2024. Contains 371964 sequences. (Running on oeis4.)