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”).
%I #3 Dec 05 2013 19:55:53
%S 4,22,111,1001,10001,100001,1000001,10000001,100000001,1000000001,
%T 10000000001,100000000001,1000000000001,10000000000001,
%U 100000000000001,1000000000000001,10000000000000001,100000000000000001
%N Smallest n-digit composite palindrome.
%t a = {4, 22}; Do[k = 10^n; While[d = IntegerDigits[k]; p = FromDigits[ Join[d, Reverse[Drop[d, -1]]]]; PrimeQ[p], k++ ]; a = Append[a, p]; k = 10^n; While[d = IntegerDigits[k]; p = FromDigits[ Join[d, Reverse[d]]]; PrimeQ[p], k++ ]; a = Append[a, p], {n, 1, 8}]; a
%K base,nonn
%O 1,1
%A _Amarnath Murthy_, Nov 09 2002
%E Edited and extended by _Robert G. Wilson v_, Nov 16 2002