login
a(0) = 0, a(1) = 1, and for any n > 1, a(n) = Sum_{k > 1} (-1)^k * a(floor(n/k^2)).
1

%I #12 Jul 22 2019 12:00:20

%S 0,1,0,0,1,1,1,1,0,-1,-1,-1,-1,-1,-1,-1,1,1,2,2,2,2,2,2,2,1,1,1,1,1,1,

%T 1,-1,-1,-1,-1,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-3,-2,-2,-2,-2,

%U -2,-2,-2,-2,-2,-2,-2,-2,-2,-2,2,2,2,2,2,2,2,2,3,3

%N a(0) = 0, a(1) = 1, and for any n > 1, a(n) = Sum_{k > 1} (-1)^k * a(floor(n/k^2)).

%C This sequence is a signed variant of A309262.

%H Rémy Sigrist, <a href="/A309286/b309286.txt">Table of n, a(n) for n = 0..10000</a>

%e a(9) = a(floor(9/2^2)) - a(floor(9/3^3)) = a(2) - a(1) = 0 - 1 = -1.

%t Join[{0}, Clear[a]; a[0]=0; a[1]=1; a[n_]:=a[n]=Sum[a[Floor[n/k^2]](-1)^k, {k, 2, n}]; Table[a[n], {n, 1, 100}]] (* _Vincenzo Librandi_, Jul 22 2019 *)

%o (PARI) a(n) = if (n<=1, n, sum (k=2, sqrtint(n), (-1)^k * a(n\k^2)))

%Y Cf. A309262.

%K sign

%O 0,19

%A _Rémy Sigrist_, Jul 21 2019