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-2 of 2 results.

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

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

Original entry on oeis.org

10695314508256806604321090888649339244708568530399, 11787342277647023379656208735392766826312885522179, 14638655404662283607788118901219361883250644206458, 26730889210860738952361172793674105293199801097128
Offset: 1

Views

Author

Ray Chandler, Sep 28 2017

Keywords

Comments

There are 15 fifty-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 10695314508256806604321090888649339244708568530399, 26730889210860738952361172793674105293199801097128, 29899105876561459824028272726867015583422139910097, 49102887245877091252834454555175879833145710289795, 55448121688278511195278554322651878413601497706634, 68315444154984874470735536347381553142144945548514, 88608272072487486790367718123691321620571972829202) 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. - Ray Chandler, Oct 15 2017

Examples

			10695314508256806604321090888649339244708568530399 -> 88608272072487486790367718123691321620571972829202 -> 68315444154984874470735536347381553142144945548514 -> 26730889210860738952361172793674105293199801097128 -> 55448121688278511195278554322651878413601497706634 -> 11787342277647023379656208735392766826312885522179 -> 85335216543715843349697571530304565248364338856532 -> 61769333197331586809394053950610230396629777603174 -> 14638655404662283607788118901219361883250644206458 -> 70821589200576532783422862287551276343389811477183 -> 32644177302242165567844635465112552775889512964376 -> 34702744296615559953311818179764003348330864180247 -> 39505402506768770093485363631571992203338380540496 -> 29899105876561459824028272726867015583422139910097 -> 49102887245877091252834454555175879833145710289795.
		

Crossrefs

Formula

n = f^15(n), n <> f^k(n) for k < 15, where f: x -> |x - reverse(x)|.
Showing 1-2 of 2 results.