login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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

%I #14 Jan 11 2021 13:20:18

%S 1,11,31,4113,612314,8112332416,1113253342618,151528344153628,

%T 1817210364454648,102118211310455661768,3028110212311475962788,

%U 50331142143124851064711819,704111621731641051165713829,905011821931841251468714839,1105712022132141451569718869

%N 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.

%H J. Mulder, <a href="/A177360/b177360.txt">Table of n, a(n) for n = 1..50000</a>

%e 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.

%t 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 *)

%o (Python)

%o def aupton(nn):

%o alst, last_str = [1], "1"

%o dig_counts = [0 for i in range(10)]

%o for n in range(2, nn+1):

%o nxt = []

%o for d in "0123456789":

%o if d in last_str: dig_counts[int(d)] += last_str.count(d)

%o if dig_counts[int(d)] > 0: nxt += [dig_counts[int(d)], int(d)]

%o nxt_str = "".join(map(str, nxt))

%o alst.append(int(nxt_str)); last_str = nxt_str

%o return alst

%o print(aupton(15)) # _Michael S. Branicky_, Jan 11 2021

%Y Cf. A060857, A177359 - A177368

%K easy,nonn,base

%O 1,2

%A _Paolo P. Lava_ and _Giorgio Balzarotti_, May 10 2010

%E Terms corrected using values in b-file. - _N. J. A. Sloane_, Oct 05 2010

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 17 21:22 EDT 2024. Contains 371767 sequences. (Running on oeis4.)