OFFSET
1,3
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..38 (all terms <= 20 digits)
EXAMPLE
PROG
(Python)
from math import isqrt
from itertools import count, islice
def tris(d): # generator of triangular numbers with d digits
ilb, lb, ub = isqrt(2*10**(d-1))-1, 10**(d-1), 10**d
if d == 1: yield 0
for i in count(ilb):
t = i*(i+1)//2
if t < lb: continue
elif t >= ub: break
yield t
def agen(): # generator of sequence terms
yield 0
f, g, n, adict = 1, 2, 1, dict()
for d in count(1):
T = set("".join(sorted(str(t))) for t in tris(d))
while f < 10**d:
if "".join(sorted(str(f))) in T: yield f
f, g = g, f+g
print(list(islice(agen(), 20))) # Michael S. Branicky, Feb 18 2024
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Claudio Meller, Jul 02 2009
EXTENSIONS
Edited and extended by Ray Chandler, Jul 09 2009
a(24)-a(29) from Chai Wah Wu, Dec 25 2016
STATUS
approved