A099009
Fixed points of the Kaprekar mapping f(n) = n' - n'', where in n' the digits of n are arranged in descending, in n'' in ascending order.
Original entry on oeis.org
0, 495, 6174, 549945, 631764, 63317664, 97508421, 554999445, 864197532, 6333176664, 9753086421, 9975084201, 86431976532, 555499994445, 633331766664, 975330866421, 997530864201, 999750842001, 8643319766532, 63333317666664
Offset: 1
6174 is a fixed point of the mapping and hence a term: 6174 -> 7641 - 1467 = 6174.
- Syed Iddi Hasan, Table of n, a(n) for n = 1..8924
- Mauro Fiorentini, Kaprekar (costante di) (in Italian)
- Manuj Mishra, Illustration of first 8923 terms, with each digit in a different color
- Manuj Mishra, Illustration as above but only including terms of even length
- Manuj Mishra, Illustration as above but only including terms of odd length
- Joseph Myers, List of cycles under Kaprekar map (all numbers with <= 60 digits; cycles are represented by their smallest value)
- Conrad Roche, Kaprekar Series Generator.
- Eric Weisstein's World of Mathematics, Kaprekar Routine
- Index entries for the Kaprekar map
-
a099009 n = a099009_list !! (n-1)
a099009_list = [x | x <- [0..], a151949 x == x]
-- Reinhard Zumkeller, Mar 23 2015
-
a:=func; [k:k in [0..10^7]|a(k)]; // Marius A. Burtea, Sep 12 2019
-
f[n_] := Block[{d = IntegerDigits@ n, a, b}, a = FromDigits@ Sort@ d; b = FromDigits@ Reverse@ Sort@ d; n == b - a]; Select[Range@ 1000000, f] (* Michael De Vlieger, Mar 20 2015 *)
-
# (version 2.4) from Tim Peters
def extend(base, start, n):
if n == 0:
yield base
return
for i in range(start, 10):
for x in extend(base + str(i), i, n-1):
yield x
def drive(n):
result = []
for lo in extend("", 0, n):
ilo = int(lo)
if ilo == 0 and n > 1:
continue
hi = lo[::-1]
diff = str(int(hi) - ilo)
diff = "0" * (n - len(diff)) + diff
if sorted(diff) == list(lo):
result.append(diff)
return sorted(result)
for n in range(1, 17):
# print("Length", n)
# print('-' * 40)
for r in drive(n):
print(r, end=', ')
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
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.
- 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.
-
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
-
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 *)
Initial zero added for consistency with other bases by
Joseph Myers, Aug 29 2009
A165095
Consider the base-8 Kaprekar map n->K(n) defined in A165090. Sequence gives numbers belonging to cycles, including fixed points.
Original entry on oeis.org
0, 21, 252, 1022, 1589, 2044, 2212, 2723, 3122, 3178, 3290, 17892, 20475, 21483, 21987, 25578, 26586, 102837, 147420, 177443, 213402, 217938, 1445787, 1449819, 1646442, 1707930, 1711962, 1715994, 1740690, 1752786, 1777482, 1941345
Offset: 1
A165016
List of fixed points of the base-4 Kaprekar map A165012.
Original entry on oeis.org
0, 30, 201, 2550, 3369, 3873, 14565, 54441, 62625, 64641, 171990, 234405, 254865, 873129, 954261, 1004193, 1036929, 1044993, 3755685, 4083345, 4165185, 11140950, 13978281, 15285909, 16075425, 16399953, 16599681, 16730625, 16762881
Offset: 1
A165055
List of fixed points of the base-6 Kaprekar map A165051.
Original entry on oeis.org
0, 105, 5600, 27195, 33860, 42925, 1275170, 1657225, 6018495, 45962330, 47681900, 56319925, 60331825, 277695950, 348285175, 1305060855, 2151904825, 2175976225, 10363227560, 12973622725, 59994427550, 60063064790, 73115587525
Offset: 1
A164997
List of fixed points of the base-3 Kaprekar map A164993.
Original entry on oeis.org
0, 184, 2008, 5332, 19144, 55360, 146488, 175528, 520372, 1502344, 1589464, 3975844, 4749760, 14072968, 14334328, 40625344, 42947092, 107527864, 128312344, 129096424, 380156356, 387121600, 1097424568, 1159778008
Offset: 1
A165036
List of fixed points of the base-5 Kaprekar map A165032.
Original entry on oeis.org
0, 8, 392, 1831056, 48217776, 1217651376, 30502319376, 144640604656, 762863159376, 3774960835776, 19073104859376, 95168749491376, 476835250859376, 2383192380269376, 11320075681132656, 11920919418359376
Offset: 1
A165075
List of fixed points of the base-7 Kaprekar map A165071.
Original entry on oeis.org
0, 1922263344, 94197649008, 96503566608, 4615731883344, 4728721980144, 4744863403344, 226171191723408, 231707706601008, 232498637278608, 232611627241008, 11082390700389744, 11353679929526544, 11392435533669744
Offset: 1
A165114
List of fixed points of the base-9 Kaprekar map A165110.
Original entry on oeis.org
0, 41520, 31531872, 326952560, 2598744000, 23087388720, 1901588877840, 16838844110112, 19656251882912, 154312292512560, 1386833627452800, 12276176375647920, 16416600735609280, 112539509113431072
Offset: 1
A165097
Consider the base-8 Kaprekar map n->K(n) defined in A165090. Sequence gives numbers belonging to cycles of length greater than 1.
Original entry on oeis.org
1022, 1589, 2044, 2212, 2723, 3122, 3178, 3290, 17892, 20475, 21483, 21987, 25578, 26586, 102837, 177443, 217938, 1445787, 1449819, 1646442, 1707930, 1715994, 1740690, 1752786, 1777482, 1941345, 1978137, 1982169, 6589877, 11381027
Offset: 1
Showing 1-10 of 16 results.
Comments