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)
	}
}

C++: #include <iostream>

using namespace std;

int cnt;

void dfs(int i)
{
    if (i == 1)
        cnt++;
    else if (i % 2 == 0)
        dfs(i / 2);
    else if (i % 3 == 0)
        dfs(i / 3);
    else if (i % 5 == 0)
        dfs(i / 5);
}

int main()
{
    int m, n;

    while (cin >> m, m) {
        cin >> n;
        
        cnt = 0;
        for (int i = m; i <= n; i++) 
            dfs(i);
        cout << cnt << endl;
    }

    return 0;
}

C++: #include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int main() {
	long long m, n;
	vector<long long>l;
	while (cin >> m){
		if (m == 0)break;
		cin >> n;
		long long sum = 0;
		for (int i = m; i <=n; i++){
			if (2^22 * 3^15 * 5^10 % i == 0){
				sum++;
			}
		}
		l.push_back(sum);
	}
	for (long long i : l) {
		cout << i << endl;
	}
	char c;
	cin >> c;
}

C++: #include <iostream>
using namespace std;

#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define REP(i, n) for (int i = 0; i < (n); i++)

int main()
{
  const int c = 12960000;
  int m, n;
  bool hamming[1000000] = {0};

  REP(i, 1000000){
    if (c % (i + 1) == 0) {
		hamming[i]++;
    }
  }

  while (cin >> m, m){
  	cin >> n;
    int cnt = 0;
    FOR(i, m, n){
      if (hamming[i]) cnt++;
    }
    cout << cnt + 1 << endl;
  }
}

C++: #import<cstdio>
#define MAX 1000001
int p[MAX] = {};
void f(int n){if(n>MAX||p[n])return;p[n]=1;f(n*2);f(n*3);f(n*5);}int main(){int m,n,a,i;for(f(1);~scanf("%d%d",&m,&n);printf("%d\n",a))for(i=m,a=0;i<=n;++i)if(p[i])++a;}

C++: #include <iostream>
#include <algorithm>
using namespace std;

bool cal(long long n) {
  while(n%2 == 0) n /= 2;
  while(n%3 == 0) n /= 3;
  while(n%5 == 0) n /= 5;
 
  if(n == 1) return true;
  else return false;
}


int main() {
  long long m, n;
  while(cin >> m, m) {
    cin >> n;

    long long ans = 0;
    for(int i = m; i <= n; i++) {
      ans += cal(i);
    }
    cout << ans << endl;
  }
}

C++: #include <iostream>
using namespace std;

int main(){
    while (1) {
        int n,m;
        cin>>n;
        if(n==0)break;
        cin>>m;
        int ans=0;
        for (int i=n; i<=m; i++) {
            if(3600%i==0||21600%i==0||777600000%i==0){
                ans++;
            }
        }
        cout<<ans<<endl;
    }
    return 0;
}

C++: #include<iostream>
#include<algorithm>
#include<vector>

using namespace std;

int main()
{
  int m;
  vector<unsigned short> count;
  for(int i=0;i<6;i++)
    count.push_back(i);
  for(int i=6;i<10000001;i++)
    {
      if((i%2==0&&count[i/2]-count[(i/2)-1]!=0) || (i%3==0&&count[i/3]-count[(i/3)-1]!=0) || (i%5==0&&count[i/5]-count[(i/5)-1]!=0))
	  count.push_back(count[i-1]+1);
      else
	count.push_back(count[i-1]);
    }
  for(;cin>>m,m;)
    {
      int n;
      cin>>n;
      cout<<count[n]-count[m-1]<<endl;
    }
}

C++: #include <vector>
#include <iostream>

using namespace std;

unsigned long long power(int a, int b)
{
	if (b == 0) { return 1LL; }

	return power(a, b - 1) * a;
}

int main()
{
	vector<bool> s(1000001, false);

	for (int i = 0; i < 20; i++)
	{
		for (int j = 0; j < 12; j++)
		{
			for (int k = 0; k < 8; k++)
			{
				unsigned long long sum = power(2, i) * power(3, j) * power(5, k);

				if (sum <= 1000000ULL)
				{
					s[sum] = true;
				}
			}
		}
	}

	int m, n;

	while (true)
	{
		cin >> m;

		if (m == 0) { break; }

		cin >> n;

		int sum = 0;

		for (int i = m; i <= n; i++)
		{
			sum += (s[i] ? 1 : 0);
		}

		cout << sum << endl;
	}

	return 0;
}

C++: #include <bits/stdc++.h>
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define RFOR(i,a,b) for(int i=(b) - 1;i>=(a);i--)
#define REP(i,n) for(int i=0;i<(n);i++)
#define RREP(i,n) for(int i=n-1;i>=0;i--)

#define PB push_back
#define INF INT_MAX/3
#define ALL(a) (a).begin(),(a).end()
#define CLR(a) memset(a,0,sizeof(a))

typedef long long int ll;

using namespace std;

int main(){
    vector<int> two;
    vector<int> three;
    vector<int> five;
    vector<int> num;
    two.PB(1);
    three.PB(1);
    five.PB(1);
    for(int i=1;two.back()<1e6;i++){
	two.PB(1<<i);
    }
    for(int i=1;three.back()<1e6;i++){
	three.PB(three.back() * 3);
    }
    for(int i=1;five.back()<1e6;i++){
	five.PB(five.back() * 5);
    }
    for(int i=0;i<two.size();i++){
	for(int j=0;j<three.size();j++){
	    for(int k=0;k<five.size();k++){
		num.PB(two[i] * three[j] * five[k]);
	    }
	}
    }
    sort(ALL(num));
    while(true){
	int n,m;
	cin >> m;
	if(m == 0) break;
	cin >> n;
	int ans  = upper_bound(ALL(num),n) -  lower_bound(ALL(num),m);
	cout << ans << endl;
    }
    return 0;
}

C++: #include <stdio.h>
#include <iostream>

using namespace std;

bool check (int a)
{
	while (a % 2 == 0) {
		a /= 2;
	}

	while (a % 3 == 0) {
		a /= 3;
	}

	while (a % 5 == 0) {
		a /= 5;
	}

	if (a == 1) {
		return true;
	} else {
		return false;
	}

}

int main() {
	int m,n;
	int counter;

	while (cin >> m) {
		if (m == 0) {
			break;
		}
		else {
			cin >> n;
			counter = 0;
			for (int i = m; i <= n; i++) {
				if (check(i)) {
					counter++;
				}
			}
			cout << counter << endl;
		}
	}
	return 0;
}

C++: #include <iostream>
#include <cstring>
using namespace std;

const int HAMMING_MAX = 100001;

int main()
{
	bool hamming[ HAMMING_MAX ];
	memset( hamming, 0, sizeof(hamming) );

	for( int x = 1; x < HAMMING_MAX; x *= 2 ){
		for( int y = 1; x * y < HAMMING_MAX; y *= 3 ){
			for( int z = 1; x * y * z < HAMMING_MAX; z *= 5 ){
				int h = x * y * z;
				hamming[ h ] = true;
			}
		}
	}

	int n, m;
	while( cin >> n && n ){
		cin >> m;
		int count = 0;
		for( int i = n; i <= m; ++i ){
			if( hamming[ i ] ){
				++count;
			}
		}
		cout << count << endl;
	}

	return 0;
}