login
a(1) = 1. a(n) = number of earlier terms of the sequence that divide the sum of the earlier terms of the sequence.
2

%I #20 Oct 12 2024 21:34:11

%S 1,1,2,3,2,3,6,7,2,4,2,4,2,4,2,4,3,12,12,12,12,12,13,2,2,5,10,23,2,3,

%T 15,2,7,18,12,12,14,32,16,31,2,6,6,9,20,13,7,13,2,2,6,6,7,17,6,6,8,2,

%U 6,3,16,19,9,32,16,33,9,45,10,3,19,5,16,20,20,35,4,8,2,3,17,19,17,19,22,35

%N a(1) = 1. a(n) = number of earlier terms of the sequence that divide the sum of the earlier terms of the sequence.

%C Sum of first n terms of this sequence is A120878(n).

%H Samuel B. Reid, <a href="/A120877/b120877.txt">Table of n, a(n) for n = 1..10000</a>

%H Michael De Vlieger, <a href="/A120877/a120877.png">Log log scatterplot of a(n)</a>, n = 1..2^16, showing first appearances of number k in red, and repeated appearances of number k in blue.

%e The sum of the first 9 terms of the sequence is 27. Among the first 9 terms of the sequence there are 4 terms (a(1)=1, a(2)=1, a(4)=3, a(6)=3) which divide 27.

%e So a(10) = 4.

%t s={1};Do[ ct=0;sm=Total[s];Do[If[Divisible[sm,s[[j]]],ct++] ,{j,n-1}];AppendTo[s,ct],{n,2,86}];s (* _James C. McMahon_, Oct 12 2024 *)

%o (PARI) {m=86;print1(a=1,",");v=[a];for(n=2,m,a=0;q=sum(i=1,n-1,v[i]);for(j=1,n-1,if(q%v[j]==0,a++));print1(a,",");v=concat(v,a))} \\ _Klaus Brockhaus_, Aug 16 2006

%Y Cf. A120878.

%K nonn

%O 1,3

%A _Leroy Quet_, Jul 10 2006

%E More terms from _Klaus Brockhaus_, Aug 16 2006