

Definition

An   eban   number is a number that has no letter    e    in it when the number is spelled in English.

Or more literally,   spelled numbers that contain the letter   e   are banned.



The American version of spelling numbers will be used here   (as opposed to the British).

2,000,000,000   is two billion,   not   two milliard.



Only numbers less than   one sextillion   (1021)   will be considered in/for this task.

This will allow optimizations to be used.



Task

   show all eban numbers   ≤   1,000   (in a horizontal format),   and a count
   show all eban numbers between   1,000   and   4,000   (inclusive),   and a count
   show a count of all eban numbers up and including           10,000
   show a count of all eban numbers up and including         100,000
   show a count of all eban numbers up and including      1,000,000
   show a count of all eban numbers up and including    10,000,000
   show all output here.


See also

   The MathWorld entry:   eban numbers.
   The OEIS entry:   A6933, eban numbers.


 
' Eban_numbers
' Un número eban es un número que no tiene la letra e cuando el número está escrito en inglés.
' O más literalmente, los números escritos que contienen la letra e están prohibidos.
'
' Usaremos la versión americana de los números de ortografía (a diferencia de los británicos).
'  2000000000 son dos billones, no dos millardos (mil millones).
'
 
Data 2, 1000, 1
Data 1000, 4000, 1
Data 2, 10000, 0
Data 2, 100000, 0
Data 2, 1000000, 0
Data 2, 10000000, 0
Data 2, 100000000, 0
Data 0, 0, 0
 
Dim As Double tiempo = Timer
Dim As Integer start, ended, printable, count
Dim As Long i, b, r, m, t
Do
    Read start, ended, printable
 
    If start = 0 Then Exit Do
    If start = 2 Then
        Print "eban numbers up to and including"; ended; ":"
    Else
        Print "eban numbers between "; start; " and "; ended; " (inclusive):"
    End If
 
    count = 0
    For i = start To ended Step 2
        b = Int(i / 1000000000)
        r = (i Mod 1000000000)
        m = Int(r / 1000000)
        r = (i Mod 1000000)
        t = Int(r / 1000)
        r = (r Mod 1000)
        If m >= 30 And m <= 66 Then m = (m Mod 10)
        If t >= 30 And t <= 66 Then t = (t Mod 10)
        If r >= 30 And r <= 66 Then r = (r Mod 10)
        If b = 0 Or b = 2 Or b = 4 Or b = 6 Then             
            If m = 0 Or m = 2 Or m = 4 Or m = 6 Then
                If t = 0 Or t = 2 Or t = 4 Or t = 6 Then
                    If r = 0 Or r = 2 Or r = 4 Or r = 6 Then
                        If printable Then Print i;
                        count += 1
                    End If
                End If
            End If
        End If
    Next i
    If printable Then Print
    Print "count = "; count & Chr(10)
Loop
tiempo = Timer - tiempo
Print "Run time: " & (tiempo) & " seconds."
End
 