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 31-40 of 41 results. Next

A164730 Least element of each cycle of length 7 under the Kaprekar map A151949.

Original entry on oeis.org

420876, 43208766, 4332087666, 433320876666, 43333208766666, 4333332087666666, 433333320876666666, 43333333208766666666, 4333333332087666666666, 433333333320876666666666
Offset: 1

Views

Author

Joseph Myers, Aug 23 2009

Keywords

Crossrefs

A151947 a(1) = 113; thereafter a(n) = (a(n-1) with digits sorted into descending order) - (a(n-1) with digits sorted into ascending order) (see the Kaprekar map, A151949).

Original entry on oeis.org

113, 198, 792, 693, 594, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495
Offset: 1

Views

Author

N. J. A. Sloane, Aug 18 2009

Keywords

Comments

Converges to the fixed point 495. For the list of fixed points see A099009.

Crossrefs

A151955 a(1) = 102; thereafter a(n) = (a(n-1) with digits sorted into descending order) - (a(n-1) with digits sorted into ascending order) (see the Kaprekar map, A151949).

Original entry on oeis.org

102, 198, 792, 693, 594, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495
Offset: 1

Views

Author

Harvey P. Dale. Aug 18 2009

Keywords

Comments

102 is the smallest starting value which does not converge to 0.
Converges to the fixed point 495. For the list of fixed points see A099009.

Crossrefs

A151946 a(1) = 8127; thereafter a(n) = (a(n-1) with digits sorted into descending order) - (a(n-1) with digits sorted into ascending order) (see the Kaprekar map, A151949).

Original entry on oeis.org

8127, 7443, 3996, 6264, 4176, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174
Offset: 1

Views

Author

N. J. A. Sloane, Aug 18 2009

Keywords

Comments

Similar in spirit to the RATS (Reverse, Add Then Sort) sequences.
Converges to the fixed point 6174. For the list of fixed points see A099009.
The initial value 1001 is the smallest number that converges to 6174 - see A151967.

Crossrefs

A151951 a(1) = 1113; thereafter a(n) = (a(n-1) with digits sorted into descending order) - (a(n-1) with digits sorted into ascending order) (see the Kaprekar map, A151949).

Original entry on oeis.org

1113, 1998, 8082, 8532, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174
Offset: 1

Views

Author

N. J. A. Sloane, Aug 18 2009

Keywords

Crossrefs

Programs

  • Mathematica
    NestList[FromDigits[Reverse[Sort[IntegerDigits[#]]]]-FromDigits[Sort[ IntegerDigits[ #]]]&,1113,40] (* or *) PadRight[{1113,1998,8082,8532},40,{6174}] (* Harvey P. Dale, May 10 2021 *)

A151956 a(1) = 1002; thereafter a(n) = (a(n-1) with digits sorted into descending order) - (a(n-1) with digits sorted into ascending order) (see the Kaprekar map, A151949).

Original entry on oeis.org

1002, 2088, 8532, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174
Offset: 1

Views

Author

Harvey P. Dale, Aug 18 2009

Keywords

Comments

For the list of fixed points see A099009.

Crossrefs

A309223 Bisection A164733(2*n).

Original entry on oeis.org

0, 1, 2, 2, 3, 5, 6, 8, 12, 14, 17, 21, 25, 30, 36, 43, 49, 58, 66, 75, 85, 96, 109, 121, 136, 150, 167, 184, 202, 222, 242, 265, 287, 313, 338
Offset: 1

Views

Author

N. J. A. Sloane, Aug 29 2019, following a suggestion from Manuj Mishra

Keywords

Comments

This sequence and the other bisection A309224 are initially very similar: there appear to be blocks of terms that are identical except that the initial terms differ by 1. For example, [30, 36, 43, 49, 58, 66, 75] here versus [31, 36, 43, 49, 58, 66, 75] in A309224. Is there a simple explanation? - N. J. A. Sloane, Aug 31 2019

Crossrefs

A309224 Bisection A164733(2*n+1).

Original entry on oeis.org

1, 1, 0, 0, 2, 1, 1, 2, 2, 3, 5, 7, 8, 12, 14, 17, 21, 25, 31, 36, 43, 49, 58, 66, 75, 86, 96, 109, 121, 136, 150, 167, 185, 202, 222
Offset: 1

Views

Author

N. J. A. Sloane, Aug 29 2019, following a suggestion from Manuj Mishra

Keywords

Crossrefs

A319839 Smallest fixed points (>0) of the base-2*n Kaprekar map.

Original entry on oeis.org

9, 30, 105, 21, 495, 858, 65, 2040, 2907, 133, 5313, 6900, 225, 10962, 13485, 341, 19635, 23310, 481, 31980, 37023, 645, 48645, 55272, 833, 70278, 78705, 1045, 97527, 107970, 1281, 131040, 143715, 1541, 171465, 186588, 1825, 219450, 237237, 2133, 275643, 296310, 2465
Offset: 1

Views

Author

Seiichi Manyama, Sep 29 2018

Keywords

Crossrefs

Programs

  • Ruby
    def f(k, n)
      ary = []
      while n > 0
        ary << n % k
        n /= k
      end
      ary
    end
    def g(k, ary)
      (0..ary.size - 1).inject(0){|s, i| s + ary[i] * k ** i}
    end
    def A319798(n)
      i = 1
      ary = [1]
      while g(n, ary) - g(n, ary.reverse) != i
        i += 1
        ary = f(n, i).sort
      end
      i
    end
    def A319839(n)
      (1..n).map{|i| A319798(2 * i)}
    end
    p A319839(20)

Formula

a(n) = A319798(2*n).

A160761 The Kaprekar binary numbers in decimal.

Original entry on oeis.org

9, 9, 9, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 45, 45, 49, 45, 49, 49, 45, 45, 49, 49, 45, 49, 45, 45, 45, 49, 49, 45, 49, 45, 45, 49, 45, 45, 45, 93, 93, 105, 93, 105, 105, 105, 93, 105, 105, 105, 105, 105, 105, 93, 93, 105, 105, 105, 105, 105, 105, 93, 105, 105, 105
Offset: 1

Views

Author

Damir Olejar, May 25 2009

Keywords

Examples

			The number 9 is 1001 in binary. The maximum number using the same number of 0's and one's is found and the minimum number having the same number of 0's and 1's is found to obtain the equation such as 1100 - 0011 = 1001. Repeating the same procedure always gives us the same number and pattern of 0's and 1's. Therefore 9 is one of the Kaprekar numbers. Numbers that end the procedure in 0 are excluded since they are not Kaprekar numbers.
		

References

  • M. Charosh, Some Applications of Casting Out 999...'s, Journal of Recreational Mathematics 14, 1981-82, pp. 111-118
  • D. R. Kaprekar, On Kaprekar numbers, J. Rec. Math., 13 (1980-1981), 81-82.

Crossrefs

Programs

  • Java
    class pattern { public static void main(String args[]) { int mem1 = 0; int mem2 =1; for (int i = 1; i<3000; i++) {do { mem1 = mem2; String binaryi = Integer.toBinaryString(i); String binarysort = ""; String binaryminimum = ""; for (int n = 0; n< binaryi.length(); n++) { String g = binaryi.substring(n,n+1); if (g.equals("0")){ binarysort = binarysort+"0"; } else { binarysort = "1"+binarysort; binaryminimum = binaryminimum + "1"; } } int binrev1 = Integer.parseInt(binarysort , 2); int binrev2 = Integer.parseInt(binaryminimum , 2); int diff = binrev1 - binrev2; mem2 = diff; } while (mem2!=0 && mem2!=mem1); String memtobin = Integer.toBinaryString(mem1); int ones = 0; for (int t = 0; t
    				
  • Mathematica
    nmax = 100; f[n_] := Module[{id, sid, min, max}, id = IntegerDigits[n, 2]; min = FromDigits[sid = Sort[id], 2]; max = FromDigits[Reverse[sid], 2]; max - min]; Reap[Do[If[(fpn = FixedPoint[f, n]) > 0, Sow[fpn]], {n, 1, nmax}]][[2, 1]] (* Jean-François Alcover, Apr 23 2017 *)

Formula

1. Sort all integers from the number in descending order 2. Sort all integers from the number in ascending order 3. Subtract ascending from descending order to obtain a new number 4. Repeat the steps 1-3 with a new number until a repetitive sequence is obtained or until a zero is obtained. 5. Call the repetitive sequence's number a Kaprekar number, ignore zeros.
Previous Showing 31-40 of 41 results. Next