login
A162354
Primes that are anagrams of triangular numbers.
1
3, 19, 109, 163, 307, 523, 613, 631, 1063, 1117, 1171, 1567, 1657, 1693, 1783, 1801, 1873, 2017, 2251, 2269, 2287, 2521, 2683, 3061, 3079, 3169, 3187, 3457, 3547, 3691, 3709, 3907, 4051, 4357, 4861, 5077, 5167, 5347, 5437, 5563, 5581, 5653, 5743, 5851
OFFSET
1,1
COMMENTS
19 is an anagram of 91 = T(13) = 13*14/2.
163, 613 and 631 are anagrams of 136 = T(16) = 16*17/2.
LINKS
PROG
(Python)
from sympy import primerange
from itertools import count, takewhile
def hash(n): return "".join(sorted(str(n)))
def aupto_digits(d):
tris = takewhile(lambda x:x<10**d, (i*(i+1)//2 for i in count(0)))
primes = primerange(1, 10**d)
T = set(map(hash, tris))
return [p for p in primes if hash(p) in T]
print(aupto_digits(4)) # Michael S. Branicky, Feb 18 2024
CROSSREFS
Sequence in context: A130425 A334976 A103005 * A132959 A360230 A253811
KEYWORD
nonn,base
AUTHOR
Claudio Meller, Jul 01 2009
EXTENSIONS
Corrected by Claudio Meller, Jul 08 2009
STATUS
approved