Logo

Greetings from The On-Line Encyclopedia of Integer Sequences!

Hints

Search: id:A074170
Displaying 1-1 of 1 results found. page 1
     Format: long | short | internal | text      Sort: relevance | references | number      Highlight: on | off
A074170 Start with 1, add the next number if one gets a prime then add the next number else subtract the next... +0
3
1, 3, 6, 2, 7, 13, 20, 12, 3, 13, 24, 12, -1, -15, -30, -46, -63, -81, -100, -120, -141, -163, -140, -164, -189, -215, -242, -270, -299, -329, -360, -392, -425, -459, -494, -530, -567, -605, -644, -684, -725, -767, -810, -854, -899, -945, -992, -1040, -1089, -1139, -1190, -1242, -1295, -1349, -1404, -1460 (list; graph; listen)
OFFSET

1,2

COMMENT

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.

FORMULA

a(n) = -(n-16)(n+17)/2 for n > 22

EXAMPLE

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.

MATHEMATICA

a=3; Join[{1, 3}, Table[If[PrimeQ[a], a=a+n, a=a-n], {n, 3, 60}]]

CROSSREFS

Cf. A074171.

Sequence in context: A078783 A125717 A065232 this_sequence A076543 A005132 A064388

Adjacent sequences: A074167 A074168 A074169 this_sequence A074171 A074172 A074173

KEYWORD

easy,sign

AUTHOR

Amarnath Murthy (amarnath_murthy(AT)yahoo.com), Aug 30 2002

EXTENSIONS

Corrected and extended by Jason Earls (zevi_35711(AT)yahoo.com), Sep 01 2002

Corrected by T. D. Noe (noe(AT)sspectra.com), Oct 04 2004

page 1

Search completed in 0.002 seconds

Lookup | Welcome | Find friends | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Transforms | Puzzles | Hot | Classics
More pages | Superseeker | Maintained by N. J. A. Sloane (njas@research.att.com)

Last modified December 8 08:31 EST 2009. Contains 170430 sequences.


AT&T Labs Research