Start the sequence with a(1) = 3. From now on iterate: if |a(n)| is prime, subtract from a(n) the |a(n)|-th prime of the list of primes A000040 and if |a(n)| is nonprime, add to a(n) the |a(n)|-th nonprime of the list of nonprimes A018252.

A374834

Start the sequence with a(1) = 3. From now on iterate: if |a(n)| is prime, subtract from a(n) the |a(n)|-th prime of the list of primes A000040 and if |a(n)| is nonprime, add to a(n) the |a(n)|-th nonprime of the list of nonprimes A018252.

Terms

    a(0) =3a(1) =-2a(2) =-5a(3) =-16a(4) =9a(5) =24a(6) =59a(7) =-218a(8) =58a(9) =138a(10) =316a(11) =709a(12) =-4672a(13) =708a(14) =1563a(15) =3408a(16) =7364a(17) =15779a(18) =33601a(19) =-363046a(20) =33600a(21) =71181a(22) =150103a(23) =315315a(24) =660199a(25) =-9268542a(26) =660198a(27) =1378289a(28) =2870170a(29) =5963401

External references