cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-9 of 9 results.

A072142 Numbers n such that 14 applications of 'Reverse and Subtract' lead to n, whereas fewer than 14 applications do not lead to n.

Original entry on oeis.org

11436678, 13973058, 19582398, 23981958, 30581397, 32662377, 33218856, 42464466, 44664246, 48737106, 61936974, 69746193, 71064873, 76226733
Offset: 1

Views

Author

Klaus Brockhaus, Jun 24 2002

Keywords

Comments

There are 14 eight-digit terms in the sequence. Further terms are obtained (a) by inserting at the center of these terms either any number of 9's (for 11436678, 32662377, 33218856, 76226733) or any number of 0's (for the other ten terms) and (b) by concatenating a term any number of times with itself and inserting an equal number of 0's at all junctures. Method (b) may be applied recursively to all terms. - Revised thanks to a comment from Hans Havermann, Jan 20 2004.

Examples

			11436678 -> 76226733 -> 42464466 -> 23981958 -> 61936974 -> 13973058 -> 71064873 -> 33218856 -> 32662377 -> 44664246 -> 19582398 -> 69746193 -> 30581397 -> 48737106 -> 11436678.
		

Crossrefs

Formula

n = f^14(n), n <> f^k(n) for k < 14, where f: x -> |x - reverse(x)|.

A072143 Numbers n such that 22 applications of 'Reverse and Subtract' lead to n, whereas fewer than 22 applications do not lead to n.

Original entry on oeis.org

108811891188, 115521884478, 117611882388, 125520874479, 177781822218, 215511784488, 242351757648, 248841751158, 278882721117, 428823571176, 432244567755, 442243557756, 455663544336, 602315397684, 604405395594
Offset: 1

Views

Author

Klaus Brockhaus, Jun 24 2002

Keywords

Comments

There are 22 twelve-digit terms in the sequence. Further terms are obtained (a) by inserting at the center of these terms any number of 9's and (b) by concatenating a term any number of times with itself and inserting an equal number of 0's at all junctures. Method (b) may be applied recursively to all terms. - Revised thanks to a comment from Hans Havermann, Jan 27 2004
All terms are divisible by 10999989. - Hugo Pfoertner, Sep 23 2020

Examples

			108811891188 -> 772386227613 -> 455663544336 -> 177781822218 -> 634446365553 -> 278882721117 -> 432244567755 -> 125520874479 -> 848957151042 -> 608805391194 -> 117611882388 -> 765676234323 -> 442243557756 -> 215511784488 -> 668975331024 -> 248841751158 -> 602315397684 -> 115521884478 -> 758966241033 -> 428823571176 -> 242351757648 -> 604405395594 -> 108811891188.
		

Crossrefs

Formula

n = f^22(n), n <> f^k(n) for k < 22, where f: x -> |x - reverse(x)|.

A072137 Length of the preperiodic part of the 'Reverse and Subtract' trajectory of n.

Original entry on oeis.org

0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 6, 4, 5, 3, 3, 5, 4, 6, 2, 1, 2, 6, 4, 5, 3, 3, 5, 4, 6, 2, 1, 2, 6, 4, 5, 3, 3, 5, 4, 6, 2, 1, 2, 6, 4, 5, 3, 3, 5, 4, 6, 2, 1, 2, 6, 4, 5, 3, 3, 5, 4, 6, 2, 1, 2, 6, 4, 5, 3, 3, 5, 4, 6, 2, 1, 2, 6, 4, 5, 3, 3, 5, 4, 6, 2, 1, 2, 6, 4, 5, 3, 3, 5, 4, 6, 2, 1, 2, 1, 2, 6, 4
Offset: 0

Views

Author

Klaus Brockhaus, Jun 24 2002

Keywords

Comments

'Reverse and Subtract' (cf. A070837, A070838) is defined by x -> |x - reverse(x)|, where reverse(x) is the digit reversal of x.
For every n the trajectory eventually becomes periodic, since 'Reverse and Subtract' does not increase the number of digits and so the set of available terms is finite. For small n the period length is 1, the periodic part consists of 0's, the last term of the preperiodic part is a palindrome.
The first n with period length 2 and a nontrivial periodic part is 1012 (cf. A072140).
This sequence is a weak analog of A033665, which uses 'Reverse and Add'.

Examples

			a(15) = 4 since 15 -> |15- 51| = 36 -> |36 - 63| = 27 -> |27 - 72| = 45 -> |45 - 54| = 9.
		

Crossrefs

Programs

  • Haskell
    import Data.List(inits, find); import Data.Maybe(fromJust)
    a072137 :: Int -> Int
    a072137 = length . fst . spanCycle (abs . a056965) where
       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
    -- Reinhard Zumkeller, Oct 24 2010
  • Mathematica
    a[n_] := (k = 0; FixedPoint[ (k++; Abs[# - FromDigits[ Reverse[ IntegerDigits[#] ] ] ]) &, n]; k - 1); Table[ a[n], {n, 0, 104}] (* Jean-François Alcover, Dec 01 2011 *)

A072141 Numbers n such that two applications of 'Reverse and Subtract' lead to n, whereas one application does not lead to n.

Original entry on oeis.org

2178, 6534, 21978, 65934, 219978, 659934, 2199978, 6599934, 21782178, 21999978, 65346534, 65999934, 217802178, 219999978, 653406534, 659999934, 2178002178, 2197821978, 2199999978, 6534006534, 6593465934, 6599999934
Offset: 1

Views

Author

Klaus Brockhaus, Jun 24 2002

Keywords

Comments

There are two four-digit terms in the sequence. Further terms are obtained (a) by inserting at the center of these terms any number of 9's and (b) by concatenating a term any number of times with itself and inserting an equal number of 0's at all junctures. Method (b) may be applied recursively to all terms. - Revised thanks to a comment from Hans Havermann, Jan 27 2004.
Solutions to x = f^k(x), x <> f^j(x) for j < k, where f: n -> |n - reverse(n)|, for period lengths k <= 22 are given by:
.k..smallest.solution..smallest.n.with.period.k..sequence
.1..................0.........................0.......---
.2...............2178......................1012..(this one)
14...........11436678..................10001145...A072142
22.......108811891188..............100000114412...A072143
12.......118722683079..............100010505595...A072718
17...1186781188132188..........1000000011011012...A072719
I still have no answer to the question if there exist solutions for other values of k. Random tests for larger n (up to 50 digits) have shown that periods 1 and 2 are very frequent (> 90 %), period 14 is not unusual (7 to 8 %), periods 22, 12 and 17 are very rare and other periods did not appear.
I conjecture that for some k there are no solutions, while in other cases the minimal solutions will have 20, 24, 28, ... digits (which however are very hard to find).

Examples

			6534 -> |6534 - 4356| = 2178 -> |2178 - 8712| = 6534.
		

Crossrefs

Formula

n = f(f(n)), n <> f(n), where f: x -> |x - reverse(x)|.

Extensions

More terms from Ray Chandler, Oct 09 2017

A072138 Smallest k whose 'Reverse and Subtract' trajectory has a preperiodic part of length n.

Original entry on oeis.org

0, 1, 10, 16, 14, 15, 13, 1011, 1017, 1037, 1027, 1014, 1013, 1028, 100113, 100104, 100145, 100134, 100103, 100112, 100133, 100187, 100114, 100128, 100194, 100107, 100307, 100277, 100413, 100345, 100429, 100215, 100427, 100214, 100433, 100335
Offset: 0

Views

Author

Klaus Brockhaus, Jun 24 2002

Keywords

Comments

'Reverse and Subtract' (cf. A072137) is defined by x -> |x - reverse(x)|. For small n the last term of the preperiodic part of the trajectory (cf. A072139) is a palindrome, so this sequence is a weak analog of A033665, which uses 'Reverse and Add'. - 1012 is the first n such that last term of the preperiodic part is not palindromic (cf. A072140).

Examples

			a(8) = 1017, since 1017 is the smallest number whose 'Reverse and Subtract' trajectory has eight preperiodic terms: 1017 -> 6084 -> 1278 -> 7443 -> 3996 -> 2997 -> 4995 -> 999.
		

Crossrefs

A072139 Last term of the preperiodic part of the 'Reverse and Subtract' trajectory of n, or -1 if the trajectory is completely periodic.

Original entry on oeis.org

-1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 9, 11, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 22, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 33, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 44, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 55, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 66, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 77, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 88, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 99, 99, 101, 99
Offset: 0

Views

Author

Klaus Brockhaus, Jun 24 2002

Keywords

Comments

'Reverse and Subtract' (cf. A072137) is defined by x -> |x - reverse(x)|. For small n the positive terms are the first palindrome in the trajectory of n, so this sequence is a weak analog of A033865, which uses 'Reverse and Add'. a(1012) = 8712 is the first non-palindrome (cf. A072140). For k in A072140, A072141 or A072142 we have a(k) = -1.

Examples

			a(0) = -1, since 0 -> |0 - 0| = 0, the preperiodic part is empty; a(12) = 9, since 12 -> |12 - 21| = 9.
		

Crossrefs

A335978 Numbers m of the form abs(k - reverse(k)) for at least one k.

Original entry on oeis.org

0, 9, 18, 27, 36, 45, 54, 63, 72, 81, 90, 99, 180, 189, 198, 270, 279, 297, 360, 369, 396, 450, 459, 495, 540, 549, 594, 630, 639, 693, 720, 729, 792, 810, 819, 891, 900, 909, 990, 999, 1089, 1179, 1188, 1269, 1278, 1359, 1368, 1449, 1458, 1539, 1548, 1629, 1638, 1719, 1728, 1800, 1809, 1818, 1890, 1908, 1980, 1989, 1998, 2079
Offset: 1

Views

Author

Michael Greaney, Jul 03 2020

Keywords

Comments

All terms are divisible by 9.
Let f(k) = k - reverse(k). Then f(reverse(k)) = -f(k), since f(reverse(k)) = reverse(k) - reverse(reverse(k)) = reverse(k) - k = - (k - reverse(k)) = -f(k).
Iteration of the function f(k) = k - reverse(k) leads to A072140, A072141, A072142, and A072143.

Crossrefs

Dividing by 9 gives A334145.

A072144 Numbers n such that the period length of the 'Reverse and Subtract' trajectory of n is greater than 2.

Original entry on oeis.org

10001145, 10001827, 10002179, 10002289, 10002894, 10003037, 10003268, 10003378, 10004412, 10004698, 10006304, 10007624, 10007734, 10007965, 10008108, 10008713, 10008823, 10009175, 10009857, 10010022, 10010484
Offset: 1

Views

Author

Klaus Brockhaus, Jun 24 2002

Keywords

Comments

'Reverse and Subtract' (cf. A072137) is defined by x -> |x - reverse(x)|. - Subsequence of A072140.

Examples

			10001145 -> 44108856 -> 21771288 -> 66446424 -> 23981958 and 23981958 as a term of A072142 is the first term of the periodic part of the trajectory of 10001145, period length is 14.
		

Crossrefs

A072145 Numbers k such that the period of the 'Reverse and Subtract' trajectory of k is greater than 14.

Original entry on oeis.org

100000114412, 100000124422, 100000125522, 100000126622, 100000177959, 100000192292, 100000214413, 100000215513, 100000218813, 100000221123, 100000228823, 100000248843, 100000269963, 100000271173, 100000302204
Offset: 1

Views

Author

Klaus Brockhaus, Jun 24 2002

Keywords

Comments

'Reverse and Subtract' (cf. A072137) is defined by x -> |x - reverse(x)|.
Subsequence of A072144.

Examples

			100000114412 -> 114410885589 -> 871177128822 -> 642355357644 -> 195601804398 -> 697806302193 -> 306602693397 -> 486793513206 -> 115521884478 and 115521884478 as a term of A072143 is the first term of the periodic part of the trajectory of 100000114412, period is 22.
		

Crossrefs

Extensions

Offset corrected by Sean A. Irvine, Sep 04 2024
Showing 1-9 of 9 results.