login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A080472 a(n) = smallest triangular number that is obtained by placing digits anywhere in n; a(n) = n if n is a triangular number. 1

%I #12 Jan 21 2023 01:59:50

%S 1,21,3,45,15,6,78,28,91,10,171,120,136,1431,15,136,171,1081,190,120,

%T 21,1225,231,2145,253,276,276,28,2926,300,231,325,3003,2346,325,36,

%U 378,378,3916,406,741,4278,435,4465,45,406,4278,1485,496,1540,351,528,153,1540

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

%H Michael S. Branicky, <a href="/A080472/b080472.txt">Table of n, a(n) for n = 1..10000</a>

%o (Python)

%o from math import isqrt

%o from itertools import count

%o def dmo(n, t):

%o if t < n: return False

%o while n and t:

%o if n%10 == t%10:

%o n //= 10

%o t //= 10

%o return n == 0

%o def a(n):

%o return next(t for t in (i*(i+1)//2 for i in count(isqrt(2*n))) if dmo(n, t))

%o print([a(n) for n in range(1, 77)]) # _Michael S. Branicky_, Jan 21 2023

%Y Cf. A068164, A068165, A080470, A080471.

%K base,nonn

%O 1,2

%A _Amarnath Murthy_, Mar 07 2003

%E More terms from _Ray Chandler_, Oct 11 2003

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 28 20:05 EDT 2024. Contains 371254 sequences. (Running on oeis4.)