cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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.

This page as a plain text file.
%I A178663 #11 Aug 02 2015 12:58:15
%S A178663 1,4,6,7,8,11,12,13,17,19,20,23,24,29,31,37,38,41,42,43,47,53,54,59,
%T A178663 61,67,71,73,74,79,80,83,89,97,101,103,104,107,109,113,114,127,128,
%U A178663 131,137,139,140,149,151,157,163,167,168,173,179,181,191,193,194,197,198,199
%N 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.
%C A178663 Equals A163578 from the second term on. - _R. J. Mathar_, Jun 07 2010
%e A178663 a(6) cannot equal 9 because both 6 and 9 are composite.
%t A178663 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 *)
%K A178663 nonn
%O A178663 1,2
%A A178663 _J. Lowell_, Jun 01 2010
%E A178663 a(9) onwards from _Robert G. Wilson v_, Jun 04 2010