a(1) = 1 and then add n to the previous term if n is coprime to the previous term, otherwise subtract n from the previous term. a(1) = 1 and a(n) = a(n-1) + n if gcd(n, a(n-1)) = 1, otherwise a(n) = a(n-1) - n.

A077140

a(1) = 1 and then add n to the previous term if n is coprime to the previous term, otherwise subtract n from the previous term. a(1) = 1 and a(n) = a(n-1) + n if gcd(n, a(n-1)) = 1, otherwise a(n) = a(n-1) - n.

Terms

    a(0) =1a(1) =3a(2) =0a(3) =-4a(4) =1a(5) =7a(6) =0a(7) =-8a(8) =1a(9) =11a(10) =0a(11) =-12a(12) =1a(13) =15a(14) =0a(15) =-16a(16) =1a(17) =19a(18) =0a(19) =-20a(20) =1a(21) =23a(22) =0a(23) =-24a(24) =1a(25) =27a(26) =0a(27) =-28a(28) =1a(29) =31

External references