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.
%I A053816 #89 Jun 03 2025 11:33:02 %S A053816 1,9,45,55,99,297,703,999,2223,2728,4950,5050,7272,7777,9999,17344, %T A053816 22222,77778,82656,95121,99999,142857,148149,181819,187110,208495, %U A053816 318682,329967,351352,356643,390313,461539,466830,499500,500500,533170,538461,609687,643357 %N A053816 Another version of the Kaprekar numbers (A006886): n such that n = q+r and n^2 = q*10^m+r, for some m >= 1, q >= 0 and 0 <= r < 10^m, with n != 10^a, a >= 1 and n an m-digit number. %C A053816 Consider an m-digit number n. Square it and add the right m digits to the left m or m-1 digits. If the resultant sum is n, then n is a term of the sequence. %C A053816 4879 and 5292 are in A006886 but not in this version. %C A053816 Shape of plot (see links) seems to consist of line segments whose lengths along the x-axis depend on the number of unitary divisors of 10^m-1 which is equal to 2^w if m is a multiple of 3 or 2^(w+1) otherwise, where w is the number of distinct prime factors of the repunit of length m (A095370). w for m = 60 is 20, whereas w <= 15 for m < 60. This leads to the long segment corresponding to m = 60. - _Chai Wah Wu_, Jun 02 2016 %C A053816 If n*(n-1) is divisible by 10^m-1 then n is a term where m is the number of decimal digits in n. - _Giorgos Kalogeropoulos_, Mar 27 2025 %D A053816 D. R. Kaprekar, On Kaprekar numbers, J. Rec. Math., 13 (1980-1981), 81-82. %D A053816 David Wells, The Penguin Dictionary of Curious and Interesting Numbers, Penguin Books, NY, 1986, p. 151. %H A053816 Chai Wah Wu, <a href="/A053816/b053816.txt">Table of n, a(n) for n = 1..50000</a> %H A053816 Shyam Sunder Gupta, <a href="https://doi.org/10.1007/978-981-97-2465-9_9">On Some Marvellous Numbers of Kaprekar</a>, Exploring the Beauty of Fascinating Numbers, Springer (2025) Ch. 9, 275-315. %H A053816 Douglas E. Iannucci, <a href="https://cs.uwaterloo.ca/journals/JIS/VOL3/iann2a.html">The Kaprekar numbers</a>, J. Integer Sequences, Vol. 3, 2000, #1.2. %H A053816 Robert Munafo, <a href="http://www.mrob.com/pub/seq/kaprekar.html">Kaprekar Sequences</a>. %H A053816 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/KaprekarNumber.html">Kaprekar Number</a>. %H A053816 Chai Wah Wu, <a href="/A053816/a053816.pdf">Semilog plot of A053816(n), n = 1..1003371 (all terms with m <= 60)</a>. %H A053816 Chai Wah Wu, <a href="/A053816/a053816_1.pdf">Plot of A053816(n), n = 1..1003371 (all terms with m <= 60)</a>. %H A053816 <a href="/index/Coi#Colombian">Index entries for Colombian or self numbers and related sequences</a> %e A053816 703 is Kaprekar because 703 = 494 + 209, 703^2 = 494209. %t A053816 kapQ[n_]:=Module[{idn2=IntegerDigits[n^2],len},len=Length[idn2];FromDigits[ Take[idn2,Floor[len/2]]]+FromDigits[Take[idn2, -Ceiling[len/2]]]==n]; Select[Range[540000],kapQ] (* _Harvey P. Dale_, Aug 22 2011 *) %t A053816 ktQ[n_] := ((x = n^2) - (z = FromDigits[Take[IntegerDigits[x], y = -IntegerLength[n]]]))*10^y + z == n; Select[Range[540000], ktQ] (* _Jayanta Basu_, Aug 04 2013 *) %t A053816 Select[Range[540000],Total[FromDigits/@TakeDrop[IntegerDigits[#^2], Floor[ IntegerLength[ #^2]/2]]] ==#&] (* The program uses the TakeDrop function from Mathematica version 10 *) (* _Harvey P. Dale_, Jun 03 2016 *) %t A053816 maxDigits=6; Flatten[Table[lst={};sub=Subsets@FactorInteger[v=10^d-1]; Do[a=Times@@Power@@@s; n=ChineseRemainder[{0,1},{a,v/a},1]; If[10^(d-1)<=n<10^d,AppendTo[lst,n]],{s,sub}];Union@lst,{d,maxDigits}]] (* _Giorgos Kalogeropoulos_, Mar 27 2025 *) %o A053816 (Haskell) %o A053816 a053816 n = a053816_list !! (n-1) %o A053816 a053816_list = 1 : filter f [4..] where %o A053816 f x = length us - length vs <= 1 && %o A053816 read (reverse us) + read (reverse vs) == x %o A053816 where (us, vs) = splitAt (length $ show x) (reverse $ show (x^2)) %o A053816 -- _Reinhard Zumkeller_, Oct 04 2014 %o A053816 (PARI) isok(n) = n == vecsum(divrem(n^2, 10^(1+logint(n, 10)))); \\ _Ruud H.G. van Tol_, Jun 02 2024 %o A053816 (Python) %o A053816 def is_A053816(n): return n==sum(divmod(n**2,10**len(str(n)))) and n %o A053816 print(upto_1e5:=list(filter(is_A053816, range(10**5)))) # _M. F. Hasler_, Mar 28 2025 %Y A053816 Cf. A006886, A037042, A053394, A053395, A053396, A053397, A045913, A003052, A055642, A095370. %Y A053816 Fixed points of A380585. %K A053816 nonn,nice,base,easy %O A053816 1,2 %A A053816 _Robert Munafo_ %E A053816 More terms from _Michel ten Voorde_, Apr 11 2001