OFFSET
1,1
COMMENTS
FORMULA
EXAMPLE
MATHEMATICA
f[n_, d_: 1] := NestList[Flatten[Reverse /@ Map[Function[k, Through[{First, Length}@ k]], Split@ #]] &, {d}, n - 1]; Differences@ Array[FromDigits@ f[#, 2][[#]] &, {13}] (* Michael De Vlieger, Jan 03 2016, after Zerinvary Lajos at A006751 *)
PROG
(PARI) dpt(n) = {vd = []; d = digits(n); nbd = 0; old = -1; for (k=1, #d, if (d[k] == old, nbd ++, if (old != -1, vd = concat(vd, nbd); vd = concat(vd, old); ); nbd = 1; ); old = d[k]; ); vd = concat(vd, nbd); vd = concat(vd, old); subst(Pol(vd), x, 10); }
lista(nn, x=2) = {v = vector(nn); v[1] = x; for (n=2, nn, nx = dpt(x); v[n] = nx; x = nx; ); vector(nn-1, n, v[n+1] - v[n]); } \\ 2nd param x can any value between 2 and 9 \\ Michel Marcus, Dec 16 2015
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Altug Alkan, Dec 16 2015
STATUS
approved