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!)
A328967 a(n+1) = 1 - Sum_{k=1..n} a(floor(n/k)). 2

%I #12 Mar 31 2021 14:48:34

%S 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,

%T 7,-21,15,-22,14,-23,27,-28,14,-32,32,-33,20,-42,41,-43,32,-44,50,-57,

%U 33,-58,71,-61,46,-75,70,-76,59,-82,98,-95,62,-96,117,-97,81,-122,131

%N a(n+1) = 1 - Sum_{k=1..n} a(floor(n/k)).

%F G.f. A(x) satisfies: A(x) = (x/(1 - x)) * (1 - Sum_{k>=1} (1 - x^k) * A(x^k)).

%t a[n_] := a[n] = 1 - Sum[a[Floor[(n - 1)/k]], {k, 1, n - 1}]; Table[a[n], {n, 1, 65}]

%t A281487[1] = 1; A281487[n_] := A281487[n] = -Sum[A281487[d], {d, Divisors[n - 1]}]; Table[A281487[n], {n, 1, 65}] // Accumulate

%o (Python)

%o from functools import lru_cache

%o @lru_cache(maxsize=None)

%o def A328967(n):

%o if n == 0:

%o return 1

%o c, j = n-1, 1

%o k1 = (n-1)//j

%o while k1 > 1:

%o j2 = (n-1)//k1 + 1

%o c += (j2-j)*A328967(k1)

%o j, k1 = j2, (n-1)//j2

%o return j-c # _Chai Wah Wu_, Mar 31 2021

%Y Cf. A003318, A281487 (first differences).

%K sign

%O 1,6

%A _Ilya Gutkovskiy_, Feb 25 2020

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 18 21:51 EDT 2024. Contains 371781 sequences. (Running on oeis4.)