A072957 Urban numbers: without 'r' or 'u'.
1, 2, 5, 6, 7, 8, 9, 10, 11, 12, 15, 16, 17, 18, 19, 20, 21, 22, 25, 26, 27, 28, 29, 50, 51, 52, 55, 56, 57, 58, 59, 60, 61, 62, 65, 66, 67, 68, 69, 70, 71, 72, 75, 76, 77, 78, 79, 80, 81, 82, 85, 86, 87, 88, 89, 90, 91, 92, 95, 96, 97, 98, 99, 1000000, 1000001, 1000002
Offset: 1
References
- M. J. Halm, Sequences (Re)discovered, Mpossibilities 81 (Aug. 2002).
Links
- Michael S. Branicky, Table of n, a(n) for n = 1..10000
Crossrefs
Programs
-
PARI
is(n)=!setintersect(Set(Vec(English(n))),["r","u"]) \\ See A052360 for English(). - M. F. Hasler, Apr 01 2019 /* Alternate code, not using English(): (valid for 1 <= n < one trillion, which should be forbidden due to the 'r' but returns 1) */ is(n)={setintersect( Set(digits(n)), [3,4]) && return; !while(n=divrem(n,10^6), n[2]<100||return; n=n[1])} \\ M. F. Hasler, Apr 01 2019
-
Python
from num2words import num2words from itertools import islice, product def ok(n): return set(num2words(n)) & {"r", "u"} == set() def agen(): # generator of terms < 10**304 base, pows = [k for k in range(1, 1000) if ok(k)], [1] yield from ([0] if ok(0) else []) + base for e in range(3, 304, 3): if set(num2words(10**e)[4:]) & {"r", "u"} == set(): pows = [10**e] + pows for t in product([0] + base, repeat=len(pows)): if t[0] == 0: continue yield sum(t[i]*pows[i] for i in range(len(t))) print(list(islice(agen(), 66))) # Michael S. Branicky, Aug 19 2022
Extensions
Missing term 52 inserted by Michael S. Branicky, Aug 19 2022