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”).

A083972
Smallest palindromic prime containing exactly n 1's.
10
313, 11, 18181, 11311, 1311131, 1114111, 110111011, 111181111, 11115151111, 1011117111101, 1110111110111, 1111118111111, 111111212111111, 111111151111111, 11121111111112111, 1011111110111111101, 1111111611161111111, 111110111171111011111, 1111111111111111111, 111111111161111111111, 11111111181118111111111, 1101111111119111111111011
OFFSET
1,1
LINKS
MATHEMATICA
digOfInterest = 1;
primes = {};
While[Length[primes] < 6,
n = Length[primes] + 1;
i = 0;
While[Length[primes] != n,
i++;
dig = IntegerDigits[Prime[i]];
If[
(dig == Reverse[dig]) &&
(Count[dig, digOfInterest] == n),
AppendTo[primes, FromDigits[dig]];
];
];
];
primes
(* Kevin Southwick, Jul 25 2015 *)
KEYWORD
base,nonn
AUTHOR
Amarnath Murthy and Meenakshi Srikanth (menakan_s(AT)yahoo.com), May 21 2003
EXTENSIONS
More terms from David Wasserman, Dec 06 2004
Corrected and extended by Giovanni Resta, Feb 08 2006
2 more terms from Erich Friedman, Mar 23 2008
STATUS
approved