cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A074170 Start with 1, add the next number if one gets a prime then add the next number else subtract the next...

This page as a plain text file.
%I A074170 #9 Dec 15 2017 17:36:00
%S A074170 1,3,6,2,7,13,20,12,3,13,24,12,-1,-15,-30,-46,-63,-81,-100,-120,-141,
%T A074170 -163,-140,-164,-189,-215,-242,-270,-299,-329,-360,-392,-425,-459,
%U A074170 -494,-530,-567,-605,-644,-684,-725,-767,-810,-854,-899,-945,-992,-1040,-1089,-1139,-1190,-1242,-1295,-1349,-1404,-1460
%N A074170 Start with 1, add the next number if one gets a prime then add the next number else subtract the next...
%C A074170 Note that a(22) = -163 is the last prime generated by this sequence. All subsequent terms are composite and equal (16-n)(n+17)/2.
%F A074170 a(n) = -(n-16)(n+17)/2 for n > 22
%e A074170 a(1) = 1, a(2) = 1+2 =3 is a prime hence a(3) = 3 +3 = 6 which is composite hence a(4) = 6-4 = 2 etc.
%t A074170 a=3; Join[{1, 3}, Table[If[PrimeQ[a], a=a+n, a=a-n], {n, 3, 60}]]
%Y A074170 Cf. A074171.
%K A074170 easy,sign
%O A074170 1,2
%A A074170 _Amarnath Murthy_, Aug 30 2002
%E A074170 Corrected and extended by _Jason Earls_, Sep 01 2002
%E A074170 Corrected by _T. D. Noe_, Oct 04 2004