|
Search: id:A096070
|
|
|
| A096070 |
|
a(n) = least k > 0 not occurring earlier such that n-th partial sum is prime iff n is even. |
|
+0 3
|
|
| 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; listen)
|
|
|
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.
|
|
PROGRAM
|
(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 this_sequence A075157 A046708 A120255
Adjacent sequences: A096067 A096068 A096069 this_sequence 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
|
|
|
Search completed in 0.002 seconds
|