|
|
A177360
|
|
a(n) contains the nonzero frequencies f(d) of digits d=0 .. 9 in all terms up to a(n-1) in concatenated form sorted with respect to d: f(0)//0//f(1)//1//...//f(9)//9. Initial term a(1)=1.
|
|
10
|
|
|
1, 11, 31, 4113, 612314, 8112332416, 1113253342618, 151528344153628, 1817210364454648, 102118211310455661768, 3028110212311475962788, 50331142143124851064711819, 704111621731641051165713829, 905011821931841251468714839, 1105712022132141451569718869
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
LINKS
|
|
|
EXAMPLE
|
One; one one; three ones; four ones, one three; six ones, two threes, one four; eight ones, one two, three threes, two fours, one six; eleven ones, three twos, five threes, three fours, two sixes, one eight; etc.
|
|
MATHEMATICA
|
lst = {Join[{e, 1}, Array[e &, 8]]}; Do[With[{k = Last@lst}, AppendTo[lst, ((k /. e -> 0) + With[{l = StringJoin @@ ToString /@ k}, Table[If[k[[i + 1]] =!= e, 1, 0] + StringCount[l, ToString[i]], {i, 0, 9}]]) /. {0 -> e}]], {1000}] lst = Prepend[ StringJoin @@ MapIndexed[ If[ # =!= e, ToString@# <> ToString[ #2[[1]] - 1], ""] &, # ] & /@ lst, "1"]; (* Jasper Mulder (jasper.mulder(AT)planet.nl), Jun 04 2010 *)
|
|
PROG
|
(Python)
def aupton(nn):
alst, last_str = [1], "1"
dig_counts = [0 for i in range(10)]
for n in range(2, nn+1):
nxt = []
for d in "0123456789":
if d in last_str: dig_counts[int(d)] += last_str.count(d)
if dig_counts[int(d)] > 0: nxt += [dig_counts[int(d)], int(d)]
nxt_str = "".join(map(str, nxt))
alst.append(int(nxt_str)); last_str = nxt_str
return alst
|
|
CROSSREFS
|
|
|
KEYWORD
|
easy,nonn,base
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|