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 A047842 #48 Jan 12 2024 22:43:07 %S A047842 10,11,12,13,14,15,16,17,18,19,1011,21,1112,1113,1114,1115,1116,1117, %T A047842 1118,1119,1012,1112,22,1213,1214,1215,1216,1217,1218,1219,1013,1113, %U A047842 1213,23,1314,1315,1316,1317,1318,1319,1014,1114,1214,1314,24,1415,1416 %N A047842 Describe n (count digits in order of increasing value, ignoring missing digits). %C A047842 Digit count of n. The digit count numerically summarizes the frequency of digits 0 through 9 in that order when they occur in a number. - _Lekraj Beedassy_, Jan 11 2007 %C A047842 Numbers which are digital permutations of one another have the same digit count. Compare with first entries of "Look And Say" or LS sequence A045918. As in the latter, a(n) has first odd-numbered-digit entry occurring at n=1111111111 with digit count 101, but a(n) has first ambiguous term 1011. For digit count invariants, i.e., n such that a(n)=n, see A047841. - _Lekraj Beedassy_, Jan 11 2007 %H A047842 Reinhard Zumkeller, <a href="/A047842/b047842.txt">Table of n, a(n) for n = 0..10000</a> %H A047842 Onno M. Cain and Sela T. Enin, <a href="https://arxiv.org/abs/2004.00209">Inventory Loops (i.e. Counting Sequences) have Pre-period 2 max S_1 + 60</a>, arXiv:2004.00209 [math.NT], 2020. %H A047842 Andre Kowacs, <a href="https://arxiv.org/abs/1708.06452">Studies on the Pea Pattern Sequence</a>, arXiv:1708.06452 [math.HO], 2017. %F A047842 a(a(n)) = A235775(n). [By definition of A235775. - _M. F. Hasler_, Jan 11 2024] %F A047842 a(A010785(n)) = A244112(A010785(n)). - _Reinhard Zumkeller_, Nov 11 2014 %F A047842 a(n) = a(A328447(n)) = a(m) for all n and all m having the same digits as n, with multiplicity. - _M. F. Hasler_, Jan 11 2024 %e A047842 a(31) = 1113 because (one 1, one 3) make up 31. %e A047842 101 contains one 0 and two 1's, so a(101) = 1021. %e A047842 a(131) = 2113. %e A047842 For n = 20231231, the digits of the date 2023-12-31, last day of 2023, a(n) = 10213223 is a fixed point: a(a(n)) = a(n) (cf. A235775). Since a(n) is invariant under permutation of the digits of n (leading zeros avoided), this is independent of the chosen notation, yyyy-mm-dd or mm/dd/yyyy or dd.mm.yyyy. - _M. F. Hasler_, Jan 11 2024 %t A047842 dc[n_] :=FromDigits@Flatten@Select[Table[{DigitCount[n, 10, k], k}, {k, 0, 9}], #[[1]] > 0 &];Table[dc[n], {n, 0, 46}] (* _Ray Chandler_, Jan 09 2009 *) %t A047842 Array[FromDigits@ Flatten@ Map[Reverse, Tally@ Sort@ IntegerDigits@ #] &, 46] (* _Michael De Vlieger_, Jul 15 2020 *) %o A047842 (Haskell) %o A047842 import Data.List (sort, group); import Data.Function (on) %o A047842 a047842 :: Integer -> Integer %o A047842 a047842 n = read $ concat $ %o A047842 zipWith ((++) `on` show) (map length xs) (map head xs) %o A047842 where xs = group $ sort $ map (read . return) $ show n %o A047842 -- _Reinhard Zumkeller_, Jan 15 2014 %o A047842 (Python) %o A047842 def A047842(n): %o A047842 s, x = '', str(n) %o A047842 for i in range(10): %o A047842 y = str(i) %o A047842 c = str(x.count(y)) %o A047842 if c != '0': %o A047842 s += c+y %o A047842 return int(s) # _Chai Wah Wu_, Jan 03 2015 %o A047842 (PARI) A047842(n)={if(n, local(c=1, S="", d=vecsort(digits(n)), a(i)=Str(S, c, d[i])); for(i=2, #d, if(d[i]==d[i-1], c++, S=a(i-1); c=1)); eval(a(#d)), 10)} \\ _M. F. Hasler_, Feb 25 2018; edited Jan 10 2024 %Y A047842 Cf. A005151, A047841, A047843, A127354, A127355. %Y A047842 Cf. A235775. %Y A047842 Cf. A244112 (the same but in order of decreasing value of digits), A010785. %Y A047842 Cf. A005150 (Look and Say: describe the number digit-wise instead of overall count). %Y A047842 Cf. A328447 (least m having the same digits as n). %K A047842 nonn,easy,base,nice %O A047842 0,1 %A A047842 _N. J. A. Sloane_ %E A047842 Edited by _N. J. A. Sloane_, Jul 03 2008 at the suggestion of _R. J. Mathar_