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)
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Shaun Alan Isherwood, Sep 12 2024
STATUS
approved