login

Revision History for A080472

(Bold, blue-underlined text is an addition; faded, red-underlined text is a deletion.)

Showing entries 1-10 | older changes
a(n) = smallest triangular number that is obtained by placing digits anywhere in n; a(n) = n if n is a triangular number.
(history; published version)
#12 by N. J. A. Sloane at Sat Jan 21 01:59:50 EST 2023
STATUS

reviewed

approved

#11 by Michel Marcus at Sat Jan 21 01:33:56 EST 2023
STATUS

proposed

reviewed

#10 by Michael S. Branicky at Sat Jan 21 00:32:13 EST 2023
STATUS

editing

proposed

#9 by Michael S. Branicky at Sat Jan 21 00:25:31 EST 2023
PROG

if n%10 == t%10: n //= 10

n //= 10

def a(n):

def a(n): return next(t for t in (i*(i+1)//2 for i in count(isqrt(2*n))) if dmo(n, t))

#8 by Michael S. Branicky at Sat Jan 21 00:24:26 EST 2023
PROG

if n%10 == t%10: n //= 10

n //= 10

def a(n): return next(t for t in (i*(i+1)//2 for i in count(isqrt(2*n))) if dmo(n, t))

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

print([a(n) for n in range(1, 77)]) # Michael S. Branicky, Jan 20 21 2023

#7 by Michael S. Branicky at Fri Jan 20 17:52:26 EST 2023
PROG

from math import isqrt

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

#6 by Michael S. Branicky at Fri Jan 20 15:07:04 EST 2023
LINKS

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

PROG

(Python)

from itertools import count

def dmo(n, t):

if t < n: return False

while n and t:

if n%10 == t%10:

n //= 10

t //= 10

return n == 0

def a(n):

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

print([a(n) for n in range(1, 77)]) # Michael S. Branicky, Jan 20 2023

STATUS

approved

editing

#5 by N. J. A. Sloane at Thu Dec 05 19:56:00 EST 2013
AUTHOR

_Amarnath Murthy (amarnath_murthy(AT)yahoo.com), _, Mar 07 2003

Discussion
Thu Dec 05
19:56
OEIS Server: https://oeis.org/edit/global/2075
#4 by Russ Cox at Fri Mar 30 17:29:05 EDT 2012
EXTENSIONS

More terms from _Ray Chandler (rayjchandler(AT)sbcglobal.net), _, Oct 11 2003

Discussion
Fri Mar 30
17:29
OEIS Server: https://oeis.org/edit/global/154
#3 by N. J. A. Sloane at Fri Jan 12 03:00:00 EST 2007
KEYWORD

base,nonn,new

EXTENSIONS

More terms from Ray Chandler (RayChandlerrayjchandler(AT)alumni.tcusbcglobal.edunet), Oct 11 2003