cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A379017 a(n) is the number of distinct sums s(m) + s(m+1) + ... + s(m+n-1), where s = A000002, and m >= 1.

This page as a plain text file.
%I A379017 #20 Jan 23 2025 00:29:55
%S A379017 2,3,2,3,4,3,4,3,2,3,4,3,4,5,4,3,4,3,4,5,4,5,6,5,4,5,4,5,4,5,4,5,4,5,
%T A379017 4,5,4,5,4,5,6,5,6,5,4,5,6,5,6,7,6,5,6,5,6,7,6,5,6,5,6,5,6,5,6,5,6,7,
%U A379017 6,5,6,5,6,7,6,7,6,5,6,7,6,7,8,7,8,7,6,7
%N A379017 a(n) is the number of distinct sums s(m) + s(m+1) + ... + s(m+n-1), where s = A000002, and m >= 1.
%F A379017 |a(n+1)-a(n)| = 1 for every n.
%e A379017 Starting with s = (1, 2, 2, 1, 1, 2, 1, 2, 2, 1, 2, 2, 1, 1, 2, 1, 1, 2, 2, ...) we form a shifted partial sum array:
%e A379017 (row 1) = (1,2,2,1,1,2,1,2,2,...)
%e A379017 (row 2) = (s(1)+s(2), s(2)+s(3), s(3)+s(4), ...) = (3,4,3,2,3,3,3,4,...) = A333229
%e A379017 (row 3) = (s(1)+s(2)+s(3), s(2)+s(3)+s(4), s(3)+s(4)+s(5), ...) = (5,5,4,4,4,5,5,5,5,5,5,4,...)
%e A379017 The number of distinct numbers in (row 3) is 2, so a(3) = 2.
%e A379017 The first 12 rows of the shifted partial sum array: (1, 2), (2, 3, 4), (4, 5), (5, 6, 7), (6, 7, 8, 9), (8, 9, 10), (9, 10, 11, 12), (11, 12, 13), (13, 14), (14, 15, 16), (15, 16, 17, 18), (17, 18, 19). These rows illustrate that fact that the integers in each row are consecutive.
%t A379017 s = Prepend[Nest[Flatten[Partition[#, 2] /. {{2, 2} -> {2, 2, 1, 1}, {2, 1} -> {2, 2, 1}, {1, 2} -> {2, 1, 1}, {1, 1} -> {2, 1}}] &, {2, 2}, 24], 1]; (* A000002 *)
%t A379017 Length[s]
%t A379017 r[1] = s;
%t A379017 r[n_] := r[n] = Rest[r[n - 1]];
%t A379017 c[n_] := c[n] = Take[r[n], 1000];
%t A379017 sum[n_] := Sum[c[k], {k, 1, n}];
%t A379017 t = Table[Union[sum[n]], {n, 1, 100}]
%t A379017 Map[Length, t]
%Y A379017 Cf. A000002, A007782 (subword complexity), A283511, A333229, A376677.
%K A379017 nonn
%O A379017 1,1
%A A379017 _Clark Kimberling_, Dec 16 2024
%E A379017 More terms from _Jinyuan Wang_, Jan 22 2025