caird coinheringaahing ♦
- 50.9k
- 11
- 133
- 364
Jelly, (削除) 12 (削除ここまで) (削除) 11 (削除ここまで) 9 bytes
ṚḤÐeDFS5ḍ
Explanation coming
How it works
ṚḤÐeDFS5ḍ - Main link. Takes an integer n on the left
Ṛ - Cast n to digits and reverse
Ðe - To values at even indices:
Ḥ - Unhalve; Double
D - Cast to digits
F - Flatten
S - Sum
ḍ - Divisible by:
5 - 10?
Jelly, (削除) 12 (削除ここまで) (削除) 11 (削除ここまで) 9 bytes
ṚḤÐeDFS5ḍ
How it works
ṚḤÐeDFS5ḍ - Main link. Takes an integer n on the left
Ṛ - Cast n to digits and reverse
Ðe - To values at even indices:
Ḥ - Unhalve; Double
D - Cast to digits
F - Flatten
S - Sum
ḍ - Divisible by:
5 - 10?
caird coinheringaahing ♦
- 50.9k
- 11
- 133
- 364
Jelly, (削除) 12 (削除ここまで) 11(削除) 11 (削除ここまで) 9 bytes
ṚḤJḤ$¦DFS5ḍṚḤÐeDFS5ḍ
Try it online! (with all test cases)Try it online!
How it works
ṚḤJḤ$¦DFSḍ5 - Main link. Argument: n (integer) e.g. 49927398716
Ṛ - Reverse. Casts a number to digits [6, 1, 7, 8, 9, 3, 7, 2, 9, 9, 4]
¦ - Sparse application. Apply the next command to the given indicies
Ḥ - Command: Double
$ - Indicies:
J - range(length)... [1, 2 , 3, 4, 5, 6, 7, 8, 9, 10, 11]
Ḥ - doubled. [2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22]
- Doubles elements at odd indicies [6, 2, 7, 16, 9, 6, 7, 4, 9, 18, 4]
D - Split each into digits [6, 2, 7, [1, 6], 9, 6, 7, 4, 9, [1, 8], 4]
F - Flatten [6, 2, 7, 1, 6, 9, 6, 7, 4, 9, 1, 8, 4]
S - Sum 70
ḍ - Divisible by...
5 - 10? 1
Alternatively, for 12 bytes:Explanation coming
ṚḤJḤ$¦DFSḍ@5
Jelly, (削除) 12 (削除ここまで) 11 bytes
ṚḤJḤ$¦DFS5ḍ
Try it online! (with all test cases)
How it works
ṚḤJḤ$¦DFSḍ5 - Main link. Argument: n (integer) e.g. 49927398716
Ṛ - Reverse. Casts a number to digits [6, 1, 7, 8, 9, 3, 7, 2, 9, 9, 4]
¦ - Sparse application. Apply the next command to the given indicies
Ḥ - Command: Double
$ - Indicies:
J - range(length)... [1, 2 , 3, 4, 5, 6, 7, 8, 9, 10, 11]
Ḥ - doubled. [2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22]
- Doubles elements at odd indicies [6, 2, 7, 16, 9, 6, 7, 4, 9, 18, 4]
D - Split each into digits [6, 2, 7, [1, 6], 9, 6, 7, 4, 9, [1, 8], 4]
F - Flatten [6, 2, 7, 1, 6, 9, 6, 7, 4, 9, 1, 8, 4]
S - Sum 70
ḍ - Divisible by...
5 - 10? 1
Alternatively, for 12 bytes:
ṚḤJḤ$¦DFSḍ@5
caird coinheringaahing ♦
- 50.9k
- 11
- 133
- 364
Jelly, 12(削除) 12 (削除ここまで) 11 bytes
ṚḤJḤ$¦DFS%5¬ṚḤJḤ$¦DFS5ḍ
Try it online! (with all test cases)
How it works
ṚḤJḤ$¦DFS%5¬ṚḤJḤ$¦DFSḍ5 - Main link. Argument: n (integer) e.g. 49927398716
Ṛ - Reverse. Casts a number to digits [6, 1, 7, 8, 9, 3, 7, 2, 9, 9, 4]
¦ - Sparse application. Apply the next command to the given indicies
Ḥ - Command: Double
$ - Indicies:
J - range(length)... [1, 2 , 3, 4, 5, 6, 7, 8, 9, 10, 11]
Ḥ - doubled. [2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22]
- Doubles elements at odd indicies [6, 2, 7, 16, 9, 6, 7, 4, 9, 18, 4]
D - Split each into digits [6, 2, 7, [1, 6], 9, 6, 7, 4, 9, [1, 8], 4]
F - Flatten [6, 2, 7, 1, 6, 9, 6, 7, 4, 9, 1, 8, 4]
S - Sum 70
%5 ḍ - ModuloDivisible by 10 ... 0
5 - 10? ¬ - Logical NOT 1
Alternatively, also for 12 bytes:
ṚḤJḤ$¦DFSḍ@5
Jelly, 12 bytes
ṚḤJḤ$¦DFS%5¬
Try it online! (with all test cases)
How it works
ṚḤJḤ$¦DFS%5¬ - Main link. Argument: n (integer) e.g. 49927398716
Ṛ - Reverse. Casts a number to digits [6, 1, 7, 8, 9, 3, 7, 2, 9, 9, 4]
¦ - Sparse application. Apply the next command to the given indicies
Ḥ - Command: Double
$ - Indicies:
J - range(length)...
Ḥ - doubled.
- Doubles elements at odd indicies [6, 2, 7, 16, 9, 6, 7, 4, 9, 18, 4]
D - Split each into digits [6, 2, 7, [1, 6], 9, 6, 7, 4, 9, [1, 8], 4]
F - Flatten [6, 2, 7, 1, 6, 9, 6, 7, 4, 9, 1, 8, 4]
S - Sum 70
%5 - Modulo by 10 0
¬ - Logical NOT 1
Alternatively, also for 12 bytes:
ṚḤJḤ$¦DFSḍ@5
Jelly, (削除) 12 (削除ここまで) 11 bytes
ṚḤJḤ$¦DFS5ḍ
Try it online! (with all test cases)
How it works
ṚḤJḤ$¦DFSḍ5 - Main link. Argument: n (integer) e.g. 49927398716
Ṛ - Reverse. Casts a number to digits [6, 1, 7, 8, 9, 3, 7, 2, 9, 9, 4]
¦ - Sparse application. Apply the next command to the given indicies
Ḥ - Command: Double
$ - Indicies:
J - range(length)... [1, 2 , 3, 4, 5, 6, 7, 8, 9, 10, 11]
Ḥ - doubled. [2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22]
- Doubles elements at odd indicies [6, 2, 7, 16, 9, 6, 7, 4, 9, 18, 4]
D - Split each into digits [6, 2, 7, [1, 6], 9, 6, 7, 4, 9, [1, 8], 4]
F - Flatten [6, 2, 7, 1, 6, 9, 6, 7, 4, 9, 1, 8, 4]
S - Sum 70
ḍ - Divisible by... 5 - 10? 1
Alternatively, for 12 bytes:
ṚḤJḤ$¦DFSḍ@5
Loading