Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #24 Mar 22 2019 13:59:15
%S 3,3,9,13,33,15,121,84,103,26,259,295,433,71,111,331,317,366,649,80,
%T 283,274,429,4542,3071,2138,4241,74,761,3083,103,1847,1683,3886,1233,
%U 470,2359,1182,1797,3431,2037,1767,7543,9106,1867,656,5469,6012,12245,2225
%N a(n) is the least k > n such that A007504(n) divides A007504(k).
%C Credit is given for _Zak Seidov_ for doing the calculations.
%H Seiichi Manyama, <a href="/A303640/b303640.txt">Table of n, a(n) for n = 1..500</a>
%e A007504(6)=41 and 41|328=A007504(15).
%p N:= 10^5: # to get all terms before the first term > N
%p A007504:= ListTools:-PartialSums([seq(ithprime(i),i=1..N)]):
%p found:= true:
%p for n from 1 while found do
%p found:= false;
%p for k from n+1 to N do
%p if A007504[k] mod A007504[n] = 0 then
%p found:= true;
%p A[n]:= k;
%p break
%p fi
%p od
%p od:
%p seq(A[i],i=1..n-2); # _Robert Israel_, May 02 2018
%t a[n_] := For[tpn = Prime[Range[n]] // Total; tpk = 0; k = n+1, True, k++, tpk += Prime[k]; If[Divisible[tpk, tpn], Return[k]]]; Array[a, 50] (* _Jean-François Alcover_, Mar 22 2019 *)
%Y Cf. A000040, A007504.
%K nonn
%O 1,1
%A _J. M. Bergot_, Apr 27 2018
%E More terms from _Alois P. Heinz_, Apr 27 2018