{"id":21806821,"url":"https://github.com/roguh/the_long_count","last_synced_at":"2026-05-19T00:02:08.509Z","repository":{"id":89928125,"uuid":"236407648","full_name":"roguh/the_long_count","owner":"roguh","description":"The Long Count, a Mayan numeric system for dates.","archived":false,"fork":false,"pushed_at":"2021-11-22T03:46:29.000Z","size":13,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-04-07T06:36:28.231Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","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/roguh.png","metadata":{"files":{"readme":"README.org","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":"2020-01-27T02:30:04.000Z","updated_at":"2021-11-22T03:46:32.000Z","dependencies_parsed_at":"2023-05-30T13:45:17.920Z","dependency_job_id":null,"html_url":"https://github.com/roguh/the_long_count","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/roguh/the_long_count","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roguh%2Fthe_long_count","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roguh%2Fthe_long_count/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roguh%2Fthe_long_count/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roguh%2Fthe_long_count/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/roguh","download_url":"https://codeload.github.com/roguh/the_long_count/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roguh%2Fthe_long_count/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33196089,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-18T09:27:30.708Z","status":"ssl_error","status_checked_at":"2026-05-18T09:27:28.300Z","response_time":71,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2024-11-27T12:30:12.255Z","updated_at":"2026-05-19T00:02:08.454Z","avatar_url":"https://github.com/roguh.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"#+TITLE: The Long Count, a Mayan numeric system for dates.\n#+AUTHOR: Hugo O. Rivera Calzadillas\n\nA Mesoamerican notation for writing integers in base 20 with an 18 in the\nthird position, where 20^3 would go.\n\n- 1 day is called K'in.\n- 20 days are called Winal.\n- 360 (20 * 18) days are called Tun. This is where the number system differs\n  from base twenty. This is likely because 360 is approximately one year.\n- 7200 (20 ** 2 * 18) days are called K'atun and represent about 20 years.\n- This continues until 1 Alautun, which is 20 ** 7 * 18 and represents about\n  63,081,429 years.\n\n* Examples\n\nHere is how many years each number represents:\n\n#+BEGIN_SRC\n\u003e\u003e\u003e import M\n\u003e\u003e\u003e for days, name in M.days_to_names.items():\n...     print(f\"A {name} is {days} days, or approximately {days / 365:,.2f} years.\")\nA K'in is 1 days, or approximately 0.00 years.\nA Winal is 20 days, or approximately 0.05 years.\nA Tun is 360 days, or approximately 0.99 years.\nA K'atun is 7200 days, or approximately 19.73 years.\nA B'ak'tun is 144000 days, or approximately 394.52 years.\nA Piktun is 2880000 days, or approximately 7,890.41 years.\nA Kalabtun is 57600000 days, or approximately 157,808.22 years.\nA K'inchiltun is 1152000000 days, or approximately 3,156,164.38 years.\nA Alautun is 23040000000 days, or approximately 63,123,287.67 years.\n\n#+END_SRC\n\n\nHere is a factorization of each number to powers of 20 and 18:\n\n#+BEGIN_SRC\n\u003e\u003e\u003e M.days\n[1, 20, 360, 7200, 144000, 2880000, 57600000, 1152000000, 23040000000]\n\u003e\u003e\u003e for days in M.days[2:]: \n...     print(f\"{days} days are called {M.days_to_names[days]} = 18 * 20 ** {1 + M.log20(days / 18)} days\")\n360 days are called Tun = 18 * 20 ** 2.0 days\n7200 days are called K'atun = 18 * 20 ** 3.0 days\n144000 days are called B'ak'tun = 18 * 20 ** 4.0 days\n2880000 days are called Piktun = 18 * 20 ** 5.0 days\n57600000 days are called Kalabtun = 18 * 20 ** 6.000000000000001 days\n1152000000 days are called K'inchiltun = 18 * 20 ** 7.0 days\n23040000000 days are called Alautun = 18 * 20 ** 8.0 days\n\n#+END_SRC\n\nNumbers are represented as numpy arrays with 9 elements.\nThe 0th element is the first digit, the 1st is the second digit, and so on.\n\nFor example, 44 = 4 Tun + 2 Winal.\n\n#+BEGIN_SRC\n\u003e\u003e\u003e M.from_integer(44)\narray([4, 2, 0, 0, 0, 0, 0, 0, 0])\n\n#+END_SRC\n\nYou can add numbers with M.add. There is also:\n\n- M.increment to add 1 to a number.\n- M.shift to multiply a number by 20 or 18.\n- M.repeat to apply a function N times.\n\n#+BEGIN_SRC\n\u003e\u003e\u003e M.to_integer(M.add(M.from_integer(122), M.from_integer(34)))\n156\n\n\u003e\u003e\u003e M.to_integer(M.repeat(M.shift, 5, M.from_integer(222)))\n639360000\n\n#+END_SRC\n\n* Testing\n\n#+BEGIN_SRC\nmake test\n#+END_SRC\n\n* Development\n\n#+BEGIN_SRC\nmake format\n#+END_SRC\n\n* Sources\n\n- https://en.wikipedia.org/wiki/Mesoamerican_Long_Count_calendar\n- https://es.wikipedia.org/wiki/Cuenta_larga\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froguh%2Fthe_long_count","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Froguh%2Fthe_long_count","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froguh%2Fthe_long_count/lists"}