A072140 The period length of the 'Reverse and Subtract' trajectory of n is greater than 1.
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
Examples
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.
Links
- Ray Chandler, Table of n, a(n) for n = 1..10000
Programs
-
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. -- Reinhard Zumkeller, Oct 24 2010
Comments