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!)
A073920 a(1)=1 and then odd numbers rearranged such that a(n) is prime if n is composite else vice versa. 3

%I #19 Apr 02 2017 10:14:37

%S 1,9,15,3,21,5,25,7,11,13,27,17,33,19,23,29,35,31,39,37,41,43,45,47,

%T 53,59,61,67,49,71,51,73,79,83,89,97,55,101,103,107,57,109,63,113,127,

%U 131,65,137,139,149,151,157,69,163,167,173,179,181,75,191,77,193,197,199

%N a(1)=1 and then odd numbers rearranged such that a(n) is prime if n is composite else vice versa.

%H Michel Marcus, <a href="/A073920/b073920.txt">Table of n, a(n) for n = 1..1000</a>

%H Zak Seidov, <a href="http://zak08.livejournal.com/11403.html">A073920</a> [From _Zak Seidov_, Apr 15 2009]

%t a = {1}; Do[k = 3; While[Nand[! MemberQ[a, k], Xor @@ Map[PrimeQ, {k, n}]], k += 2]; AppendTo[a, k], {n, 2, 64}]; a (* _Michael De Vlieger_, Mar 30 2017 *)

%o (PARI) nextcomposite(c) = until (!isprime(c), c +=2); c;

%o lista(nn) = {print1(1, ", "); p = 2; c = 1; for (n=2, nn, if (isprime(n), c = nextcomposite(c); print1(c, ", "), p = nextprime(p+1); print1(p, ", ")););} \\ _Michel Marcus_, Apr 01 2017

%Y Cf. A073921.

%K nonn

%O 1,2

%A _Amarnath Murthy_, Aug 19 2002

%E Extended and edited by _T. D. Noe_, Apr 13 2009

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 24 20:06 EDT 2024. Contains 371963 sequences. (Running on oeis4.)