Logo

Greetings from The On-Line Encyclopedia of Integer Sequences!

Hints

Search: id:A121861
Displaying 1-1 of 1 results found. page 1
     Format: long | short | internal | text      Sort: relevance | references | number      Highlight: on | off
A121861 Least previously nonoccurring positive integer such that partial sum + 1 is prime. +0
4
1, 3, 2, 4, 6, 12, 8, 10, 14, 18, 22, 26, 24, 16, 30, 32, 28, 20, 34, 36, 42, 44, 46, 62, 52, 38, 60, 48, 58, 56, 54, 40, 50, 64, 68, 72, 76, 84, 66, 96, 74, 70, 80, 100, 86, 78, 88, 104, 90, 106, 122, 112, 98, 102, 94, 92, 118, 114, 108, 110, 124, 116, 138, 82, 120, 128, 150 (list; graph; listen)
OFFSET

1,2

COMMENT

a(n) = {1,3} UNION {permutation of even positive numbers}. The corresponding partial sums + 1 are 2, 5, 7, 13, 17, 29, 37, 47, 61, 79, 101, 127, 151, ...,.

FORMULA

a(n) = MIN{k>0 such that 1 + k + SUM[i=1..n-1]a(i) is prime and k <> a(i)}.

EXAMPLE

a(1) = 1 because 1+1 = 2 is prime.

a(2) = 3 because 1+3+1 = 5 is prime.

a(3) = 2 because 1+3+2+1 = 7 is prime.

a(4) = 4 because 1+3+2+4+1 = 11 is prime.

MATHEMATICA

f[s_] := Append[s, k = 1; p = 1 + Plus @@ s; While[MemberQ[s, k] || ! PrimeQ[p + k], k++ ]; k]; Nest[f, {}, 67] (* Robert G. Wilson v *)

CROSSREFS

Cf. A000040, A121862.

Sequence in context: A114745 A039915 A085346 this_sequence A060006 A123097 A134571

Adjacent sequences: A121858 A121859 A121860 this_sequence A121862 A121863 A121864

KEYWORD

easy,nonn

AUTHOR

Jonathan Vos Post (jvospost3(AT)gmail.com), Aug 30 2006

EXTENSIONS

Corrected and extended by Robert G. Wilson v, Aug 31 2006

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 10 12:37 EST 2009. Contains 170569 sequences.


AT&T Labs Research