login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A280028 a(1)=1; thereafter, if n even, a(n) = a(n-1)-st prime, and if n odd, a(n) = a(n-1)-st nonprime. 4
1, 2, 4, 7, 12, 37, 52, 239, 301, 1993, 2338, 20753, 23356, 266587, 291968, 4134187, 4446630, 75947059, 80652283, 1625456353, 1710094788, 39954587527, 41737658509, 1114336791787, 1157634258442, 34900173534517, 36096139358620, 1216553712004063 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,2

COMMENTS

This is the sequence S_1 mentioned in A141436. The primes and nonprimes alternate.

LINKS

Table of n, a(n) for n=1..28.

MAPLE

P:=n->ithprime(n);

# let b1 be a list of the nonprimes (from the b-file for A018252)

N:=n->if n<=nops(b1) then b1[n] else 0; fi;;

f:=proc(m) local S, n, sw, t; global P, N;

S:=[m]; t:=m;

   if isprime(m) then sw:=1; else sw:=2; fi;

if sw=1 then

   for n from 2 to 60 do

   if n mod 2 = 0 then t:=N(t); if t=0 then return(S); fi; else t:=P(t); fi; S:=[op(S), t];

   od:

else

   for n from 2 to 60 do

   if n mod 2 = 0 then t:=P(t); else t:=N(t); if t=0 then return(S); fi; fi; S:=[op(S), t];

   od:

fi;

S;

end;

f(1); # A280028

f(3); # A280029

f(5); # A280030

MATHEMATICA

nonPrime[n_Integer] := FixedPoint[n + PrimePi@# &, n + PrimePi@ n]; a[n_] := If[ OddQ@ n, nonPrime[ a[n -1]], Prime@a[n -1]]; a[1] = 1; Array[a, 26] (* Robert G. Wilson v, Dec 28 2016 *)

CROSSREFS

Cf. A000040, A018252, A141436, A280029, A280030.

Sequence in context: A027945 A079800 A217595 * A094271 A194422 A177101

Adjacent sequences:  A280025 A280026 A280027 * A280029 A280030 A280031

KEYWORD

nonn

AUTHOR

N. J. A. Sloane, Dec 25 2016

EXTENSIONS

a(13)-a(27) from Hans Havermann, Dec 25 2016

a(28) from Chai Wah Wu, Dec 26 2016

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 May 24 10:48 EDT 2019. Contains 323529 sequences. (Running on oeis4.)