Logo

Greetings from The On-Line Encyclopedia of Integer Sequences!

Hints

Search: id:A074171
Displaying 1-1 of 1 results found. page 1
     Format: long | short | internal | text      Sort: relevance | references | number      Highlight: on | off
A074171 a(1) = 1. For n >= 2, a(n) is either a(n-1)+n or a(n-1)-n; we only use the minus sign if a(n-1) is prime. E.g. since a(2)=3 is prime, a(3)=a(2)-3=0. +0
3
1, 3, 0, 4, 9, 15, 22, 30, 39, 49, 60, 72, 85, 99, 114, 130, 147, 165, 184, 204, 225, 247, 270, 294, 319, 345, 372, 400, 429, 459, 490, 522, 555, 589, 624, 660, 697, 735, 774, 814, 855, 897, 940, 984, 1029, 1075, 1122, 1170, 1219, 1269, 1320, 1372, 1425, 1479 (list; graph; listen)
OFFSET

1,2

COMMENT

In spite of the definition, this is simply 1, 3, then numbers of the form n*(n+7)/2 (A055999). In other words, a(n) = (n-3)(n+4)/2 for n >= 3. The proof is by induction: For n>3, a(n-1) = (n-4)(n+3)/2 is composite, so a(n) = a(n-1) + n = (n-3)(n+4)/2. - Dean Hickerson, T. D. Noe, Paul C. Leopardi, Labos E., and others, Oct 04 2004

If a 2-set Y and a 3-set Z, having one element in common, are subsets of an n-set X then a(n) is the number of 3-subests of X intersecting both Y and Z. - Milan R. Janjic (agnus(AT)blic.net), Oct 03 2007

LINKS

Milan Janjic, Two Enumerative Functions

FORMULA

a[1] = 1, a[2] = 3; a[n+1] = a[n]+n if a[n] is not a prime; a[n+1] = a[n]-n if a[n] is prime.

EXAMPLE

a(1) = 1

a(2) = a(1) + 2 = 3, which is prime, so

a(3) = a(2) - 3 = 0, which is not prime, so

a(4) = a(3) + 4 = 4, which is not prime, etc.

MATHEMATICA

{ta={1, 3}, tb={{0}}}; Do[s=Last[ta]; If[PrimeQ[s], ta=Append[ta, s-n]]; If[ !PrimeQ[s], ta=Append[ta, s+n]]; Print[{a=Last[ta], b=(n-3)*(n+4)/2, a-b}]; tb=Append[tb, a-b], {n, 3, 100000}]; {ta, {tb, Union[tb]}} (Labos)

CROSSREFS

Cf. A074170, A055999.

Sequence in context: A068630 A079406 A068627 this_sequence A094665 A052439 A010816

Adjacent sequences: A074168 A074169 A074170 this_sequence A074172 A074173 A074174

KEYWORD

easy,nonn

AUTHOR

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

EXTENSIONS

More terms from Jason Earls (zevi_35711(AT)yahoo.com), Sep 01 2002

More terms from Labos E. (labos(AT)ana.sote.hu), Oct 07 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 July 24 12:00 EDT 2008. Contains 142294 sequences.


AT&T Labs Research