login
A072140
The period length of the 'Reverse and Subtract' trajectory of n is greater than 1.
10
1012, 1023, 1034, 1045, 1067, 1078, 1089, 1100, 1122, 1133, 1144, 1155, 1177, 1188, 1199, 1210, 1232, 1243, 1254, 1265, 1287, 1298, 1320, 1342, 1353, 1364, 1375, 1397, 1408, 1430, 1452, 1463, 1474, 1485, 1507, 1518, 1540, 1562, 1573, 1584, 1595, 1606
OFFSET
1,1
COMMENTS
'Reverse and Subtract' (cf. A072137) is defined by x -> |x - reverse(x)|. There is no number k > 0 such that |k - reverse(k)| = k, so 0 is the only period with length 1. Consequently this sequence consists of the numbers n such that repeated application of 'Reverse and Subtract' does not lead to a palindrome. It is an analog of A023108, which uses 'Reverse and Add'. - A072141, A072142, A072143 give the numbers which generate periods of length 2, 14, 22 respectively.
LINKS
EXAMPLE
1012 -> |1012 - 2101| = 1089 -> |1089 - 9801| = 8712 -> |8712 - 2178| = 6534 -> |6534 - 4356| = 2178 -> |2178 - 8712| = 6534; the period of the trajectory is 6534, 2178 and a palindrome is never reached.
PROG
Contribution from Reinhard Zumkeller, Oct 24 2010: (Start)
(Other) Haskell:
import Data.List (find, findIndices, inits)
import Data.Maybe (fromJust)
spanCycle :: Eq a => (a -> a) -> a -> ([a], [a])
spanCycle f x = fromJust $ find (not . null . snd) $
.......................... zipWith (span . (/=)) xs $ inits xs
............... where xs = iterate f x
a072140_list = findIndices (> 1) $
.............. map (length . snd . spanCycle (abs . a056965)) [0..]
-- eop. (End)
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Klaus Brockhaus, Jun 24 2002
STATUS
approved