5 kyu

Integers: Recreation One

525 of 27,032g964

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.

Fundamentals
Algorithms

More By Author:

Check out these other kata created by g964

Stats:

CreatedJul 18, 2015
PublishedJul 18, 2015
Warriors Trained98641
Total Skips33731
Total Code Submissions116238
Total Times Completed27032
Ruby Completions525
Python Completions7607
JavaScript Completions7770
Java Completions3640
C# Completions1712
CoffeeScript Completions24
Haskell Completions325
Clojure Completions109
C++ Completions1891
PHP Completions659
Crystal Completions20
F# Completions57
C Completions481
TypeScript Completions625
Rust Completions446
Swift Completions292
Go Completions723
R Completions73
Shell Completions17
OCaml Completions32
Elixir Completions101
Fortran Completions11
Julia Completions40
Scala Completions162
PowerShell Completions19
Nim Completions9
PureScript Completions6
Reason Completions4
Racket Completions20
Kotlin Completions138
Prolog Completions9
Pascal Completions10
Factor Completions11
Raku Completions3
VB Completions9
Lua Completions55
Perl Completions6
Elm Completions3
D Completions4
Erlang Completions5
Total Stars2077
% of votes with a positive feedback rating88% of 3086
Total "Very Satisfied" Votes2437
Total "Somewhat Satisfied" Votes543
Total "Not Satisfied" Votes106
Ad
Contributors
  • g964 Avatar
  • jhoffner Avatar
  • joh_pot Avatar
  • Unnamed Avatar
  • donaldsebleung Avatar
  • kazk Avatar
  • Blind4Basics Avatar
  • aditya7iyengar Avatar
  • Voile Avatar
  • Bubbler Avatar
  • monadius Avatar
  • hobovsky Avatar
  • user8436785 Avatar
  • Kacarott Avatar
  • dfhwze Avatar
  • Just4FunCoder Avatar
Ad