login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A103825 Choose a(n) to be the smallest number not yet used such that: a(1) = 1, a(2n) = composite, a(2n+1) = prime and partial sums are alternately prime or composite. 7
1, 4, 3, 9, 5, 15, 2, 8, 7, 25, 11, 49, 13, 21, 17, 33, 19, 27, 23, 39, 29, 119, 31, 77, 37, 35, 41, 51, 43, 45, 47, 55, 53, 57, 59, 91, 61, 65, 67, 87, 71, 69, 73, 93, 79, 85, 83, 95, 89, 63, 97, 81, 101, 99, 103, 75, 107, 105, 109, 141, 113, 115, 127, 125, 131, 111, 137 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
LINKS
MAPLE
N:= 1000: # for terms before the first term > N
Avail:= [$2..N]:
A[1]:= 1: T:= 1:
for n from 2 while assigned(A[n-1]) do
for j from 1 to N+1-n do
x:= Avail[j];
if (n::even and isprime(x+T) and not isprime(x)) or
(n::odd and isprime(x) and not isprime(x+T)) then
A[n]:= x; T:= T+x;
Avail:= subsop(j=NULL, Avail);
break
fi
od
od:
seq(A[i], i=1..n-2); # Robert Israel, Nov 26 2020
CROSSREFS
Sequence in context: A131896 A114380 A293130 * A073238 A010655 A123596
KEYWORD
nonn
AUTHOR
Ray Chandler Feb 16 2005
EXTENSIONS
Definition corrected by Zak Seidov, Feb 20 2005
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 23 18:16 EDT 2024. Contains 371916 sequences. (Running on oeis4.)