reviewed
approved
reviewed
approved
proposed
reviewed
editing
proposed
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))
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
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))
Michael S. Branicky, <a href="/A080472/b080472.txt">Table of n, a(n) for n = 1..10000</a>
(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
approved
editing
_Amarnath Murthy (amarnath_murthy(AT)yahoo.com), _, Mar 07 2003
More terms from _Ray Chandler (rayjchandler(AT)sbcglobal.net), _, Oct 11 2003
base,nonn,new
More terms from Ray Chandler (RayChandlerrayjchandler(AT)alumni.tcusbcglobal.edunet), Oct 11 2003