A339403 a(n) is the smallest positive integer such that n*a(n) contains the string n+a(n) in reverse as a substring. If no such number exists then a(n) = -1.
0, -1, 2, 24, 37, 26, 34, 35, 57, 9, -1, 12, 11, 45, 193, 228, 28, 51, 23, 44, 841, 11, 27, 18, 3, 626, 5, 22, 16, 46716, 56, 41, 33, 32, 6, 7, 21, 4, 3, 24, 592, 31, 7, 619, 19, 13, 38, 2, 117, 5, 463, 17, 34, 308, 33, 36, 30, 8, 31, 4, 23, 21, 648, 124, 921, 903, 386, 395, 4, 334, 755, 31, 563
Offset: 0
Examples
a(3) = 24 as 3*24 = 72 which contains reverse(3+24) = reverse(27) = 72 as a substring. a(6) = 34 as 6*34 = 204 which contains reverse(6+34) = reverse(40) = 04 as a substring. Note the leading zero is included. a(29) = 46716 as 29*46716 = 1354764 which contains reverse(29+4671) = reverse(46745) = 54764 as a substring. a(110) = 11 as 110*11 = 1210 which contains reverse(110+11) = reverse(121) = 121 as a substring. This is the first of two consecutive terms with a(n) = 11. a(20000) = 666843331 as 20000*666843331 = 13336866620000 which contains reverse(20000+666843331) = reverse(666863331) = 133368666 as a substring. This is the largest value in the first 100000 terms.
Links
- Scott R. Shannon, Table of n, a(n) for n = 0..10000
Programs
-
PARI
isok(n, k) = #strsplit(Str(n*k), concat(Vecrev(Str(n+k)))) > 1; ispt(n) = my(t); ispower(n,,&t) && (t==10); a(n) = {if ((n==1) || (n==10) || ispt(n), return (-1)); my(k=0); while (! isok(n, k), k++); k;} \\ Michel Marcus, Jan 22 2021
Comments