login
Fibonacci numbers (A000045) which are anagrams of Triangular numbers (A000217).
3

%I #14 Feb 18 2024 14:49:41

%S 0,1,3,21,55,2584,28657,2178309,5702887,14930352,102334155,267914296,

%T 701408733,2971215073,4807526976,7778742049,12586269025,32951280099,

%U 225851433717,591286729879,1548008755920,10610209857723,27777890035288,72723460248141,308061521170129,498454011879264,806515533049393,1304969544928657,3416454622906707

%N Fibonacci numbers (A000045) which are anagrams of Triangular numbers (A000217).

%H Michael S. Branicky, <a href="/A162394/b162394.txt">Table of n, a(n) for n = 1..38</a> (all terms <= 20 digits)

%e 2584 is A000045(18) and is an anagram of 2485 = A000217(70).

%e 28567 is A000045(23) and is an anagram of 67528 = A000217(367).

%o (Python)

%o from math import isqrt

%o from itertools import count, islice

%o def tris(d): # generator of triangular numbers with d digits

%o ilb, lb, ub = isqrt(2*10**(d-1))-1, 10**(d-1), 10**d

%o if d == 1: yield 0

%o for i in count(ilb):

%o t = i*(i+1)//2

%o if t < lb: continue

%o elif t >= ub: break

%o yield t

%o def agen(): # generator of sequence terms

%o yield 0

%o f, g, n, adict = 1, 2, 1, dict()

%o for d in count(1):

%o T = set("".join(sorted(str(t))) for t in tris(d))

%o while f < 10**d:

%o if "".join(sorted(str(f))) in T: yield f

%o f, g = g, f+g

%o print(list(islice(agen(), 20))) # _Michael S. Branicky_, Feb 18 2024

%Y Cf. A000045, A000217.

%K nonn,base

%O 1,3

%A _Claudio Meller_, Jul 02 2009

%E Edited and extended by _Ray Chandler_, Jul 09 2009

%E a(24)-a(29) from _Chai Wah Wu_, Dec 25 2016