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 A194218 #17 Feb 16 2025 08:33:15 %S A194218 1,8,20,30,98,88,494,998,494,744,238,2450,2550,28,5288,6048,9998,3008, %T A194218 4938,1518,60494,68320,90480,99998,20408,21948,33058,35010,43470, %U A194218 101558,108878,123448,127194,152344,213018,217930,249500,250500,284270,289940,371718 %N A194218 Left part of the square of the n-th Kaprekar number. %C A194218 a(n) + A194219(n) = A006886(n) and %C A194218 concatenation of a(n) and A194219(n) = A006886(n)^2. %H A194218 Rosetta Code, <a href="http://rosettacode.org/wiki/Kaprekar_numbers">Kaprekar numbers</a> %H A194218 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/KaprekarNumber.html">Kaprekar Number</a> %H A194218 Wikipedia, <a href="http://en.wikipedia.org/wiki/Kaprekar_number">Kaprekar number</a> %o A194218 (Haskell) %o A194218 import Data.List (find) %o A194218 import Data.Maybe (mapMaybe) %o A194218 a194218 n = a194218_list !! (n-1) %o A194218 a194218_list = map fst kaprekarPairs %o A194218 a194219 n = a194219_list !! (n-1) %o A194218 a194219_list = map snd kaprekarPairs %o A194218 a006886 n = a006886_list !! (n-1) %o A194218 a006886_list = map (uncurry (+)) kaprekarPairs %o A194218 kaprekarPairs = (1,0) : (mapMaybe (\n -> kSplit n $ splits (n^2)) [1..]) %o A194218 where kSplit x = find (\(left, right) -> left + right == x) %o A194218 splits q = no0 . map (divMod q) $ iterate (10 *) 10 %o A194218 no0 = takeWhile ((> 0) . fst) . filter ((> 0) . snd) %o A194218 -- Cf. Rosetta link. %K A194218 nonn,base %O A194218 1,2 %A A194218 _Reinhard Zumkeller_, Aug 19 2011