%I #8 Sep 02 2023 03:40:11
%S 1,1,0,1,0,0,1,1,1,1,0,-1,0,0,1,2,1,1,2,1,0,0,-1,-1,0,0,0,1,0,0,1,1,2,
%T 2,1,1,2,2,1,1,0,0,1,0,0,0,-1,-2,-1,-1,0,1,0,0,1,1,0,0,-1,0,1,1,1,2,1,
%U 1,2,1,2,2,1,1,2,2,1,2,1,1,2,1,1,1,0
%N Partial sums of A259024.
%C |a(A259031(n))| = n and |a(m)| != n for m < A259031(n).
%H Reinhard Zumkeller, <a href="/A259029/b259029.txt">Table of n, a(n) for n = 1..10000</a>
%t f[p_, e_] := If[Mod[p, 6] == 1, 1, (-1)^e]; f[2, e_] := (1 + (-1)^e) / 2; f[3, 1] = -1; f[3, e_] := 0; s[1] = 1; s[n_] := Times @@ f @@@ FactorInteger[n]; Accumulate[Array[s, 100]] (* _Amiram Eldar_, Sep 02 2023 *)
%o (Haskell)
%o a259029 n = a259029_list !! (n-1)
%o a259029_list = scanl1 (+) a259024_list
%Y Cf. A259024, A259031.
%K sign,easy
%O 1,16
%A _Reinhard Zumkeller_, Jun 17 2015
|