A088607 a(1) = 1. For n > 1, a(n) = prime(n) if n is prime, else a(n) = composite(n).
1, 3, 5, 9, 11, 12, 17, 15, 16, 18, 31, 21, 41, 24, 25, 26, 59, 28, 67, 32, 33, 34, 83, 36, 38, 39, 40, 42, 109, 45, 127, 48, 49, 50, 51, 52, 157, 55, 56, 57, 179, 60, 191, 63, 64, 65, 211, 68, 69, 70, 72, 74, 241, 76, 77, 78, 80, 81, 277, 84, 283, 86, 87, 88, 90, 91
Offset: 1
Keywords
Examples
a(9) = 16 = composite(9) as 9 is composite.
Crossrefs
Cf. A088608.
Programs
-
Mathematica
Join[{1},With[{comps=Select[Range[4,100],!PrimeQ[#]&]},Rest[Table[ If[ PrimeQ[n], Prime[n], comps[[n]]],{n,70}]]]] (* Harvey P. Dale, Nov 03 2013 *)
Extensions
More terms from Anne Donovan (anned3005(AT)aol.com), Oct 17 2003