René's URL Explorer Experiment


Title: [FEATURE]: The Repunit theorem · Issue #1866 · TheAlgorithms/JavaScript · GitHub

Open Graph Title: [FEATURE]: The Repunit theorem · Issue #1866 · TheAlgorithms/JavaScript

X Title: [FEATURE]: The Repunit theorem · Issue #1866 · TheAlgorithms/JavaScript

Description: Motivation Numbers formed by repeating digits or repeating blocks—such as 111111, 424424, or structures like 10ⁿ + 1 (e.g., 100000001)—follow predictable patterns in number theory. These patterns are not random; they arise from the multi...

Open Graph Description: Motivation Numbers formed by repeating digits or repeating blocks—such as 111111, 424424, or structures like 10ⁿ + 1 (e.g., 100000001)—follow predictable patterns in number theory. These patterns a...

X Description: Motivation Numbers formed by repeating digits or repeating blocks—such as 111111, 424424, or structures like 10ⁿ + 1 (e.g., 100000001)—follow predictable patterns in number theory. These patterns a...

Opengraph URL: https://github.com/TheAlgorithms/JavaScript/issues/1866

X: @github

direct link

Domain: redirect.github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[FEATURE]: The Repunit theorem","articleBody":"### Motivation\n\nNumbers formed by repeating digits or repeating blocks—such as 111111, 424424, or structures like 10ⁿ + 1 (e.g., 100000001)—follow predictable patterns in number theory. These patterns are not random; they arise from the multiplicative order of 10 modulo a prime.\n\nRight now, we treat these numbers as arbitrary integers, which leads to three core problems:\n\n1. Missing mathematical behavior\n\nRepeated-digit numbers have a very specific factorization rule (e.g., 100000001 being divisible by 17). Without modeling the underlying theorem, our current logic either:\n- gives no insight into why the divisibility works,\n- or forces us to compute divisibility using naive methods that scale poorly.\n\n2. Inconsistent patterns in code\n\nBecause these numbers are treated on a case-by-case basis, any function that needs to handle:\n- repunits (111…1),\n- repeated digits (777777),\n- repeated blocks (XYZXYZ),\n- or cyclotomic structures (10ⁿ ± 1),\n\nends up re-implementing partial logic, often incorrectly or inefficiently. Bringing this into a unified mathematical rule improves maintainability and correctness.\n\n3. Huge performance waste for large repeated patterns\n\nRepeated-digit integers can be extremely large (sometimes more than a million digits long).\n\nUsing the multiplicative-order approach lets us compute divisibility using O(log n) modular arithmetic and without building the actual number at all.\n\nWith this algorithm in place, once the multiplicative order is part of the system, it unlocks:\n\n- fast repunit divisibility checks,\n- systematic analysis of repeated-digit numbers,\n- handling of cyclotomic expressions,\n- better support for prime testing involving decimal periodic.\n\nI believe this will be a good one to tackle, given that it's an unresolved problem in number theory.\n\n### Examples\n\n\nThese examples show actual numbers, their patterns, and the mathematical reason they’re divisible by certain primes.\n\n\n#### **1. Classic example: 100000001 is divisible by 17**\n\n```\n100000001 ÷ 17 = 5882353\n```\n\nWhy?\n\n`100000001 = 10⁸ + 1`\nThe multiplicative order of 10 modulo 17 is **8**, meaning:\n\n```\n10⁸ ≡ 1 (mod 17)\n```\n\nSo:\n\n```\n10⁸ + 1 ≡ 2 (mod 17)? No → but 10⁸ ≡ -1 (mod 17)\n```\n\nActually:\n\n```\n10⁸ ≡ -1 (mod 17)\n```\n\nTherefore:\n\n```\n10⁸ + 1 ≡ 0 (mod 17)\n```\n\n---\n\n#### **2. Repeated block example: 424424**\n\nBlock: `424`\nRepeated twice → total structure: `424424`\n\nDivisible by:\n\n```\n7, 11, 13 → because 1001 = 7 × 11 × 13\n```\n\nWhy?\n\n`424424 = 424 × 1001`, and:\n\n```\n1001 = 10³ + 1 = (10³ - 1)/9 × 9\n```\n\nThe fact that 1001 factors into 7, 11, and 13 comes from the multiplicative order of 10 modulo those primes.\n\n---\n\n#### **3. Repunit example: 111111**\n\n`111111` is `6` repeated digits of `1`.\nIt equals:\n\n```\n111111 = (10⁶ − 1) / 9\n```\n\nDivisible by:\n\n```\n3\n7\n11\n13\n37\n```\n\nWhy these primes?\n\nBecause the multiplicative order of 10 modulo each of those primes divides 6.\nFor example:\n\n* ord₁₁(10) = 2 → and 2 divides 6\n* ord₃₇(10) = 3 → and 3 divides 6\n* ord₇(10) = 6 → and 6 divides 6\n\nSo all of them divide `111111`.\n\n---\n\n#### **4. Repeated digit example: 999999999 (9 repeated 9 times)**\n\nThis is:\n\n```\n999,999,999 = 9 × 111,111,111\n```\n\nAnd `111,111,111` has divisors:\n\n```\n3\n37\n333667\n```\n\nAgain, it is determined by which primes have multiplicative order dividing 9.\n\n---\n\n#### **5. Three-block repeated pattern: XYZXYZXYZ**\n\nExample: `123123123`\n\nThis is:\n\n```\n123 × 1,001,001\n```\n\nPrime factors of 1,001,001:\n\n```\n1,001,001 = 7 × 11 × 13 × 101 × 109\n```\n\nAll these primes divide the repeated-block number because their orders divide 3×3.\n\n---\n\n#### **6. Palindromic power example: 10⁶ − 1 = 999999**\n\nDivisible by:\n\n```\n9 → trivial because it's 9 repeated digits  \n37  \n3  \n27  \n```\n\nThe factor `37` is the famous one here because:\n\n```\n999 = 27 × 37\n```\n\nwhich again is tied to the order of 10 modulo 37 (which is 3).\n\n---\n\n#### **7. Full reptend prime example**\n\nA prime is \"full reptend\" in base 10 if the order of 10 mod p is p−1.\n\nExample:\n\n```\n7 is a full reptend prime.\n10 has order 6 mod 7.\n```\n\nThis is why:\n\n```\n1/7 = 0.142857142857… (repeats every 6 digits)\n```\n\nand why repunit length = 6.\n\n\n\n\n### Possible workarounds\n\n_No response_\n\n### Additional information\n\n_No response_","author":{"url":"https://github.com/ridge-kimani","@type":"Person","name":"ridge-kimani"},"datePublished":"2025-12-11T11:19:04.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/1866/JavaScript/issues/1866"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:1974534c-80ec-2aa9-1f08-b5b0df4b4143
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idD918:2A6D10:24432C8:2F109BF:696B55FC
html-safe-nonce388c8cf6debb3715e175e94851e4e6d44535edcdf8a5408b0ffd3f27965f22d0
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEOTE4OjJBNkQxMDoyNDQzMkM4OjJGMTA5QkY6Njk2QjU1RkMiLCJ2aXNpdG9yX2lkIjoiNzkzNzY1NzAxMjg3Njk1NzE4MCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac650c9feecdacc515cddda72ee2b3146456163feb0b713ee058315a3595b454af
hovercard-subject-tagissue:3718943977
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/TheAlgorithms/JavaScript/1866/issue_layout
twitter:imagehttps://opengraph.githubassets.com/b463baceca457c5e3c54228b4ec08cf735fb69ead5c79a74c74583ded29203c1/TheAlgorithms/JavaScript/issues/1866
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/b463baceca457c5e3c54228b4ec08cf735fb69ead5c79a74c74583ded29203c1/TheAlgorithms/JavaScript/issues/1866
og:image:altMotivation Numbers formed by repeating digits or repeating blocks—such as 111111, 424424, or structures like 10ⁿ + 1 (e.g., 100000001)—follow predictable patterns in number theory. These patterns a...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameridge-kimani
hostnamegithub.com
expected-hostnamegithub.com
None5f99f7c1d70f01da5b93e5ca90303359738944d8ab470e396496262c66e60b8d
turbo-cache-controlno-preview
go-importgithub.com/TheAlgorithms/JavaScript git https://github.com/TheAlgorithms/JavaScript.git
octolytics-dimension-user_id20487725
octolytics-dimension-user_loginTheAlgorithms
octolytics-dimension-repository_id97086543
octolytics-dimension-repository_nwoTheAlgorithms/JavaScript
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id97086543
octolytics-dimension-repository_network_root_nwoTheAlgorithms/JavaScript
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release82560a55c6b2054555076f46e683151ee28a19bc
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://redirect.github.com/TheAlgorithms/JavaScript/issues/1866#start-of-content
https://redirect.github.com/
Sign in https://redirect.github.com/login?return_to=https%3A%2F%2Fgithub.com%2FTheAlgorithms%2FJavaScript%2Fissues%2F1866
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://redirect.github.com/login?return_to=https%3A%2F%2Fgithub.com%2FTheAlgorithms%2FJavaScript%2Fissues%2F1866
Sign up https://redirect.github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=TheAlgorithms%2FJavaScript
Reloadhttps://redirect.github.com/TheAlgorithms/JavaScript/issues/1866
Reloadhttps://redirect.github.com/TheAlgorithms/JavaScript/issues/1866
Reloadhttps://redirect.github.com/TheAlgorithms/JavaScript/issues/1866
TheAlgorithms https://redirect.github.com/TheAlgorithms
JavaScripthttps://redirect.github.com/TheAlgorithms/JavaScript
Please reload this pagehttps://redirect.github.com/TheAlgorithms/JavaScript/issues/1866
Notifications https://redirect.github.com/login?return_to=%2FTheAlgorithms%2FJavaScript
Fork 5.8k https://redirect.github.com/login?return_to=%2FTheAlgorithms%2FJavaScript
Star 34k https://redirect.github.com/login?return_to=%2FTheAlgorithms%2FJavaScript
Code https://redirect.github.com/TheAlgorithms/JavaScript
Issues 21 https://redirect.github.com/TheAlgorithms/JavaScript/issues
Pull requests 167 https://redirect.github.com/TheAlgorithms/JavaScript/pulls
Actions https://redirect.github.com/TheAlgorithms/JavaScript/actions
Projects 0 https://redirect.github.com/TheAlgorithms/JavaScript/projects
Wiki https://redirect.github.com/TheAlgorithms/JavaScript/wiki
Security Uh oh! There was an error while loading. Please reload this page. https://redirect.github.com/TheAlgorithms/JavaScript/security
Please reload this pagehttps://redirect.github.com/TheAlgorithms/JavaScript/issues/1866
Insights https://redirect.github.com/TheAlgorithms/JavaScript/pulse
Code https://redirect.github.com/TheAlgorithms/JavaScript
Issues https://redirect.github.com/TheAlgorithms/JavaScript/issues
Pull requests https://redirect.github.com/TheAlgorithms/JavaScript/pulls
Actions https://redirect.github.com/TheAlgorithms/JavaScript/actions
Projects https://redirect.github.com/TheAlgorithms/JavaScript/projects
Wiki https://redirect.github.com/TheAlgorithms/JavaScript/wiki
Security https://redirect.github.com/TheAlgorithms/JavaScript/security
Insights https://redirect.github.com/TheAlgorithms/JavaScript/pulse
New issuehttps://redirect.github.com/login?return_to=https://github.com/TheAlgorithms/JavaScript/issues/1866
New issuehttps://redirect.github.com/login?return_to=https://github.com/TheAlgorithms/JavaScript/issues/1866
[FEATURE]: The Repunit theoremhttps://redirect.github.com/TheAlgorithms/JavaScript/issues/1866#top
https://github.com/ridge-kimani
https://github.com/ridge-kimani
ridge-kimanihttps://github.com/ridge-kimani
on Dec 11, 2025https://github.com/TheAlgorithms/JavaScript/issues/1866#issue-3718943977
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.