login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A178663
a(1)=1. For n>1, a(n) is the smallest number greater than a(n-1) such that exactly one of n and a(n) is prime and the other is composite.
0
1, 4, 6, 7, 8, 11, 12, 13, 17, 19, 20, 23, 24, 29, 31, 37, 38, 41, 42, 43, 47, 53, 54, 59, 61, 67, 71, 73, 74, 79, 80, 83, 89, 97, 101, 103, 104, 107, 109, 113, 114, 127, 128, 131, 137, 139, 140, 149, 151, 157, 163, 167, 168, 173, 179, 181, 191, 193, 194, 197, 198, 199
OFFSET
1,2
COMMENTS
Equals A163578 from the second term on. - R. J. Mathar, Jun 07 2010
EXAMPLE
a(6) cannot equal 9 because both 6 and 9 are composite.
MATHEMATICA
a[n_] := a[n] = Block[{k = a[n - 1]}, If[ PrimeQ@n, k++; While[PrimeQ@k, k++ ], k = NextPrime@k]; k]; a[1] = 1; Array[a, 62] (* Robert G. Wilson v, Jun 04 2010 *)
CROSSREFS
Sequence in context: A139490 A030375 A081712 * A084395 A047291 A100349
KEYWORD
nonn
AUTHOR
J. Lowell, Jun 01 2010
EXTENSIONS
a(9) onwards from Robert G. Wilson v, Jun 04 2010
STATUS
approved