login
A076712
Triangular numbers which are also happy numbers (cf. A007770).
1
1, 10, 28, 91, 190, 496, 820, 946, 1128, 1275, 2080, 2211, 2485, 3321, 4278, 8128, 8256, 8778, 9591, 9730, 11476, 12090, 12880, 13203, 13366, 13530, 15753, 16471, 17205, 17578, 20910, 21115, 21321, 22791, 24753, 25651, 27261, 29890, 30135, 31626, 33670, 35245
OFFSET
1,2
LINKS
EXAMPLE
a(4)=91: 91 is a triangular number and also a happy number as 9^2+1^2=82, 8^2+2^2=68, 6^2+8^2=100 and 1^2+0^2+0^2=1. So 91 is triangular happy number.
MATHEMATICA
Module[{nn=300, trnos, haps}, trnos=Accumulate[Range[nn]]; haps=Select[Range[ (nn(nn+1))/2], FixedPoint[ Total[IntegerDigits[#]^2]&, #, 10]==1&]; Intersection[ trnos, haps]] (* Harvey P. Dale, Aug 15 2014 *)
PROG
(Python)
from itertools import count, islice
def A076712_gen(): # generator of terms
for n in count(1):
m = t = n*(n+1)>>1
while m not in {1, 37, 58, 89, 145, 42, 20, 4, 16}:
m = sum((0, 1, 4, 9, 16, 25, 36, 49, 64, 81)[ord(d)-48] for d in str(m))
if m == 1:
yield t
A076712_list = list(islice(A076712_gen(), 20)) # Chai Wah Wu, Aug 02 2023
CROSSREFS
Sequence in context: A333241 A251319 A126364 * A116973 A352180 A350990
KEYWORD
nonn,base
AUTHOR
Shyam Sunder Gupta, Oct 26 2002
STATUS
approved