%I #21 Jan 02 2023 12:30:50
%S 2,3,4,6,7,8,10,11,12,13,14,16,17,18,19,20,21,22,23,24,25,26,27,28,29,
%T 31,32,33,34,35,36,37,38,39,41,42,43,44,45,46,47,48,49,50,52,53,54,55,
%U 56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,77,78,79,80,81,82,83,84
%N Numbers j such that the sum of the first j terms, Sum_{k=1..j} a(k), is not in this list.
%C Sequence A249331 lists the numbers not in this sequence, i.e., 1, 5, 9, 15, 30, 40, 51, 76, 90, 106, 123, 141, 180, 201, 223, 246, 270, 295, ... .
%H M. F. Hasler, <a href="/A249299/b249299.txt">Table of n, a(n) for n = 1..964</a>
%H E. Angelini, <a href="http://list.seqfan.eu/oldermail/seqfan/2014-October/013862.html">Sum of the a(n) first terms of S is not in S</a>, SeqFan list, Oct 23 2014
%e The number 1 cannot appear in the sequence, since the sum of the first n=1 terms equals a(1) which is necessarily in the sequence. (Similarly for 0.)
%e So the smallest number that can be in the sequence is a(1)=2.
%e There is no (further) restriction on a(2) since 2+a(2) will always be a number not in the set {2, a(2)}. Thus the next larger number, a(2)=3, is also in this list.
%e The number a(3)=4 is also allowed, but because of a(1)=2 the number a(1)+a(2)=5 is excluded, as well as the number a(1)+a(2)+a(3)=2+3+4=9 because of a(2)=3.
%o (PARI) {A249299=[]; A249331=[s=0,1]; for(n=2,999,setsearch(A249331,n)&&next; A249299=concat(A249299,n); s+=n; setsearch(A249299,#A249299)&&A249331=concat(A249331,s))}
%K nonn
%O 1,1
%A _Eric Angelini_ and _M. F. Hasler_, Oct 24 2014
|