login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons 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

Robert Israel, Table of n, a(n) for n = 1..10000

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

Cf. A075593, A075594, A103824.

Sequence in context: A131896 A114380 A293130 * A073238 A010655 A123596

Adjacent sequences:  A103822 A103823 A103824 * A103826 A103827 A103828

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 | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified October 17 17:21 EDT 2021. Contains 348065 sequences. (Running on oeis4.)