|
| |
|
|
A055266
|
|
Smallest positive integer not already in sequence with a(n)+a(n-1) not prime.
|
|
1
| |
|
|
1, 3, 5, 4, 2, 6, 8, 7, 9, 11, 10, 12, 13, 14, 16, 17, 15, 18, 20, 19, 21, 23, 22, 24, 25, 26, 28, 27, 29, 31, 32, 30, 33, 35, 34, 36, 38, 37, 39, 41, 40, 42, 43, 44, 46, 45, 47, 48, 50, 49, 51, 53, 52, 54, 56, 55, 57, 58, 59, 60, 61, 62, 63, 65, 64, 66, 67, 68, 70, 71, 69, 72
(list; graph; refs; listen; history; internal format)
|
|
|
|
OFFSET
| 1,2
|
|
|
LINKS
| Index entries for sequences that are permutations of the natural numbers
|
|
|
EXAMPLE
| a(3)=5 because 1 and 3 have already been used and both 3+2=5 and 3+4=7 are prime while 3+5=8 is not prime.
|
|
|
MATHEMATICA
| f[ s_ ]:=Block[ {k=1, a=s[ [ -1 ] ]}, While[ Or[ MemberQ[ s, k ], PrimeQ[ a+k ] ], k++ ]; Append[ s, k ] ]; Nest[ f, {1}, 121 ] (* From Zak Seidov (zakseidov(AT)yahoo.com), Oct 21 2009 *)
a={1}; z=Range[2, 2002]; z=Complement[z, a]; While[Length[z]>1, If[!PrimeQ[z[[1]]+Last[a]], AppendTo[a, z[[1]]], If[!PrimeQ[z[[2]]+Last[a]], AppendTo[a, z[[2]]], AppendTo[a, z[[3]]]]]; z=Complement[z, a]]; Print[a] (* significantly faster *) (* From Vladimir Joseph Stephan Orlovsky, May 03 2011 *)
|
|
|
CROSSREFS
| Cf. A055265.
Sequence in context: A073006 A165109 A134892 * A075077 A196771 A081361
Adjacent sequences: A055263 A055264 A055265 * A055267 A055268 A055269
|
|
|
KEYWORD
| easy,nonn
|
|
|
AUTHOR
| Henry Bottomley (se16(AT)btinternet.com), May 09 2000
|
|
|
EXTENSIONS
| Corrected by Zak Seidov (zakseidov(AT)yahoo.com), Oct 21 2009
|
| |
|
|