A056544 Smallest palindrome containing the digits of n as a subsequence.
1, 2, 3, 4, 5, 6, 7, 8, 9, 101, 11, 121, 131, 141, 151, 161, 171, 181, 191, 202, 121, 22, 232, 242, 252, 262, 272, 282, 292, 303, 131, 232, 33, 343, 353, 363, 373, 383, 393, 404, 141, 242, 343, 44, 454, 464, 474, 484, 494, 505, 151, 252, 353, 454, 55, 565, 575
Offset: 1
Examples
The smallest palindrome containing 21 as a subsequence is 121. So a(21) = 121.
Links
- Rémy Sigrist, Table of n, a(n) for n = 1..10000
- Rémy Sigrist, PARI program for A056544
Programs
-
Mathematica
Do[k = 1; While[ StringPosition[ ToString[k], ToString[n]] == {} || ToString[k] != StringReverse[ ToString[k]], k++ ]; Print[k], {n, 1, 70} ]
-
PARI
See Links section.
Formula
Extensions
Edited and extended by Robert G. Wilson v, Feb 12 2002