Go: package main

import (
	"bufio"
	"os"
		"strings"
	"strconv"
			"fmt"
	)

var scanner = bufio.NewScanner(os.Stdin)
const (
	MAX = 1000000
)
func main() {
	a := make([]int, MAX+1)
	a[1] = 1
	for i := 2; i <= MAX; i *= 2 {
		a[i]++
	}
	for i := 1; i <= MAX; i++ {
		if a[i] != 0 {
			for j := i*3; j <= MAX; j *= 3 {
				if a[j] == 0 {
					a[j]++
				}
			}
		}
	}
	for i := 1; i <= MAX; i++ {
		if a[i] != 0 {
			for j := i*5; j <= MAX; j *= 3 {
				if a[j] == 0 {
					a[j]++
				}
			}
		}
	}
	for scanner.Scan() {
		buf := strings.Split(scanner.Text(), " ")
		m, _ := strconv.Atoi(buf[0])
		if m == 0 {
			break
		}
		n, _ := strconv.Atoi(buf[1])
		cnt := 0
		for i := m; i <= n; i++ {
			if a[i] != 0 {
				cnt++
			}
		}
		fmt.Println(cnt)
	}
}

Python: isHamming = []

def judge():
	global isHamming;
	isHamming[1] = True
	i = 1
	while True:
		if (i * 2 > 1000000):
			break
		if (isHamming[i]):
			isHamming[i * 2] = True
		i += 1
	
	i = 1
	while True:
		if (i * 3 > 1000000):
			break
		if (isHamming[i]):
			isHamming[i * 3] = True
		i += 1
	
	i = 1
	while True:
		if (i * 5 > 1000000):
			break
		if (isHamming[i]):
			isHamming[i * 5] = True
		i += 1

def init():
	global isHamming
	for i in range(1000000 + 1):
		isHamming.append(False)

init()
judge()
while True:
	m = [int(num) for num in input().split()]
	if m == [0]:
		break;
		
	count = 0
	for i in range(m[0], m[1] + 1):
		if (isHamming[i]):
			count += 1;
			
	print(count)

Python: H = [False for i in range(1000001)]

H[1] = True
for i in range(20):
    for j in range(13):
        for k in range(9):
            if (2 ** i) * (3 ** j) * (5 ** k) < 1000001:
                H[(2 ** i) * (3 ** j) * (5 ** k)] = True
            else:
                break

while True:
    L = input()
    if L == "0":
        break

    a, b = [int(i) for i in L.split()]
    ans = 0
    for i in range(a, b+1):
        if H[i]:
            ans += 1
    print(ans)

Python: import sys
def main():
    for line in sys.stdin:
        mn = list(line)
        if mn[0] == "0":
            break
        else:
            num = [str(i) for i in range(0, 10)]
            d = ""
            for x in range(len(mn)):
                if mn[x] not in num:
                    dd = x
                    break
                else:
                    d += mn[x]
            m = int(d)

            d = ""
            for y in range(dd + 1, len(mn) - 1):
                d += mn[y]
            n = int(d)

            a2 = []
            for i in range(1, n):
                hoge = 2 ** i
                if hoge <= n:
                    a2.append(hoge)
                else:
                    break

            a3 = []
            for i in range(1, n):
                hoge = 3 ** i
                if hoge <= n:
                    a3.append(hoge)
                else:
                    break

            a5 = []
            for i in range(1, n):
                hoge = 5 ** i
                if hoge <= n:
                    a5.append(hoge)
                else:
                    break
            a23 = []
            for i in range(len(a2)):
                for j in range(len(a3)):
                    fuga = a2[i] * a3[j]
                    if fuga <= n:
                        a23.append(fuga)
                    else:
                        break

            a35 = []
            for i in range(len(a3)):
                for j in range(len(a5)):
                    fuga = a3[i] * a5[j]
                    if fuga <= n:
                        a35.append(fuga)
                    else:
                        break

            a52 = []
            for i in range(len(a5)):
                for j in range(len(a2)):
                    fuga = a5[i] * a2[j]
                    if fuga <= n:
                        a52.append(fuga)
                    else:
                        break

            a2335 = []
            for i in range(len(a23)):
                for j in range(len(a35)):
                    fuga = a23[i] * a35[j]
                    if fuga <= n:
                        a2335.append(fuga)
                    else:
                        break

            a3552 = []
            for i in range(len(a35)):
                for j in range(len(a52)):
                    fuga = a35[i] * a52[j]
                    if fuga <= n:
                        a3552.append(fuga)
                    else:
                        break

            a23353552 = []
            for i in range(len(a2335)):
                for j in range(len(a3552)):
                    fuga = a2335[i] * a3552[j]
                    if fuga <= n:
                        a23353552.append(fuga)
                    else:
                        break

            a30 = []
            i = 1
            while 1:
                fuga = 30 * i
                if fuga <= n:
                    a30.append(fuga)
                    i += 1
                else:
                    break

            a = a2 + a3 + a5 + a23 + a35 + a52 + a2335 + a3552 +\
                a23353552 + a30

            if m == 1:
                a.append(1)
            else:
                pass
            a = sorted(set(a))

            for x in range(len(a)):
                if a[x] >= m:
                    c = x
                    break
                else:
                    pass

            cnt = 0
            for x in range(c, len(a)):
                 cnt += 1

            print(cnt)

if __name__ == "__main__":
    main()

Python: while 1:
    n=list(map(int,input().split()))
    if n[0]==0:break
    a=0
    for i in range(n[0],n[1]+1):
        b=i
        while b%5==0: b/=5
        while b%3==0: b/=3
        while b%2==0: b/=2
        if b==1:a+=1
    print(a)

C++: #include<cstdio>
#include<cstdlib>
#include<ctime>
#include<cmath>
#include<cstring>
#include<cctype>
#include<complex>
#include<iostream>
#include<sstream>
#include<algorithm>
#include<functional>
#include<vector>
#include<string>
#include<stack>
#include<queue>
#include<map>
#include<set>
#include<bitset>
using namespace std;
const int dx[] = {1,0,-1,0};
const int dy[] = {0,1,0,-1};
#define INF 1e+8
#define EPS 1e-10
#define PB push_back
#define fi first
#define se second
#define ll long long 
#define reps(i,j,k) for(int i = (j); i < (k); i++)
#define rep(i,j) reps(i,0,j)
typedef pair<int,int> Pii;
typedef vector<int> vi;
int ans[1000001];
ll mod_pow(ll x, ll n ,ll mod){
	if(n == 0) return 1;
	ll res = mod_pow(x*x%mod,n/2,mod);
	if(n & 1) res = res * x % mod;
	return res;
}
void makeHammingNumbers(){
	rep(i,1000000){
		rep(j,13){
			if(mod_pow(60,j,i+1)==0){
				ans[i+1] = 1;
				break;
			}
		}
	}
	return ;
}
int main(){
	makeHammingNumbers();
	reps(i,1,1000000){
		ans[i+1] += ans[i];
	}
	int m;
	while(scanf("%d",&m),m){
		int n;
		scanf("%d",&n);
		printf("%d\n",ans[n]-ans[m-1]);
	}
	return 0;
}

C++: #include <bits/stdc++.h>

using namespace std;
using ll = long long;
using pii = pair<int, int>;

bool isHamming(int n) {
  while (n % 2 == 0) n /= 2;
  while (n % 3 == 0) n /= 3;
  while (n % 5 == 0) n /= 5;
  return n == 1;
}

int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(10);
  
  int cum[1000010] = {};
  for (int i = 1; i <= 1000000; i++) {
    cum[i] = isHamming(i);
    cum[i] += cum[i - 1];
  }
  int m, n;
  while (cin >> m, m) {
    cin >> n;
    cout << cum[n] - cum[m - 1] << endl;
  }

  return 0;
}

C++: #include <iostream>

using namespace std;

const int MAX = 1000000;
bool hamming[MAX];

int main(){
	int ps[3] = {2, 3, 5};
	int n, m;
	for(int i = 0;i < MAX;++i){
		n = i + 1;
		for(int j = 0;j < 3;++j){
			while(n % ps[j] == 0) n /= ps[j];
		}
		hamming[i] = n == 1 ? true : false;
	}
	while(cin >> m, m){
		cin >> n;
		int c = 0;
		--m;
		for(int i = m;i < n;++i){
			if(hamming[i]) ++c;
		}
		cout << c << endl;
	}
	return 0;
}