login
This site is supported by donations to The OEIS Foundation.
Logo

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A096070 a(n) = least k > 0 not occurring earlier such that n-th partial sum is prime iff n is even. 2
1, 2, 3, 5, 4, 8, 7, 11, 9, 17, 10, 6, 12, 14, 13, 15, 16, 20, 19, 31, 21, 25, 18, 24, 22, 26, 23, 27, 28, 30, 29, 45, 32, 34, 33, 37, 35, 39, 38, 40, 36, 42, 41, 43, 44, 52, 46, 48, 47, 49, 51, 53, 50, 56, 54, 60, 55, 65, 57, 69, 58, 68, 59, 67, 61, 77, 62, 72, 63, 87, 64, 74 (list; graph; refs; listen; history; internal format)
OFFSET

1,2

EXAMPLE

n = 4 is even, 5 is the least number not occurring earlier that makes fourth partial sum prime: 1+2+3+5 = 11. n = 5 is odd, 4 is the least number not occurring earlier that makes fifth partial sum nonprime: 1+2+3+5+4 = 15.

PROG

(PARI) {m=72; s=0; v=Set([]); for(n=1, m, k=1; while(setsearch(v, k)>0||isprime(s+k)!=(n%2==0), k++); print1(k, ", "); s=s+k; v=setunion(v, Set(k)))}

CROSSREFS

Cf. A096071, A096072.

Sequence in context: A118317 A127522 A048673 * A075157 A183080 A183082

Adjacent sequences:  A096067 A096068 A096069 * A096071 A096072 A096073

KEYWORD

nonn

AUTHOR

Amarnath Murthy (amarnath_murthy(AT)yahoo.com), Jun 20 2004

EXTENSIONS

Edited, corrected and extended by Klaus Brockhaus (klaus-brockhaus(AT)t-online.de), Jun 21 2004

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Transforms | Puzzles | Hot | Classics
Recent Additions | More pages | Superseeker | Maintained by The OEIS Foundation Inc.

Content is available under The OEIS End-User License Agreement .

Last modified February 14 09:18 EST 2012. Contains 205614 sequences.