|
|
A236676
|
|
The n-th term is the n-th composite if n is prime, and the n-th prime if n is not prime.
|
|
2
|
|
|
2, 6, 8, 7, 10, 13, 14, 19, 23, 29, 20, 37, 22, 43, 47, 53, 27, 61, 30, 71, 73, 79, 35, 89, 97, 101, 103, 107, 44, 113, 46, 131, 137, 139, 149, 151, 54, 163, 167, 173, 58, 181, 62, 193, 197, 199, 66, 223, 227, 229, 233, 239, 75, 251, 257, 263, 269, 271, 82
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
COMMENTS
|
See A097457 for the (maybe more natural) variant where "n-th composite"(=A002808(n)) is replaced by "n-th nonprime" (=A018252(n)).
|
|
LINKS
|
|
|
FORMULA
|
|
|
MATHEMATICA
|
Module[{nn=100, prs, cmps, len}, cmps=Select[Range[nn], CompositeQ]; len= Length[ cmps]; prs=Prime[Range[len]]; Table[If[PrimeQ[n], cmps[[n]], prs[[n]]], {n, len}]] (* Harvey P. Dale, Dec 27 2022 *)
|
|
PROG
|
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|