Skip to content

Commit 1eccd89

Browse files
committed
ugly number
1 parent 123d605 commit 1eccd89

File tree

1 file changed

+32
-10
lines changed

1 file changed

+32
-10
lines changed

README.md

Lines changed: 32 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,27 @@
11
# `Today Update`
22
## Math
3-
### 258 Add Digits
4-
* [Github:#258 Add Digits](/Math/Math.Lib/AddDigitsSln.cs)
5-
* [CSDN:#258 Add Digits](http://blog.csdn.net/daigualu/article/details/72724479)
6-
* Tips:
7-
* https://en.wikipedia.org/wiki/Digital_root#Congruence_formula
8-
* https://en.wikipedia.org/wiki/Vedic_square
9-
* In Indian mathematics, a Vedic square is a variation on a typical 9 × 9 multiplication table where the entry in each cell is the digital root of the product of the column and row headings i.e. the remainder when the product of the row and column headings is divided by 9 (with remainder 0 represented by 9). Numerous geometric patterns and symmetries can be observed in a Vedic square some of which can be found in traditional Islamic art.
10-
![VedicSquare](/Math/Math.Lib/VedicSquare.png)
11-
12-
---
3+
### 263 Ugly Number
4+
* [Github:#263 Ugly Number](/Math/Math.Lib/UglyNumberSln.cs)
5+
* [CSDN:#263 Ugly Number](http://blog.csdn.net/daigualu/article/details/72765438)
6+
* ```C#
7+
public bool IsUgly(int num)
8+
{
9+
if (num <= 0) return false;
10+
if (num == 1) return true;
11+
while (num >1)
12+
{
13+
if(num%2==0)
14+
num /= 2;
15+
else if (num%3 == 0)
16+
num /= 3;
17+
else if (num%5 == 0)
18+
num /= 5;
19+
else return false;
20+
}
21+
return true;
22+
}
23+
```
24+
--
1325
---
1426

1527

@@ -198,6 +210,16 @@ Tags are following:
198210
### 171 Excel Sheet Column Number
199211
* [Github:#171 Excel Sheet Column Number](/Math/Math.Lib/ExcelColumnNumberSln.cs)
200212
* [CSDN:#171 Excel Sheet Column Number](http://blog.csdn.net/daigualu/article/details/72717145)
213+
### 258 Add Digits
214+
* [Github:#258 Add Digits](/Math/Math.Lib/AddDigitsSln.cs)
215+
* [CSDN:#258 Add Digits](http://blog.csdn.net/daigualu/article/details/72724479)
216+
* Tips:
217+
* https://en.wikipedia.org/wiki/Digital_root#Congruence_formula
218+
* https://en.wikipedia.org/wiki/Vedic_square
219+
* In Indian mathematics, a Vedic square is a variation on a typical 9 × 9 multiplication table where the entry in each cell is the digital root of the product of the column and row headings i.e. the remainder when the product of the row and column headings is divided by 9 (with remainder 0 represented by 9). Numerous geometric patterns and symmetries can be observed in a Vedic square some of which can be found in traditional Islamic art.
220+
![VedicSquare](/Math/Math.Lib/VedicSquare.png)
221+
222+
201223
## Two Pointers
202224
* [#345 Reverse Vowels of a String](http://blog.csdn.net/daigualu/article/details/69257693)
203225

0 commit comments

Comments
 (0)