Integers: Recreation One
Description:
1, 246, 2, 123, 3, 82, 6, 41
are the divisors of number 246
.
Squaring these divisors we get: 1, 60516, 4, 15129, 9, 6724, 36, 1681
.
The sum of these squares is 84100
which is 290 * 290
.
Task
Find all integers between m
and n
(m and n are integers with 1 <= m <= n) such that the sum of their squared divisors is itself a square.
We will return an array of subarrays or of tuples (in C an array of Pair) or a string.
The subarrays (or tuples or Pairs) will have two elements: first the number the squared divisors of which is a square and then the sum of the squared divisors.
Example:
m = 1, n = 250 --> [[1, 1], [42, 2500], [246, 84100]]
m = 42, n = 250 --> [[42, 2500], [246, 84100]]
The form of the examples may change according to the language, see "Sample Tests".
Note
In Fortran - as in any other language - the returned string is not permitted to contain any redundant trailing whitespace: you can use dynamically allocated character strings.
Similar Kata:
Stats:
Created | Jul 18, 2015 |
Published | Jul 18, 2015 |
Warriors Trained | 98641 |
Total Skips | 33731 |
Total Code Submissions | 116238 |
Total Times Completed | 27032 |
Ruby Completions | 525 |
Python Completions | 7607 |
JavaScript Completions | 7770 |
Java Completions | 3640 |
C# Completions | 1712 |
CoffeeScript Completions | 24 |
Haskell Completions | 325 |
Clojure Completions | 109 |
C++ Completions | 1891 |
PHP Completions | 659 |
Crystal Completions | 20 |
F# Completions | 57 |
C Completions | 481 |
TypeScript Completions | 625 |
Rust Completions | 446 |
Swift Completions | 292 |
Go Completions | 723 |
R Completions | 73 |
Shell Completions | 17 |
OCaml Completions | 32 |
Elixir Completions | 101 |
Fortran Completions | 11 |
Julia Completions | 40 |
Scala Completions | 162 |
PowerShell Completions | 19 |
Nim Completions | 9 |
PureScript Completions | 6 |
Reason Completions | 4 |
Racket Completions | 20 |
Kotlin Completions | 138 |
Prolog Completions | 9 |
Pascal Completions | 10 |
Factor Completions | 11 |
Raku Completions | 3 |
VB Completions | 9 |
Lua Completions | 55 |
Perl Completions | 6 |
Elm Completions | 3 |
D Completions | 4 |
Erlang Completions | 5 |
Total Stars | 2077 |
% of votes with a positive feedback rating | 88% of 3086 |
Total "Very Satisfied" Votes | 2437 |
Total "Somewhat Satisfied" Votes | 543 |
Total "Not Satisfied" Votes | 106 |