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.

Previous Showing 11-20 of 20 results.

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

A288536 The eventual period of the RATS sequence in base n starting from 1; 0 is for infinity.

Original entry on oeis.org

1, 3, 2, 2, 8, 4, 3, 2, 0, 28, 90, 8, 72, 3, 4, 2, 64, 0, 18, 4, 18, 20, 396, 8, 160, 120, 18, 6, 28, 4, 5, 2, 210, 384, 240, 0, 648, 1242, 240, 4, 660, 18, 798, 380, 852, 1298, 1771, 8, 0, 160, 16, 372, 520, 1404, 1740, 6, 36, 2072, 1856, 380, 300, 215, 6, 2, 3384, 50, 2310, 3784, 2904
Offset: 2

Views

Author

Andrey Zabolotskiy, Jun 11 2017

Keywords

Comments

Eventual period of 1 under the mapping x->A288535(n,x), or 0 if there is a divergence and thus no eventual period.
Column 1 of A288537.
In Thiel's terms, the zeroes a(10), a(19), and a(37) correspond to quasiperiodic divergent RATS sequences with quasiperiod 2, while a(50)=0 corresponds to a sequence with quasiperiod 3.

Examples

			In base 3, the RATS mapping acts as 1 -> 2 -> 4 (11 in base 3) -> 8 (22 in base 3) -> 13 (112 in base 3) -> 4, which has already been seen 3 steps ago, so a(3)=3.
		

Crossrefs

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

A072147 Records for the length of the preperiodic part of the 'Reverse and Subtract' trajectories.

Original entry on oeis.org

0, 1, 2, 6, 7, 12, 13, 18, 25, 40, 45, 47, 48, 49, 55, 56, 60, 62, 63, 64, 66, 71, 72, 75, 78, 81, 106, 108, 111, 112, 114, 115, 119, 121, 122, 130, 132, 133, 135, 147, 148, 149, 151, 156
Offset: 1

Views

Author

Klaus Brockhaus, Jun 24 2002

Keywords

Comments

Successive maxima in sequence A072137. A072146 gives the corresponding starting points. - This sequence is a weak analog of A065199, which uses 'Reverse and Add'.

Examples

			6 is a record, since the preperiodic part of the trajectory of 13 has length 6 and for k < 13 the preperiodic part has a smaller length (at most 2).
		

Crossrefs

Extensions

a(18) inserted, a(25) corrected, a(29) through a(44) added by Alexander Pesch (alex-physics(AT)gmx.net), May 29 2007
Edited by N. J. A. Sloane, Dec 01 2007

A069627 Sum_{k=1..n} floor(n*(n-1)/(2*k)).

Original entry on oeis.org

0, 0, 1, 5, 12, 22, 35, 53, 74, 101, 129, 162, 202, 244, 292, 344, 403, 463, 527, 601, 676, 762, 844, 937, 1035, 1138, 1245, 1355, 1476, 1597, 1726, 1862, 2002, 2149, 2300, 2454, 2621, 2784, 2957, 3136, 3323, 3515, 3707, 3914, 4119, 4338, 4551, 4782, 5012, 5250
Offset: 0

Views

Author

N. J. A. Sloane, Oct 28 2008

Keywords

Comments

The old entry with this sequence number was a duplicate of A072137.

Crossrefs

Programs

  • Maple
    f:=n->add(floor( n*(n-1)/(2*k) ),k=1..n );

Formula

a(n) ~ n^2 * (gamma + log(n))/2, where gamma is the Euler-Mascheroni constant A001620. - Vaclav Kotesovec, Dec 23 2020

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

A343383 Length of the preperiodic part of 'Roll 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
Offset: 0

Views

Author

Jonathon Priestley, Apr 12 2021

Keywords

Comments

'Roll and Subtract' is defined by x -> |x - roll(x)|, where roll(x) takes the first digit of a number and moves it to the back (rolls it around to the back).
Differs from A151962 first at n=101. - R. J. Mathar, May 07 2021

Examples

			a(119) = 4 since |119 - 191| = 72 -> |72 - 27| = 45 -> |45 - 54| = 9 -> |9 - 9| = 0. The value a(0) maps to 0, so the sequence ends there after 4 values have been traversed.
a(12737) = 1 since |12737 - 27371| = 14634 -> |14634 - 46341| = 31707 -> |31707 - 17073| = 14634. Since 14634 is already in the sequence, the sequence ends there.
		

Crossrefs

Cf. A072137 (reverse and subtract).

Programs

  • Mathematica
    Array[Function[w, LengthWhile[w, # != Last[w] &]]@ NestWhileList[Abs[# - FromDigits@ RotateLeft@ IntegerDigits[#]] &, #, Unequal, All] &, 105, 0] (* Michael De Vlieger, Apr 13 2021 *)
  • Python
    def roll(n):
        """ Moves first digit to the back """
        s = str(n)
        return int(s[1:] + s[0])
    def backtrack(past, length, offset, dct):
        """ Goes through every value passed and adds it and it's length to the dictionary """
        if length == 0:
            for elem in past:
                dct[elem] = 0
        i = 0
        while length > 0:
            n = past[i]
            dct[n] = length + offset
            i += 1
            length -= 1
        return dct
    def a(n, dct):
        past = []
        length = 0
        while (n not in dct):
            past.append(n)
            length += 1
            n = abs(n - roll(n))
            if n in past: # For duplicates
                length = past.index(n)
                dct = backtrack(past, length, 0, dct)
                return dct, length
        offset = dct[n]
        dct = backtrack(past, length, offset, dct)
        length += offset
        return dct, length
    dct = {}
    sequence = []
    i = 1
    while i < 1000:
        out = a(i, dct)
        dct = out[0]
        sequence.append(out[1])
        i += 1

A109891 Least number that requires n steps to reach 0 by repeated application of f: x -> abs(x - reverse(x)).

Original entry on oeis.org

0, 1, 10, 16, 14, 15, 13, 1011, 1017, 1037, 1027, 1014, 1013, 1028, 100143, 100135, 100145, 100134, 100103, 100195, 100137, 100227, 100114, 100128, 100194, 100107, 100307, 100277, 100413, 100345, 100429, 100215, 100444, 100237, 100433, 100335
Offset: 0

Views

Author

Amarnath Murthy, Jul 13 2005

Keywords

Comments

Coincides with A072138 for the first 14 and many later terms.

Examples

			f(16) = 61-16 = 45, f(45) = 54-45 = 9, f(9) = 9-9 = 0. For no k < 16 exactly three steps lead to 0, hence a(3) = 16.
		

Crossrefs

Extensions

Edited, corrected and extended by Klaus Brockhaus, Jul 14 2005
Previous Showing 11-20 of 20 results.