login
A358468
Number of 2's that appeared by n-th step when constructing A030717.
8
0, 0, 1, 2, 3, 3, 3, 3, 4, 6, 8, 9, 10, 11, 12, 14, 16, 19, 23, 26, 27, 29, 32, 38, 43, 48, 51, 56, 63, 71, 79, 87, 94, 101, 109, 116, 125, 133, 140, 149, 161, 174, 188, 202, 217, 233, 250, 266, 284, 304, 326, 347, 369, 392, 418, 444, 471, 499, 530, 561, 593, 625, 658, 692, 726, 761, 797, 833, 869, 906, 944
OFFSET
1,4
LINKS
Michael De Vlieger, Plot of the n-th row of A030717 n = 1..512, showing 2's in red and all other terms in blue.
MATHEMATICA
nn = 94; c[_] = 0; k = a[1] = c[1] = 1; Accumulate@ Prepend[Reap[Do[w = Union@ Array[a, k]; t = 0; Do[Set[a[j + k], c[w[[j]]]]; If[a[j + k] == 2, t++], {j, Length[w]}]; Do[c[a[j + k]]++, {j, Length[w]}]; k += Length[w]; Sow[t], {n, nn}]][[-1, -1]], 0] (* Michael De Vlieger, Nov 18 2022 *)
PROG
(Ruby)
def A(k, n)
a = []
ary = [1]
n.times{
a << ary.count(k)
ary += ary.uniq.sort.map{|i| ary.count(i)}
}
a
end
p A(2, 100)
CROSSREFS
Partial sums of A358469.
Sequence in context: A029090 A364882 A029089 * A173924 A307392 A046886
KEYWORD
nonn
AUTHOR
Seiichi Manyama, Nov 18 2022
STATUS
approved