Post History
Challenge A Niven number is a positive integer which is divisible by the sum of its digits. For example, 81 -> 8+1=9 -> 81%9=0. Your task is to find the first n Niven numbers, given n. Te...
#3: Post edited
Find n Niven Numbers
- # Challenge
- A Niven number is a positive integer which is divisible by the sum of its digits.
- For example, `81 -> 8+1=9 -> 81%9=0`.
- Your task is to find the first `n` Niven numbers, given `n`.
- # Tests
- [Reference implementation(takes input)](https://staxlang.xyz/#c=O%7BcE%7C%2B%25%21%7Dgn&i=100)
first 15 values:- ```
- 0 => 1
- 1 => 2
- 2 => 3
- 3 => 4
- 4 => 5
- 5 => 6
- 6 => 7
- 7 => 8
- 8 => 9
- 9 => 10
- 10 => 12
- 11 => 18
- 12 => 20
- 13 => 21
- 14 => 24
- 15 => 27
- ```
- # Challenge
- A Niven number is a positive integer which is divisible by the sum of its digits.
- For example, `81 -> 8+1=9 -> 81%9=0`.
- Your task is to find the first `n` Niven numbers, given `n`.
- # Tests
- [Reference implementation(takes input)](https://staxlang.xyz/#c=O%7BcE%7C%2B%25%21%7Dgn&i=100)
- first 16 values:
- ```
- 0 => 1
- 1 => 2
- 2 => 3
- 3 => 4
- 4 => 5
- 5 => 6
- 6 => 7
- 7 => 8
- 8 => 9
- 9 => 10
- 10 => 12
- 11 => 18
- 12 => 20
- 13 => 21
- 14 => 24
- 15 => 27
- ```
#2: Post edited
- # Challenge
- A Niven number is a positive integer which is divisible by the sum of its digits.
- For example, `81 -> 8+1=9 -> 81%9=0`.
- Your task is to find the first `n` Niven numbers, given `n`.
- # Tests
- [Reference implementation(takes input)](https://staxlang.xyz/#c=O%7BcE%7C%2B%25%21%7Dgn&i=100)
you can use 1-indexing if needed.- ```
- 0 => 1
- 1 => 2
- 2 => 3
- 3 => 4
- 4 => 5
- 5 => 6
- 6 => 7
- 7 => 8
- 8 => 9
- 9 => 10
- 10 => 12
- 11 => 18
- 12 => 20
- 13 => 21
- 14 => 24
- 15 => 27
- ```
- # Challenge
- A Niven number is a positive integer which is divisible by the sum of its digits.
- For example, `81 -> 8+1=9 -> 81%9=0`.
- Your task is to find the first `n` Niven numbers, given `n`.
- # Tests
- [Reference implementation(takes input)](https://staxlang.xyz/#c=O%7BcE%7C%2B%25%21%7Dgn&i=100)
- first 15 values:
- ```
- 0 => 1
- 1 => 2
- 2 => 3
- 3 => 4
- 4 => 5
- 5 => 6
- 6 => 7
- 7 => 8
- 8 => 9
- 9 => 10
- 10 => 12
- 11 => 18
- 12 => 20
- 13 => 21
- 14 => 24
- 15 => 27
- ```
#1: Initial revision
Find n Niven Numbers
# Challenge A Niven number is a positive integer which is divisible by the sum of its digits. For example, `81 -> 8+1=9 -> 81%9=0`. Your task is to find the first `n` Niven numbers, given `n`. # Tests [Reference implementation(takes input)](https://staxlang.xyz/#c=O%7BcE%7C%2B%25%21%7Dgn&i=100) you can use 1-indexing if needed. ``` 0 => 1 1 => 2 2 => 3 3 => 4 4 => 5 5 => 6 6 => 7 7 => 8 8 => 9 9 => 10 10 => 12 11 => 18 12 => 20 13 => 21 14 => 24 15 => 27 ```