55: lychrel numbers

This commit is contained in:
VicRen
2021-01-08 09:18:27 +08:00
parent 89a6a7f664
commit 7cc04c9043
2 changed files with 90 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
package main
import (
"math/big"
"strings"
)
func main() {
}
func isLychrelNumber(n int) bool {
return false
}
func IsPalindrome(n *big.Int) bool {
str := n.String()
pb := strings.Builder{}
for i := len(str); i > 0; i-- {
pb.WriteString(str[i-1 : i])
}
pstr := pb.String()
return str == pstr
}