OFFSET
1,1
LINKS
Jaroslav Krizek and David A. Corneth, Table of n, a(n) for n = 1..10000 (first 2222 terms from Jaroslav Krizek)
FORMULA
a(n) = A002113(k) iff k starts with 7 or 16. - David A. Corneth, Jun 25 2017
MATHEMATICA
palQ[n_Integer, base_Integer] := Module[{idn = IntegerDigits[n, base]}, idn == Reverse[idn]]; Select[Range[0, 100000], IntegerDigits[#][[1]] == 6 && palQ[#, 10] &] (* T. D. Noe, Mar 12 2013 *)
Select[Flatten[Table[Range[6*10^n, 7*10^n-1], {n, 0, 4}]], PalindromeQ] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Jun 25 2017 *)
PROG
(PARI) nxt2113(n)={my(d=digits(n)); i=(#d+1)\2; while(i&&d[i]==9, d[i]=0; d[#d+1-i]=0; i--); if(i, d[i]++; d[#d+1-i]=d[i], d=vector(#d+1); d[1]=d[#d]=1); d}
nxt(n) = my(d = nxt2113(n)); if(d[1]==6, fromdigits(d), 6*(10^#d+1))
print1(a = 6, ", "); for (n=1, 30, print1(a = nxt(a), ", ")) \\ David A. Corneth, Jun 25 2017
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
STATUS
approved