A124074 Consider the map that sends a number m to m - reverse(m) if that is nonnegative, otherwise to m + reverse(m). Sequence gives those numbers that reach a nonzero cycle under repeated application of this map.
119, 129, 169, 179, 188, 198, 200, 210, 218, 220, 228, 230, 240, 249, 250, 260, 268, 270, 278, 280, 287, 290, 297, 299, 300, 301, 310, 311, 317, 320, 321, 327, 330, 331, 340, 341, 348, 349, 350, 351, 360, 361, 367, 370, 371, 377, 380, 381, 386, 389, 390
Offset: 1
Examples
119 is a member because 119 + 911 = 1030 (since the difference is negative), 1030 - 0301 = 729 (since the difference is positive), 729 + 927 = 1656, 1656 + 6561 = 8217, 8217 - 7128 = 1089, 1089 + 9801 = 10890, 10890 - 09801 = 1089, so the terms are cyclic.
Links
- Ray Chandler, Table of n, a(n) for n = 1..5000
Crossrefs
Cf. A001232 gives the nonzero fixed points of map.
Programs
-
Mathematica
With[{nn = 400}, Select[Range@ nn, LengthWhile[NestList[If[#1 < 0, #2, #1] & @@ {#1 - #2, #1 + #2} & @@ {#, IntegerReverse@ #} &, #1, #2], # > 0 &] == #2 + 1 & @@ {#, 2^Log2@ #} &]] (* Michael De Vlieger, Oct 10 2017 *)
Extensions
Definition clarified by Ray Chandler, Oct 10 2017
Comments