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-10 of 13 results. Next

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 *)

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

Original entry on oeis.org

1186781188132188, 1464465185355348, 2178772178212278, 2191191178088088, 2196702178032978, 2202202177977978, 2334334176656658, 3041250269587497, 4361064356389356, 4906609350933906, 6232232537677674, 6543356534566434
Offset: 1

Views

Author

Klaus Brockhaus, Jul 15 2002

Keywords

Comments

There are 17 sixteen-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.
This is a working sequence. It is neither by computation nor by proof guaranteed that there are no smaller or interleaved terms.
All terms are divisible by 1099999989. - Hugo Pfoertner, Sep 23 2020

Examples

			1186781188132188 -> 7625537623744623 -> 4361064356389356 -> 2178772178212278 -> 6543356534566434 -> 2196702178032978 -> 6595606534043934 -> 2202202177977978 -> 6595595534044044 -> 2191191178088088 -> 6617617533823824 -> 2334334176656658 ->  6232232537677674 -> 1464465185355348 -> 6971070630289293 -> 3041250269587497 -> 4906609350933906 -> 1186781188132188.
		

Crossrefs

Formula

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

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

Original entry on oeis.org

118722683079, 138346366158, 178574614218, 277673713317, 316920881277, 336544564356, 435643663455, 455267148336, 614218178574, 633841861653, 713317277673, 851663544732
Offset: 1

Views

Author

Klaus Brockhaus, Jul 15 2002

Keywords

Comments

There are 12 twelve-digit terms in the sequence. Further terms are obtained (a) by inserting at the center of these terms either any number of 0's (for 178574614218, 277673713317, 614218178574, 713317277673) or any number of 9's (for the other eight 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 27 2004.

Examples

			118722683079 -> 851663544732 -> 614218178574 -> 138346366158 -> 713317277673 -> 336544564356 -> 316920881277 -> 455267148336-> 178574614218-> 633841861653-> 277673713317-> 435643663455-> 118722683079.
		

Crossrefs

Formula

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

A072140 The period length of the 'Reverse and Subtract' trajectory of n is greater than 1.

Original entry on oeis.org

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

Views

Author

Klaus Brockhaus, Jun 24 2002

Keywords

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.

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.
		

Crossrefs

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

A215669 Number of decimal digits of the smallest solution for the reverse-and-subtract problem for cycle length n.

Original entry on oeis.org

0, 4, 0, 18, 32, 0, 42, 44, 48, 24, 42, 12, 40, 8, 50, 368, 16, 100, 410, 118, 0, 12, 442, 584, 546, 1104, 482, 148, 2786, 536, 398
Offset: 1

Views

Author

Thorsten Ehlers, Aug 20 2012

Keywords

Comments

Solution x for a given cycle length n for the reverse-and-subtract problem is defined as x = f^n(x), x <> f^j(x) for j < n, where f: k -> |k - reverse(k)|. For some cycle lengths (at least for 1, 3, 6 and 21) no solutions exist, these are marked as 0 in above sequence.
Zero cannot be considered a solution for cycle length 1 as there are nontrivial solutions for other numeral systems, such as 13 (one-three) in base 5 numeral system.
This is an excerpt which shows the smallest solutions with up to 50 digits only:
.n..#digits.....................................smallest.solution......ref
.2........4..................................................2178..A072141
.4.......18....................................169140971830859028..A292634
.5.......32......................10591266563195008940873343680499..A292635
.7.......42............142710354353443018141857289645646556981858..A292856
.8.......44..........16914079504181797053273763831171860502859028..A292857
.9.......48......111603518721165960373027269626940447783074704878..A292858
10.......24..............................101451293600894707746789..A292859
11.......42............166425621223026859056339052269787863565428..A292846
12.......12..........................................118722683079..A072718
13.......40..............1195005230033599502088049947699664004979..A292992
14........8..............................................11436678..A072142
15.......50....10695314508256806604321090888649339244708568530399..A292993
17.......16......................................1186781188132188..A072719
22.......12..........................................108811891188..A072143
Solutions for all cycle lengths up to 31 can be found below in the links section. Remember that a zero means there exists no solution for this specific cycle length.
There are two ways to find such solutions, first you can search in a given range of numbers e.g. from 10000000 to 99999999 and apply reverse-and-subtract to each number until you fall below the smallest number in this range (here: 10000000) or you find a cycle. Obviously, this works well only on small numbers up to 18-20 digits.
The second way is to construct a cycle with a given length n from the outside in until the innermost 2 digits of each number match the conditions for a valid cycle. This way it is possible to get the above results within seconds up to some hours depending on the specific cycle length even on an outdated PC.

Examples

			a(4) = 169140971830859028 as the smallest cycle with length 4 is 169140971830859028 -> 651817066348182933 -> 312535222687464777 -> 464929563535070436 ( -> 169140971830859028 ).
		

Crossrefs

Extensions

Added a reference, formatted and added one more example in comments. - Thorsten Ehlers, Oct 06 2012
Sequences added to comments and crossrefs by Ray Chandler, Sep 27 2017

A073142 List of smallest solutions for some k of x = f^k(x), n <> f^j(n) for j < k, where f: m -> |m - reverse(m)|.

Original entry on oeis.org

0, 2178, 11436678, 108811891188, 118722683079
Offset: 1

Views

Author

Klaus Brockhaus, Jul 17 2002

Keywords

Comments

In the definition, j can be restricted to proper divisors of k. A073143 gives the corresponding values of k. A073144(n) gives the smallest m such that the 'Reverse and Subtract' trajectory of m leads to a(n). Presumably a(6) = 1186781188132188 with k = 17.

Examples

			a(3) = 11436678 is the smallest solution of x = f^14(x) and there is no k such that x = f^k(x) has a smallest solution between a(2) = 2178 and a(3).
		

Crossrefs

Extensions

Offset changed by N. J. A. Sloane, Dec 01 2007

A073143 Numbers k such that A073142(n) = f^k(A073142(n)), where f: m -> |m - reverse(m)|.

Original entry on oeis.org

1, 2, 14, 22, 12
Offset: 1

Views

Author

Klaus Brockhaus, Jul 17 2002

Keywords

Comments

Presumably a(6) = 17. a(n) is the length of the periodic part (cf. A072137) of the trajectory of A073142(n). Question: Does every k > 0 appear in this sequence?

Examples

			a(3) = 14 since A073142(2) = 11436678 is the smallest solution of x = f^14(x).
		

Crossrefs

Extensions

Offset changed by N. J. A. Sloane, Dec 01 2007

A073144 Smallest m such that the 'Reverse and Subtract' trajectory (cf. A072137) of m leads to A073142(n).

Original entry on oeis.org

0, 1012, 10001145, 100000114412, 100010505595
Offset: 1

Views

Author

Klaus Brockhaus, Jul 17 2002

Keywords

Comments

Presumably a(6) = 1000000011011012.

Examples

			1012 -> 1089 -> 8712 -> 6534 -> 2178 = A073142(1) and no m < 1012 leads to 2178.
		

Crossrefs

Extensions

Offset changed by N. J. A. Sloane, Dec 01 2007
Showing 1-10 of 13 results. Next