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.
%I A331614 #31 Mar 04 2020 02:21:17 %S A331614 1,1,2,2,3,2,4,3,3,4,4,5,4,6,4,7,5,5,6,5,7,6,6,7,7,8,3,5,8,5,9,7,9,8, %T A331614 6,8,7,10,7,11,8,8,9,9,10,8,10,9,11,9,12,6,9,13,8,11,10,10,11,11,12,7, %U A331614 12,8,12,9,14,10,12,10,13,9,15,7,13,10,14,11,13,11,14,12,11,15 %N A331614 a(n+1) is the number of times a(n) is the sum of one or more consecutive terms in this sequence so far with a(1) = 1. %H A331614 Rémy Sigrist, <a href="/A331614/b331614.txt">Table of n, a(n) for n = 1..10000</a> %H A331614 Samuel B. Reid, <a href="/A331614/a331614.png">Density plot of one billion terms</a>. This plot is normalized by column. %e A331614 For example we look for the next 2 terms after a(7) = 4: %e A331614 The sequence so far: 1, 1, 2, 2, 3, 2, 4. %e A331614 We count how many times we can sum up consecutive terms to get 4 as result (and include all 4's already in the sequence). %e A331614 There are 3 ways to get a sum of 4: 1 + 1 + 2, 2 + 2 and 4. This gives us a(8) = 3. %e A331614 For the next term we count all sums of 3 we can get: 1 + 2, 3, 3. This means there are 3 ways and a(9) = 3. %t A331614 a[1] = 1; a[n_] := a[n] = Block[{c = 0, j, s}, Do[j = i; s = 0; While[j < n && s < a[n - 1], s += a[j]; j++]; If[s == a[n - 1], c++], {i, n - 1}]; c]; Array[a, 84] (* _Giovanni Resta_, Jan 23 2020 *) %t A331614 (* Second program needing version >= 10.1 *) %t A331614 a[n_] := a[n] = If[n == 1, 1, SequenceCount[Array[a, n-1], s_ /; Total[s] == a[n-1], Overlaps -> True]]; %t A331614 Array[a, 100] (* _Jean-François Alcover_, Feb 15 2020 *) %o A331614 (Excel) %o A331614 Cell A1: 1 %o A331614 Cell A2: =countif(A$1:AZ1;A1) %o A331614 Cell B2: =if(A1="";"";A1+$A2) %o A331614 Copy B2 and paste into area B2:AZ2 %o A331614 Copy row 2 and paste down (5000 lines worked, more could be slow) %o A331614 (PARI) for (n=1, #a=vector(#t=vector(84)), print1 (a[n]=if(n==1, 1, t[a[n-1]])", "); s=0; forstep (k=n, 1, -1, if (#t<s+=a[k], break, t[s]++))) \\ _Rémy Sigrist_, Feb 14 2020 %Y A331614 Cf. A332518. %K A331614 nonn %O A331614 1,3 %A A331614 _S. Brunner_, Jan 22 2020