sum(1) = 1;
a = zeros(10000,1);
sum = zeros(10000,1);
Ssum = zeros(42,1);
SSsum = zeros(16,1);
a(1) = 1;
sum(1) = 1;
format long
sumex = .60489864;
s = 1;
for i = 2:10000
    s = -s;
    a(i) = s/sqrt(i);
    sum(i) = sum(i-1) + a(i);
end
sum-sumex;
for i = 1:42
    Ssum(i) = (sum(i+2)*sum(i)-sum(i+1)^2)/(sum(i+2)+sum(i)-2*sum(i+1));
end
Ssum-sumex
for i = 1:16
    SSsum(i) = (Ssum(i+2)*Ssum(i)-Ssum(i+1)^2)/(Ssum(i+2)+Ssum(i)-2*Ssum(i+1));
end
SSsum - sumex
