Beispiel #1
0
func main() {
	var ans int64 = 0
	var p1, p2 uint64
	p1 = 5
	p2, _ = mathutil.NextPrimeUint64(p1)

	for p1 <= 1e6 {
		ans += solve_lc(p1, p2)
		p1 = p2
		p2, _ = mathutil.NextPrimeUint64(p1)
	}
	fmt.Println(ans)
}
Beispiel #2
0
func main() {
	var prime uint64 = 5
	var n uint64 = 1e17
	var result uint64 = 5
	for prime < 100000 {
		if mathutil.ModPowUint64(10, n, 9*prime) != 1 {
			result += prime
		}
		prime, _ = mathutil.NextPrimeUint64(prime)
	}
	fmt.Println(result)
}
Beispiel #3
0
func main() {
	var prime uint64 = 7
	var n uint64 = 1e9
	var count int = 0
	var result uint64 = 0
	for count < 40 {
		if mathutil.ModPowUint64(10, n, 9*prime) == 1 {
			count += 1
			result += prime
		}
		prime, _ = mathutil.NextPrimeUint64(prime)
	}
	fmt.Println(result)
}