login
Partial sums of A011772.
3

%I #13 Jun 01 2022 14:46:13

%S 1,4,6,13,17,20,26,41,49,53,63,71,83,90,95,126,142,150,168,183,189,

%T 200,222,237,261,273,299,306,334,349,379,442,453,469,483,491,527,546,

%U 558,573,613,633,675,707,716,739,785,817,865,889,906,945,997,1024,1034,1082,1100,1128,1186,1201,1261

%N Partial sums of A011772.

%C How fast is this growing?

%H N. J. A. Sloane, <a href="/A345984/b345984.txt">Table of n, a(n) for n = 1..16383</a>

%t Accumulate[(Sqrt[1+8#]-1)/2&/@Flatten[With[{r=Accumulate[ Range[ 300]]},Table[ Select[ r,Divisible[#,n]&,1],{n,80}]]]] (* _Harvey P. Dale_, Sep 19 2021 *)

%o (Python 3.8+)

%o from itertools import combinations, count, islice

%o from math import prod

%o from sympy import factorint

%o from sympy.ntheory.modular import crt

%o def A345984_gen(): # generator of terms

%o c = 1

%o for n in count(4,2):

%o yield c

%o plist = tuple(p**q for p, q in factorint(n).items())

%o c += n-1 if len(plist) == 1 else int(min(min(crt((m, n//m), (0, -1))[0], crt((n//m, m), (0, -1))[0]) for m in (prod(d) for l in range(1, len(plist)//2+1) for d in combinations(plist, l))))

%o A345984_list = list(islice(A345984_gen(),25)) # _Chai Wah Wu_, Jun 01 2022

%Y Cf. A011772, A344005, A345983.

%K nonn

%O 1,2

%A _N. J. A. Sloane_, Jul 09 2021