cp's OEIS Frontend

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.

A139337 Replace each digit with its number of occurrences in decimal representation of n.

This page as a plain text file.
%I A139337 #15 Mar 31 2017 20:45:54
%S A139337 1,1,1,1,1,1,1,1,1,1,11,22,11,11,11,11,11,11,11,11,11,11,22,11,11,11,
%T A139337 11,11,11,11,11,11,11,22,11,11,11,11,11,11,11,11,11,11,22,11,11,11,11,
%U A139337 11,11,11,11,11,11,22,11,11,11,11,11,11,11,11,11,11,22,11,11,11,11,11,11
%N A139337 Replace each digit with its number of occurrences in decimal representation of n.
%C A139337 A055642(a(n)) = A055642(n) for n < (10^10-1)/9; fixed points: a(A108571(n)) = A108571(n).
%H A139337 R. Zumkeller, <a href="/A139337/b139337.txt">Table of n, a(n) for n = 0..25000</a>
%e A139337 a(373) = 212, since, reading the digits of 373 from left to right, 3 appeared twice, 7 once, 3 twice.
%t A139337 a[n_] := IntegerDigits[n] /. Thread[{1, 2, 3, 4, 5, 6, 7, 8, 9, 0} -> DigitCount[n]] // FromDigits; Table[a[n], {n, 0, 100}] (* _Jean-François Alcover_, Nov 28 2013 *)
%o A139337 (Haskell)
%o A139337 import Data.List (group, sort); import Data.Maybe (mapMaybe)
%o A139337 a139337 n = read $ concatMap show $ mapMaybe (flip lookup ls) ds :: Int
%o A139337    where ls = zip (map head zss) (map length zss)
%o A139337          zss = group $ sort ds
%o A139337          ds = map (read . return) $ show n :: [Int]
%o A139337 -- _Reinhard Zumkeller_, Mar 14 2014
%K A139337 nonn,base,look
%O A139337 0,11
%A A139337 _Reinhard Zumkeller_, Apr 14 2008