Jump to content
IPS Community Suite 简体中文
Sign in to follow this  


Recommended Posts

已知: 可被数集[1,10]上的所有整数整除的最小正数是2520;


package main

import (

func isPrimeNumber(intV int64) bool {

	return big.NewInt(intV).ProbablyPrime(0)


func GetPrimeNumberListElThan(intV int64) []int64 {

	var i int64 = 1
	var r []int64
	for ; i <= intV; i++ {

		if isPrimeNumber(i) {
			r = append(r, i)

	return r

func GetMinNumberCanBeDividedAllNumberElThan(intV int64) int64 {

	var result int64 = 1
	var div int64
	var primes []int64 = GetPrimeNumberListElThan(intV)
	for i := range primes {
		div = primes[i]
		for div <= intV {
			div *= primes[i]
		div /= primes[i]
		result *= div

	return result

func main() {

	var intV int64 = 20





Share this post

Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this