OFFSET
1,1
COMMENTS
When normalized over (0,1) by their respective palindrome-free interval about a 196-iterate, it has been empirically observed that the frequency distribution of this sequence appears to be quite symmetric about 0.5, as well as fractal when plotting the distribution over decreasing bin sizes.
The 196-iterates referred to here come from the reverse-and-add process generating A006960.
EXAMPLE
The first term is 5 since 196-191 = 5
The second term is 9 since 887-878 = 9, etc.
MATHEMATICA
Map[Block[{k = # - 1}, While[k != IntegerReverse@ k, k--]; # - k] &, NestList[# + IntegerReverse[#] &, 196, 25]] (* brute force, or *)
Map[# - Block[{n = #, w, len, ww}, w = IntegerDigits[n]; len = Length@ w; ww = Take[w, Ceiling[len/2] ]; If[# < n, #, FromDigits@ Flatten@{#, If[OddQ@ len, Reverse@ Most@ #, Reverse@ #]} &@ If[Last@ ww == 0, MapAt[# - 1 &, Most@ ww, -1]~Join~{9}, MapAt[# - 1 &, ww, -1]]] &@ FromDigits@ Flatten@ {ww, If[OddQ@ len, Reverse@ Most@ ww, Reverse@ ww]}] &, NestList[# + IntegerReverse[#] &, 196, 37]] (* Michael De Vlieger, Jan 22 2020 *)
PROG
(Python)
# Slow Brute-force
n = 196
while n < 10**15:
m = n
while m != int(str(m)[::-1]): m+=-1
print(n-m, end=', ')
n = n + int(str(n)[::-1])
CROSSREFS
KEYWORD
nonn,base
AUTHOR
James D. Klein, Jan 20 2020
EXTENSIONS
More terms from Michael De Vlieger, Jan 22 2020
STATUS
approved