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

A214555 Subsequence of fixed points A099009 of the Kaprekar mapping with numbers of the form 5(n)//4//9(n+1)//4(n)//5.

Original entry on oeis.org

495, 549945, 554999445, 555499994445, 555549999944445, 555554999999444445, 555555499999994444445, 555555549999999944444445, 555555554999999999444444445, 555555555499999999994444444445, 555555555549999999999944444444445
Offset: 0

Views

Author

Syed Iddi Hasan, Jul 20 2012

Keywords

Comments

The symbols // denote concatenation of digits in the definition, and d(n) denotes n repetitions of d, n >= 0.
Conjecture: satisfies a linear recurrence having signature (1111, -112110, 1111000, -1000000). - Harvey P. Dale, Nov 23 2022

Examples

			549945 is a fixed point of the mapping for n=1.
		

Crossrefs

Programs

  • Mathematica
    Table[FromDigits[Join[PadRight[{},n,5],{4},PadRight[{},n+1,9],PadRight[{},n,4],{5}]],{n,0,15}] (* Harvey P. Dale, Nov 23 2022 *)

Formula

If d(n) denotes n repetitions of the digit d, then a(n) = 5(n)49(n+1)4(n)5, where n >= 0.

A214556 Subsequence of fixed points A099009 of the Kaprekar mapping with numbers of the form 6//3(n)//17//6(n)//4.

Original entry on oeis.org

6174, 631764, 63317664, 6333176664, 633331766664, 63333317666664, 6333333176666664, 633333331766666664, 63333333317666666664, 6333333333176666666664, 633333333331766666666664
Offset: 0

Views

Author

Syed Iddi Hasan, Jul 20 2012

Keywords

Comments

The symbols // denote concatenation of digits in the definition, and d(n) denotes n repetitions of d, n >= 0.

Examples

			631764 is a fixed point of the mapping for n=1.
		

Crossrefs

Formula

If d(n) denotes n repetitions of the digit d, then a(n) = 63(n)176(n)4, where n >= 0.

A214559 Subsequence of fixed points A099009 of the Kaprekar mapping with numbers of the form 9(x1+1)//8(x2)//7(x3+1)//6(x2)//5(x3+1)//4(x2)//3(x4)//2(x2)//1(x3)//0//9(x2)//8(x3+1)//7(x2)//6(x4)//5(x2)//4(x3+1)//3(x2)//2(x3+1)//1(x2)//0(x1)//1.

Original entry on oeis.org

97508421, 9753086421, 9975084201, 975330866421, 997530864201, 999750842001, 97533308666421, 97755108844221, 99753308664201, 99975308642001, 99997508420001, 9753333086666421, 9775531088644221, 9975333086664201, 9977551088442201, 9997533086642001, 9999753086420001
Offset: 0

Views

Author

Syed Iddi Hasan, Jul 20 2012

Keywords

Comments

The sign // denotes concatenation of digits in the definition, and d(x) denotes x repetitions of d, x>=0.
Adding digits that share the same "x_i" parameter (where i=1,2,3,4) yields sums divisible by 9 (that is, with the digital root being equal to 9): i=1, 9+0=9; i=2, 8+6+4+2+9+7+5+3+1=45; i=3, 7+5+1+8+4+2=27; i=4, 3+6=9. - Alexander R. Povolotsky, Mar 19 2015

Examples

			9753086421 is a fixed point of the mapping for x1=0, x2=0, x3=0, x4=1.
		

Crossrefs

Formula

If d(x) denotes x repetitions of the digit d, then a(n)=9(x1+1)8(x2)7(x3+1)6(x2)5(x3+1)4(x2)3(x4)2(x2)1(x3)09(x2)8(x3+1)7(x2)6(x4)5(x2)4(x3+1)3(x2)2(x3+1)1(x2)0(x1)1, where x1,x2,x3,x4>=0.

Extensions

More terms using b-file by Michel Marcus, Mar 27 2015

A214557 Subsequence of fixed points A099009 of the Kaprekar mapping with numbers of the form 8(x1+1)//6(x1+1)//4(x1+1)//3(x2)//2(x1)//1//9(x1+1)//7(x1+1)//6(x2)//5(x1+1)//3(x1+1)//1(x1)//2.

Original entry on oeis.org

864197532, 86431976532, 8643319766532, 864333197666532, 86433331976666532, 886644219977553312, 8643333319766666532, 88664432199776553312, 864333333197666666532, 8866443321997766553312, 86433333331976666666532, 886644333219977666553312
Offset: 0

Views

Author

Syed Iddi Hasan, Jul 20 2012

Keywords

Comments

The sign // denotes concatenation of digits in the definition, and d(x) denotes x repetitions of d, x>=0.

Examples

			86431976532 is a fixed point of the mapping for x1=0, x2=1.
		

Crossrefs

Formula

If d(x) denotes x repetitions of the digit d, then a(n)=8(x1+1)6(x1+1)4(x1+1)3(x2)2(x1)19(x1+1)7(x1+1)6(x2)5(x1+1)3(x1+1)1(x1)2, where x1,x2>=0.

Extensions

Terms a(5) and beyond from b-file by Andrew Howroyd, Feb 05 2018

A214558 Subsequence of fixed points A099009 of the Kaprekar mapping with numbers of the form 8(x1+1)//7(2*x2)//6(x1+1)//5(x2)//4(x1+x2+1)//3(x2)//2(x1+x2)//1//9(x1+2*x2+1)//7(x1+x2+1)//6(x2)//5(x1+x2+1)//4(x2)//3(x1+1)//2(2*x2)//1(x1)//2.

Original entry on oeis.org

864197532, 886644219977553312, 87765443219997765543222, 888666444221999777555333112, 88776654443221999977765554332212
Offset: 0

Views

Author

Syed Iddi Hasan, Jul 20 2012

Keywords

Comments

The sign // denotes concatenation of digits in the definition, and d(x) denotes x repetitions of d, x>=0.

Examples

			886644219977553312 is a fixed point of the mapping for x1=1, x2=0.
		

Crossrefs

Formula

If d(x) denotes x repetitions of the digit d, then a(n)=8(x1+1)7(2*x2)6(x1+1)5(x2)4(x1+x2+1)3(x2)2(x1+x2)19(x1+2*x2+1)7(x1+x2+1)6(x2)5(x1+x2+1)4(x2)3(x1+1)2(2*x2)1(x1)2, where x1,x2>=0.

A132155 a(n) = A099009(n)/9.

Original entry on oeis.org

0, 55, 686, 61105, 70196, 7035296, 10834269, 61666605, 96021948, 703686296, 1083676269, 1108342689, 9603552948, 61722221605, 70370196296, 108370096269, 110836762689, 111083426889, 960368862948, 7037035296296, 10837034296269
Offset: 1

Views

Author

Keywords

Crossrefs

Cf. A099009.

Programs

Extensions

Extended by Joseph Myers, Aug 26 2009

A151949 a(n) = image of n under the Kaprekar map n -> (n with digits sorted into descending order) - (n with digits sorted into ascending order).

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 9, 18, 27, 36, 45, 54, 63, 72, 18, 9, 0, 9, 18, 27, 36, 45, 54, 63, 27, 18, 9, 0, 9, 18, 27, 36, 45, 54, 36, 27, 18, 9, 0, 9, 18, 27, 36, 45, 45, 36, 27, 18, 9, 0, 9, 18, 27, 36, 54, 45, 36, 27, 18, 9, 0, 9, 18, 27, 63, 54, 45, 36, 27, 18, 9, 0, 9, 18, 72, 63, 54, 45, 36, 27, 18, 9, 0, 9, 81, 72, 63, 54, 45, 36, 27, 18, 9, 0, 99, 99, 198, 297, 396, 495, 594, 693, 792, 891, 99, 0, 99, 198, 297, 396, 495, 594, 693, 792
Offset: 0

Views

Author

N. J. A. Sloane, Aug 18 2009

Keywords

Comments

Entries are multiples of 9 - see A151950.
a(n) = A004186(n) - A004185(n); a(A010785(n)) = 0. - Reinhard Zumkeller, corrected: Mar 23 2015, Jul 09 2013

Examples

			For n = 15, a(15) = 51 - 15 = 36. - _Indranil Ghosh_, Feb 01 2017
		

Crossrefs

In other bases: A164884 (base 2), A164993 (base 3), A165012 (base 4), A165032 (base 5), A165051 (base 6), A165071 (base 7), A165090 (base 8), A165110 (base 9). - Joseph Myers, Sep 05 2009
Cf. also A004185, A004186, A099009 (fixed points).

Programs

  • Haskell
    a151949 n = a004186 n - a004185 n
    -- Reinhard Zumkeller, corrected: Mar 23 2015, Jul 09 2013
    
  • Mathematica
    f[n_] := Module[{idn = IntegerDigits@n, idns}, idns = Sort@ idn; FromDigits@ Reverse@ idns - FromDigits@ idns]; Table[ f@n, {n, 0, 200}] (* Harvey P. Dale, Aug 18 2009 *)
    Flatten[Table[Differences[FromDigits /@ {y = Sort[x = IntegerDigits[n]], Reverse[y]}], {n, 0, 74}]] (* Jayanta Basu, Jul 11 2013 *)
  • PARI
    a(n) = {my(d=digits(n)); fromdigits(vecsort(d,,4)) - fromdigits(vecsort(d));} \\ Michel Marcus, Dec 08 2019
  • Python
    def A151949(n):
        return int("".join(sorted(str(n),reverse=True)))-int("".join(sorted(str(n)))) # Indranil Ghosh, Feb 01 2017
    

Extensions

More terms from Robert G. Wilson v, Aug 19 2009
More than the usual number of terms are shown in order to distinguish this from similar sequences. - N. J. A. Sloane, Sep 22 2021

A163205 The non-repetitive Kaprekar binary numbers in decimal.

Original entry on oeis.org

0, 9, 21, 45, 49, 93, 105, 189, 217, 225, 381, 441, 465, 765, 889, 945, 961, 1533, 1785, 1905, 1953, 3069, 3577, 3825, 3937, 3969, 6141, 7161, 7665, 7905, 8001, 12285, 14329, 15345, 15841, 16065, 16129, 24573, 28665, 30705, 31713, 32193, 32385
Offset: 1

Views

Author

Damir Olejar, Jul 23 2009

Keywords

Comments

Same as A160761, but with no repetitions. The numbers also exist in A143088, except that every first and last number is omitted from A143088's pyramid.
From Joseph Myers, Aug 29 2009: (Start)
Note that all base-2 cycles are fixed points.
Initial terms in base 2: 0, 1001, 10101, 101101, 110001, 1011101, 1101001, 10111101, 11011001, 11100001. (End)

Examples

			The number 9 is 1001 in binary. The maximum number using the same number of 0's and 1'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 gives us the same number and pattern of 0's and 1's. Therefore 9 is one of the Kaprekar numbers. If 9 did not occur before, it is counted as a number that belongs to a sequence and added to a database to skip repetitions. Numbers that end the procedure in 0 are excluded since they are not Kaprekar numbers. A number 9 can also be obtained with, let's say, 1100. Since number 9 already occurred for 1001, the number 9 occurring for 1100 is ignored to avoid repetition.
		

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), pp. 81-82.

Crossrefs

In other bases: A164997 (base 3), A165016 (base 4), A165036 (base 5), A165055 (base 6), A165075 (base 7), A165094 (base 8), A165114 (base 9), A099009 (base 10).

Programs

  • Java
    import java.util.*; class pattern { public static void main(String args[]) { int mem1 = 0; int mem2 =1; ArrayList memory = new ArrayList(); for (int i = 1; i
    				
  • Mathematica
    nmax = 10^5; 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, 0, nmax}]][[2, 1]] // Union // Prepend[#, 0]& (* 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 and repetitions from the set of the final results.

Extensions

Initial zero added for consistency with other bases by Joseph Myers, Aug 29 2009

A099010 Consider the Kaprekar map n->K(n) defined in A151949. Sequence gives numbers belonging to cycles of length greater than 1.

Original entry on oeis.org

53955, 59994, 61974, 62964, 63954, 71973, 74943, 75933, 82962, 83952, 420876, 642654, 750843, 840852, 851742, 860832, 862632, 7509843, 7519743, 7619733, 8429652, 8439552, 8649432, 8719722, 9529641, 43208766, 64308654, 64326654
Offset: 1

Views

Author

Klaus Brockhaus, Sep 22 2004

Keywords

Comments

86526432, 64308654, 83208762 form a cycle of length three and 86308632, 86326632, 64326654, 43208766, 85317642, 75308643, 84308652 form a cycle of length seven.

Examples

			53955 and 59994 form a cycle of length 2 and hence are terms: 53955 -> 95553 - 35559 = 59994 -> 99954 - 45999 = 53955.
		

Crossrefs

Cf. A164715 (corresponding cycle lengths) [From Joseph Myers, Aug 24 2009]
In other bases: Empty (base 2), A165000 (base 3), A165019 (base 4), A165039 (base 5), A165058 (base 6), A165078 (base 7), A165097 (base 8), A165117 (base 9). [From Joseph Myers, Sep 05 2009]

Extensions

Definition revised ny N. J. A. Sloane, Aug 18 2009
Extended by Joseph Myers, Aug 22 2009

A151959 Consider the Kaprekar map x->K(x) described in A151949. Sequence gives the smallest number that belongs to a cycle of length n under repeated iteration of this map, or -1 if there is no cycle of length n.

Original entry on oeis.org

0, 53955, 64308654, 61974, 86420987532
Offset: 1

Views

Author

Klaus Brockhaus and N. J. A. Sloane, Aug 19 2009

Keywords

Comments

No cycle of length 6 is presently known!
It is also known that a(7) = 420876, a(8) = 7509843, a(14) = 753098643.
From Joseph Myers, Aug 19 2009: (Start)
One does not need to consider every integer of n digits, only the sorted sequences of n digits (of which there are binomial(n+9, 9), so 28048800 for 23 digits). Then you only need to consider those sorted sequences of digits whose total is a multiple of 9, as the number and so the sum of its digits is always a multiple of 9 after the first iteration, which reduces the work by a further factor of about 9.
As a further refinement, the result of a single subtraction, if not zero, will have digit sequence of the form
d_1 d_2 ... d_k-1 9...9 9-d_k ... 9-d_2 9-d_1+1
where the values d_i are in the range 1 to 9 and the sequence of 9's in the middle may be empty.
From this form it follows that for any member of a cycle,
abs(number of 8's - number of 1's) + abs(number of 7's - number of 2's) +
abs(number of 6's - number of 3's) + abs(number of 5's - number of 4's) +
max(0, number of 0's - number of 9's) <= 4,
so given the numbers of 0's, 1's, 2's, 3's and 4's there is little freedom left in choosing the number of each remaining digit.
No further cycle lengths exist up to at least 140 digits. The only 4-cycles up to there are the ones containing 61974 and 62964, the only 8-cycles up to there are the ones containing 7509843 and 76320987633, the only 14-cycle up to there is the one containing 753098643. All the 7-cycles so far follow the pattern
7-cycle: 420876
7-cycle: 43208766
7-cycle: 4332087666
7-cycle: 433320876666
7-cycle: 43333208766666
7-cycle: 4333332087666666 ... (End)

Examples

			a(1) = 0: 0 -> 0.
a(2) = 53955: 53955 -> 59994 -> 53955 -> ...
a(3) = 64308654: 64308654 -> 83208762 -> 86526432 -> 64308654 -> ...
a(4) = 61974: 61974 -> 82962 -> 75933 -> 63954 -> 61974 -> ...
		

Crossrefs

A099009 gives the fixed points and A099010 gives numbers in cycles of length > 1.
Cf. A151949.
In other bases: A153881 (base 2), A165008 (base 3), A165028 (base 4), A165047 (base 5), A165067 (base 6), A165086 (base 7), A165106 (base 8), A165126 (base 9). [Joseph Myers, Sep 05 2009]

Extensions

The term a(3) = 64308654 was initially only a conjecture, but was confirmed by Zak Seidov, Aug 19 2009
a(4) = 61974 corrected by R. J. Mathar, Aug 19 2009 (we had not given the smallest member of the 4-cycle).
a(4) = 61974, a(7) = 420876, and a(8) = 7509843 confirmed by Zak Seidov, Aug 19 2009 (formerly the a(8) value was just an upper bound)
a(5) = 86420987532 and a(14) = 753098643 from Joseph Myers, Aug 19 2009. He also confirms the other values, and remarks that there are no other cycle lengths up to at least 140 digits.
Showing 1-10 of 41 results. Next