A358468 Number of 2's that appeared by n-th step when constructing A030717.
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
Keywords
Links
- Michael De Vlieger, Table of n, a(n) for n = 1..1024
- 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.
Programs
-
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 *)
-
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)