{"id":16385474,"url":"https://github.com/paparascal2020/code-kata-integers-recreate-one","last_synced_at":"2026-05-20T11:30:21.086Z","repository":{"id":128117908,"uuid":"504829768","full_name":"PapaRascal2020/code-kata-integers-recreate-one","owner":"PapaRascal2020","description":"Codewars Kata: Find all integers between m and n (m and n integers with 1 \u003c= m \u003c= n) such that the sum of their squared divisors is itself a square. ","archived":false,"fork":false,"pushed_at":"2022-06-18T15:44:18.000Z","size":1113,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-02T18:21:08.957Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PapaRascal2020.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-06-18T11:52:01.000Z","updated_at":"2022-06-18T15:44:21.000Z","dependencies_parsed_at":null,"dependency_job_id":"57bb99d6-ab82-4647-9e92-50cb1e3b705b","html_url":"https://github.com/PapaRascal2020/code-kata-integers-recreate-one","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PapaRascal2020%2Fcode-kata-integers-recreate-one","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PapaRascal2020%2Fcode-kata-integers-recreate-one/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PapaRascal2020%2Fcode-kata-integers-recreate-one/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PapaRascal2020%2Fcode-kata-integers-recreate-one/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PapaRascal2020","download_url":"https://codeload.github.com/PapaRascal2020/code-kata-integers-recreate-one/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240127610,"owners_count":19752031,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-11T04:14:35.949Z","updated_at":"2026-05-20T11:30:17.184Z","avatar_url":"https://github.com/PapaRascal2020.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# code-kata-integers-recreate-one\nCodewars Kata: Find all integers between m and n (m and n integers with 1 \u0026lt;= m \u0026lt;= n) such that the sum of their squared divisors is itself a square. \n\n# Task\n\nFind all integers between m and n (m and n integers with 1 \u003c= m \u003c= n) such that the sum of their squared divisors is itself a square.\n\nWe 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.\n\n# For Codewars\n\nThis is what I had to put in, the code for my PHP Unit project was slightly different.\n\n\u003cpre\u003e\nfunction listSquared($m, $n) : array\n{\n    $divisors = [];\n    for ($i = $m; $i \u003c= $n; $i++) {\n        $squaredNumber = getDivisorSquared($i);\n\n        if (isSquareNumber($squaredNumber)) {\n            $divisors[] = [$i, $squaredNumber];\n        }\n    }\n\n    return $divisors;\n}\n\nfunction isSquareNumber($number) : bool\n{\n    return sqrt($number) == floor(sqrt($number));\n}\n\nfunction getDivisorSquared($number) : int\n{\n    $result = 0;\n\n    for($i = 1; $i \u003c= round(sqrt($number)); $i++){\n        if($number % $i === 0){\n            $result += $i ** 2;\n            $ii = $number / $i;\n            if ($i !== $ii) {\n                $result += $ii ** 2;\n            }\n        }\n    }\n\n    return $result;\n}\n\u003c/pre\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaparascal2020%2Fcode-kata-integers-recreate-one","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpaparascal2020%2Fcode-kata-integers-recreate-one","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaparascal2020%2Fcode-kata-integers-recreate-one/lists"}