{"id":21074130,"url":"https://github.com/tomaztk/kaprekar_r","last_synced_at":"2025-10-08T19:25:34.415Z","repository":{"id":131356247,"uuid":"171111837","full_name":"tomaztk/kaprekar_R","owner":"tomaztk","description":"Calculating and visualizing Kaprekar constant (6174) using R","archived":false,"fork":false,"pushed_at":"2019-02-20T08:49:57.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-14T03:27:04.638Z","etag":null,"topics":["digit-numbers","kaprekar","r","r-language","r-programming","rstats","sort","subtraction"],"latest_commit_sha":null,"homepage":null,"language":"R","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/tomaztk.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":"2019-02-17T11:03:00.000Z","updated_at":"2020-01-11T20:12:51.000Z","dependencies_parsed_at":"2023-04-01T04:05:22.549Z","dependency_job_id":null,"html_url":"https://github.com/tomaztk/kaprekar_R","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tomaztk/kaprekar_R","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomaztk%2Fkaprekar_R","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomaztk%2Fkaprekar_R/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomaztk%2Fkaprekar_R/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomaztk%2Fkaprekar_R/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tomaztk","download_url":"https://codeload.github.com/tomaztk/kaprekar_R/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomaztk%2Fkaprekar_R/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279000704,"owners_count":26082805,"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","status":"online","status_checked_at":"2025-10-08T02:00:06.501Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["digit-numbers","kaprekar","r","r-language","r-programming","rstats","sort","subtraction"],"created_at":"2024-11-19T19:14:36.959Z","updated_at":"2025-10-08T19:25:34.409Z","avatar_url":"https://github.com/tomaztk.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"# kaprekar_R\nCalculating and visualizing Kaprekar constant (6174) using R\nReference to blog: (https://tomaztsql.wordpress.com/2019/02/20/number-6174-or-kaprekar-constant-in-r/).\n\nKaprekar number is one of those gems, that makes Mathematics fun. Indian recreational mathematician D.R.Kaprekar, found number 6174 – also known as Kaprekar constant – that will return the subtraction result when following this rules:\n\n1. Take any four-digit number, with minimum of two different numbers (1122 or 5151 or 1001 or 4375 and so on.)\n1. Sort the taken number and sort it descending order and ascending order.\n1. Subtract the descending number from ascending number.\n1. Repeat step 2. and 3. until you get the result 6174\n\nIn practice, e.g.: number 5462, the steps would be:\n\n6542 - 2456 = 4086   \n8640 -  468 = 8172   \n8721 - 1278 = 7443   \n7443 - 3447 = 3996   \n9963 - 3699 = 6264   \n6642 - 2466 = 4176   \n7641 - 1467 = **6174**    \n\n## Structure\n\n1. Kaprekar Function\n1. Walking through all the four-digit numbers and calculating Kaprekar steps to converge to solution\n1. Most frequent solutions\n\n## Clone the repository\n\nBasic git steps:\n```\ngit clone https://github.com/tomaztk/kaprekar_R\n\n```\n\nIf you already cloned the code, update the code with:\n\n```\ngit pull remote https://github.com/tomaztk/kaprekar_R\n\n```\n\nOnce you created your part, add, commit and push with following:\n\n```\ngit add .\ngit commit -m 'your comment'\ngit push\n```\n\n## License\n\n[![ForTheBadge makes-people-smile](http://ForTheBadge.com/images/badges/makes-people-smile.svg)](http://ForTheBadge.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomaztk%2Fkaprekar_r","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftomaztk%2Fkaprekar_r","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomaztk%2Fkaprekar_r/lists"}