OFFSET
1,2
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000
EXAMPLE
t(4) = 10 and the first factorial divisible by 10 is 5!, so a(4) = 5.
MATHEMATICA
nn=80; With[{f=Range[nn]!, trs=Accumulate[Range[nn]]}, Flatten[ Table[ Position[f, _?(Divisible[#, trs[[n]]]&), {1}, 1], {n, nn}]]] (* Harvey P. Dale, Nov 18 2013 *)
PROG
(PARI) t(n)=n*(n+1)/2;
for (n=1, 50, c=1; while (c!%t(n)!=0, c++); print1(c", "));
(Python)
from itertools import count
from collections import Counter
from sympy import factorint, multiplicity
def A085779(n):
m = 1
f = Counter(factorint(n))+Counter(factorint(n+1))
f[2] -= 1
for p, e in f.items():
if e<=p:
m = max(m, e*p)
else:
c, a = 0, max(p, (e*(p-1)//p**2)*p)
b = a-p
while b>0:
c += (b:=b//p)
for k in count(a, p):
c += multiplicity(p, k) if p>2 else (~k&k-1).bit_length()
if c+k+p > e:
m = max(m, p*(max(k, e-c) if e>=p else e+1-c))
break
return m # Chai Wah Wu, Feb 26 2026
CROSSREFS
KEYWORD
nonn
AUTHOR
Jon Perry, Jul 23 2003
EXTENSIONS
Extended by Ray Chandler, Jun 06 2008
STATUS
approved
