cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A080472 a(n) = smallest triangular number that is obtained by placing digits anywhere in n; a(n) = n if n is a triangular number.

This page as a plain text file.
%I A080472 #12 Jan 21 2023 01:59:50
%S A080472 1,21,3,45,15,6,78,28,91,10,171,120,136,1431,15,136,171,1081,190,120,
%T A080472 21,1225,231,2145,253,276,276,28,2926,300,231,325,3003,2346,325,36,
%U A080472 378,378,3916,406,741,4278,435,4465,45,406,4278,1485,496,1540,351,528,153,1540
%N A080472 a(n) = smallest triangular number that is obtained by placing digits anywhere in n; a(n) = n if n is a triangular number.
%H A080472 Michael S. Branicky, <a href="/A080472/b080472.txt">Table of n, a(n) for n = 1..10000</a>
%o A080472 (Python)
%o A080472 from math import isqrt
%o A080472 from itertools import count
%o A080472 def dmo(n, t):
%o A080472     if t < n: return False
%o A080472     while n and t:
%o A080472         if n%10 == t%10:
%o A080472             n //= 10
%o A080472         t //= 10
%o A080472     return n == 0
%o A080472 def a(n):
%o A080472     return next(t for t in (i*(i+1)//2 for i in count(isqrt(2*n))) if dmo(n, t))
%o A080472 print([a(n) for n in range(1, 77)]) # _Michael S. Branicky_, Jan 21 2023
%Y A080472 Cf. A068164, A068165, A080470, A080471.
%K A080472 base,nonn
%O A080472 1,2
%A A080472 _Amarnath Murthy_, Mar 07 2003
%E A080472 More terms from _Ray Chandler_, Oct 11 2003