Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.
3 added 2 characters in body
source | link

Introduction

Let's take the number 180. This is an interesting number because the sum of digits of this number is equal to:

1 + 8 + 0 = 9

And the squared version of this positive number, or:

180² = 32400 > 3 + 2 + 4 + 0 + 0 = 9

These are both 9. The sum of digits of the original number and the squared number are the same. Of course, this is also found at OEIS: A058369.

Task

Given a non-negative integer n, output the nth positive number with this condition.

Test cases (zero-indexed)

Input > Output

0 > 1
1 > 9
2 > 10
3 > 18
4 > 19
5 > 45
6 > 46
7 > 55
8 > 90
9 > 99
10 > 100
11 > 145
12 > 180
13 > 189
14 > 190
15 > 198
16 > 199
17 > 289
18 > 351
19 > 361

The input can also be 1-indexed if that fits you better.

This is , so the submission with the least amount of bytes wins!

Introduction

Let's take the number 180. This is an interesting number because the sum of digits of this number is equal to:

1 + 8 + 0 = 9

And the squared version of this positive number, or:

180² = 32400 > 3 + 2 + 4 + 0 + 0 = 9

These are both 9. The sum of digits of the original number and the squared number are the same. Of course, this is also found at OEIS: A058369.

Task

Given a non-negative integer n, output the nth number with this condition.

Test cases (zero-indexed)

Input > Output

0 > 1
1 > 9
2 > 10
3 > 18
4 > 19
5 > 45
6 > 46
7 > 55
8 > 90
9 > 99
10 > 100
11 > 145
12 > 180
13 > 189
14 > 190
15 > 198
16 > 199
17 > 289
18 > 351
19 > 361

The input can also be 1-indexed if that fits you better.

This is , so the submission with the least amount of bytes wins!

Introduction

Let's take the number 180. This is an interesting number because the sum of digits of this number is equal to:

1 + 8 + 0 = 9

And the squared version of this number, or:

180² = 32400 > 3 + 2 + 4 + 0 + 0 = 9

These are both 9. The sum of digits of the original number and the squared number are the same. Of course, this is also found at OEIS: A058369.

Task

Given a non-negative integer n, output the nth positive number with this condition.

Test cases (zero-indexed)

Input > Output

0 > 1
1 > 9
2 > 10
3 > 18
4 > 19
5 > 45
6 > 46
7 > 55
8 > 90
9 > 99
10 > 100
11 > 145
12 > 180
13 > 189
14 > 190
15 > 198
16 > 199
17 > 289
18 > 351
19 > 361

The input can also be 1-indexed if that fits you better.

This is , so the submission with the least amount of bytes wins!

2 added 9 characters in body
source | link

Introduction

Let's take the number 180. This is an interesting number because the sum of digits of this number is equal to:

1 + 8 + 0 = 9

And the squared version of this positive number, or:

180² = 32400 > 3 + 2 + 4 + 0 + 0 = 9

These are both 9. The sum of digits of the original number and the squared number are the same. Of course, this is also found at OEIS: A058369.

Task

Given a non-negative integer n, output the nth number with this condition.

Test cases (zero-indexed)

Input > Output

0 > 1
1 > 9
2 > 10
3 > 18
4 > 19
5 > 45
6 > 46
7 > 55
8 > 90
9 > 99
10 > 100
11 > 145
12 > 180
13 > 189
14 > 190
15 > 198
16 > 199
17 > 289
18 > 351
19 > 361

The input can also be 1-indexed if that fits you better.

This is , so the submission with the least amount of bytes wins!

Introduction

Let's take the number 180. This is an interesting number because the sum of digits of this number is equal to:

1 + 8 + 0 = 9

And the squared version of this number, or:

180² = 32400 > 3 + 2 + 4 + 0 + 0 = 9

These are both 9. The sum of digits of the original number and the squared number are the same. Of course, this is also found at OEIS: A058369.

Task

Given a non-negative integer n, output the nth number with this condition.

Test cases (zero-indexed)

Input > Output

0 > 1
1 > 9
2 > 10
3 > 18
4 > 19
5 > 45
6 > 46
7 > 55
8 > 90
9 > 99
10 > 100
11 > 145
12 > 180
13 > 189
14 > 190
15 > 198
16 > 199
17 > 289
18 > 351
19 > 361

The input can also be 1-indexed if that fits you better.

This is , so the submission with the least amount of bytes wins!

Introduction

Let's take the number 180. This is an interesting number because the sum of digits of this number is equal to:

1 + 8 + 0 = 9

And the squared version of this positive number, or:

180² = 32400 > 3 + 2 + 4 + 0 + 0 = 9

These are both 9. The sum of digits of the original number and the squared number are the same. Of course, this is also found at OEIS: A058369.

Task

Given a non-negative integer n, output the nth number with this condition.

Test cases (zero-indexed)

Input > Output

0 > 1
1 > 9
2 > 10
3 > 18
4 > 19
5 > 45
6 > 46
7 > 55
8 > 90
9 > 99
10 > 100
11 > 145
12 > 180
13 > 189
14 > 190
15 > 198
16 > 199
17 > 289
18 > 351
19 > 361

The input can also be 1-indexed if that fits you better.

This is , so the submission with the least amount of bytes wins!

    Tweeted twitter.com/StackCodeGolf/status/708453022666461185
1
source | link

Equality in the sum of digits

Introduction

Let's take the number 180. This is an interesting number because the sum of digits of this number is equal to:

1 + 8 + 0 = 9

And the squared version of this number, or:

180² = 32400 > 3 + 2 + 4 + 0 + 0 = 9

These are both 9. The sum of digits of the original number and the squared number are the same. Of course, this is also found at OEIS: A058369.

Task

Given a non-negative integer n, output the nth number with this condition.

Test cases (zero-indexed)

Input > Output

0 > 1
1 > 9
2 > 10
3 > 18
4 > 19
5 > 45
6 > 46
7 > 55
8 > 90
9 > 99
10 > 100
11 > 145
12 > 180
13 > 189
14 > 190
15 > 198
16 > 199
17 > 289
18 > 351
19 > 361

The input can also be 1-indexed if that fits you better.

This is , so the submission with the least amount of bytes wins!