A104785 a(n) = number of members of A047841 with n digits.
0, 1, 0, 0, 0, 0, 0, 35, 0, 21, 0, 0, 0, 20, 0, 15, 0, 6, 9, 1, 1
Offset: 1
Extensions
Edited by David Wasserman, Apr 17 2008
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.
a(31) = 1113 because (one 1, one 3) make up 31. 101 contains one 0 and two 1's, so a(101) = 1021. a(131) = 2113. 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
import Data.List (sort, group); import Data.Function (on) a047842 :: Integer -> Integer a047842 n = read $ concat $ zipWith ((++) `on` show) (map length xs) (map head xs) where xs = group $ sort $ map (read . return) $ show n -- Reinhard Zumkeller, Jan 15 2014
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 *) Array[FromDigits@ Flatten@ Map[Reverse, Tally@ Sort@ IntegerDigits@ #] &, 46] (* Michael De Vlieger, Jul 15 2020 *)
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
def A047842(n): s, x = '', str(n) for i in range(10): y = str(i) c = str(x.count(y)) if c != '0': s += c+y return int(s) # Chai Wah Wu, Jan 03 2015
m = 1210 is written in base 4 (since it has 4 digits), and has one 0, two 1's, one 2 and zero 3's and m = "one two one zero".
isSelfDescribing[n_Integer] := (RotateRight[DigitCount[n]] == PadRight[IntegerDigits[n], 10]); Select[Range[10^10 - 1], isSelfDescribing] (* Martin Ettl, Oct 09 2012 *) (* Warning: This program causes Mathematica to crash! - David Callan, Feb 17 2017 *)
11112 contains four 1's (11 in base 3), and one 2, so T(11112) = 11 1 1 2, and so 11112 is fixed under T.
1011112 contains one 0, five (11 in base 4) 1's, and one 2, so T(1011112) = 1 0 11 1 1 2, and this is fixed under T.
10213223 contains 1 0's, 2 1's, 3 2's and 2 3's.
10213223 contains one 0, two 1's, three 2's and two 3's, so T(10213223) = 1 0 2 1 3 2 2 3, and this is fixed under T. 103142132415 and 104122232415 belong to the cycle of length 2, so T(T(103142132415)) = T(1 0 4 1 2 2 2 3 2 4 1 5) = 1 0 3 1 4 2 1 3 2 4 1 5.
Comments