login
A376151
TARDIS numbers: the sum of the first and last digits of the decimal expansion is less than the sum of the middle digits.
0
120, 130, 131, 140, 141, 142, 150, 151, 152, 153, 160, 161, 162, 163, 164, 170, 171, 172, 173, 174, 175, 180, 181, 182, 183, 184, 185, 186, 190, 191, 192, 193, 194, 195, 196, 197, 230, 240, 241, 250, 251, 252, 260, 261, 262, 263, 270, 271, 272, 273, 274, 280, 281
OFFSET
1,1
COMMENTS
They are bigger on the inside than on the outside. The fictional telephone number of the TARDIS is 95475949, a TARDIS number.
There are infinitely many (trivially).
LINKS
Shaun Alan Isherwood, Is there a formula for TARDIS numbers?, Mathematics Stack Exchange.
Wikipedia, TARDIS
EXAMPLE
9+9 < 5+4+7+5+9+4, so 95475949 is a TARDIS number.
MATHEMATICA
Select[Range[281], Part[IntegerDigits[#], 1] + Part[IntegerDigits[#], IntegerLength[#]] < Sum[Part[IntegerDigits[#], i], {i, 2, IntegerLength[#]-1}] &] (* Stefano Spezia, Sep 12 2024 *)
PROG
(Python)
def ok(n):
d = list(map(int, str(n)))
return d[0] + d[-1] < sum(d[1:-1])
print([k for k in range(282) if ok(k)]) # Michael S. Branicky, Sep 12 2024
(Python)
from itertools import count, islice, combinations_with_replacement
from sympy.utilities.iterables import multiset_permutations
def A376151_gen(): # generator of terms
for l in count(1):
c = []
for d in combinations_with_replacement('0123456789', l):
if (s:=sum(map(int, d)))>1:
for a in range(1, min(10, s)):
a2 = a*10**(l+1)
for b in range(min(10, s-a)):
for x in multiset_permutations(d):
c.append(a2+10*int(''.join(x))+b)
yield from sorted(c)
A376151_list = list(islice(A376151_gen(), 53)) # Chai Wah Wu, Sep 22 2024
CROSSREFS
Cf. A101317.
Sequence in context: A157425 A030501 A271578 * A297152 A074302 A095631
KEYWORD
nonn,base
AUTHOR
STATUS
approved