OFFSET
1,3
COMMENTS
Triangular numbers in A229511.
EXAMPLE
MATHEMATICA
d[0] = d[1] = 0; d[n_] := n*Plus @@ ((Last[#]/First[#]) & /@ FactorInteger[n]); Select[Table[n*(n + 1)/2, {n, 0, 10^5}], IntegerQ[Sqrt[8*d[#] + 1]] &] (* Amiram Eldar, Feb 07 2022 *)
PROG
(Magma) tr:=func<m|IsSquare(8*m+1)>; f:=func<n |n le 1 select 0 else n*(&+[Factorisation(n)[i][2] / Factorisation(n)[i][1]: i in [1..#Factorisation(n)]])>; [n:n in [d*(d+1) div 2:d in [0..90000]]| tr(Floor(f(n)))];
(PARI) lista(nn) = my(t); for (n=0, nn, if (ispolygonal(der(t=n*(n+1)/2), 3), print1(t, ", "))); \\ Michel Marcus, Feb 16 2022
(Python)
from itertools import count, islice
from sympy import factorint, integer_nthroot, isprime, nextprime
def istri(n): return integer_nthroot(8*n+1, 2)[1]
def ad(n):
return 0 if n < 2 else sum(n*e//p for p, e in factorint(n).items())
def agen(): # generator of terms
for i in count(0):
t = i*(i+1)//2
if istri(ad(t)):
yield t
print(list(islice(agen(), 14))) # Michael S. Branicky, Feb 16 2022
CROSSREFS
KEYWORD
nonn,more
AUTHOR
Marius A. Burtea, Feb 07 2022
EXTENSIONS
a(20)-a(21) from Michael S. Branicky, Feb 17 2022
STATUS
approved