{"id":16661251,"url":"https://github.com/snowleopard/fib-concat-primes","last_synced_at":"2026-07-18T13:10:08.021Z","repository":{"id":24943805,"uuid":"28361399","full_name":"snowleopard/fib-concat-primes","owner":"snowleopard","description":"Generating Fibonacci concat primes","archived":false,"fork":false,"pushed_at":"2014-12-23T23:20:35.000Z","size":532,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-19T13:44:54.842Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/snowleopard.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-12-22T21:56:27.000Z","updated_at":"2019-12-05T06:33:44.000Z","dependencies_parsed_at":"2022-08-06T05:15:45.312Z","dependency_job_id":null,"html_url":"https://github.com/snowleopard/fib-concat-primes","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/snowleopard%2Ffib-concat-primes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snowleopard%2Ffib-concat-primes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snowleopard%2Ffib-concat-primes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snowleopard%2Ffib-concat-primes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/snowleopard","download_url":"https://codeload.github.com/snowleopard/fib-concat-primes/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243293794,"owners_count":20268142,"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-12T10:34:19.086Z","updated_at":"2025-10-17T10:02:36.178Z","avatar_url":"https://github.com/snowleopard.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"Fibonacci concat primes\n=======================\n\nA _Fibonacci concat prime_ is a prime number obtained by concatenating several first elements of the [Fibonacci sequence](https://en.wikipedia.org/wiki/Fibonacci_number) (1, 1, 2, 3, 5, 8, 13, ...). These numbers showed up in [Evelyn Lamb's tweet](https://twitter.com/evelynjlamb/status/546943925357785089) and got me interested, especially since I wanted to play with primality testing of big numbers in Haskell. ('Fibonacci concat prime' is a completely made up name; shout if you know the right one!)\n\nKnown trivial examples: \n * 11 = 1 ○ 1\n * 1123 = 1 ○ 1 ○ 2 ○ 3 \n\nI got curious if there were any other Fibonacci concat primes and wrote a generator in Haskell using [this implementation of Miller-Rabin primality test](https://github.com/pernas/Primes).\n\n[My generator](fibConcatPrimes.hs) seems to work fine, but unfortunately it reported that there were no other Fibonacci concat primes less than 10\u003csup\u003e35000\u003c/sup\u003e! It took just a couple of hours for the generator to do the work, which I thought was pretty impressive since I made no effort to optimise the code.\n\nBeing a bit disappointed by my wasted efforts, I decided to try my luck by _reversing_ the numbers. And it worked!\n\nThe following four _reversed Fibonacci concat primes_ were found below 10\u003csup\u003e20000\u003c/sup\u003e:\n * 11 = reverse (1 ○ 1)\n * 211 = reverse (1 ○ 1 ○ 2)\n * 853211 = reverse (1 ○ 1 ○ 2 ○ 3 ○ 5 ○ 8)\n * 8807636183460050617945574903584919919511612709750316609341373260988735867648438276143212267642043327441464197323493449875748800793972557076092264546143508797705841112756829445969403139394033551560846297811045489492107112516080353190709429309149906403096671114184206432727358212075549448825300987777256577108676171327758902016012489130747556188735937250416918703740522955780084511406202276599789276821952616925345637173341585225442683859312721757626837119261335990082159234701105630252096268521940247877767962570843705121792309113638171309431133780410773449433469241976214108556155143320168954236961880937187514225303941564722978820758754253903871296264314023892241511871381469139312152057863647568211771649015676181448527951789167733324419855431231853211 = reverse (1 ○ ... ○ 160500643816367088)\n\nSo, now if you need a big (754 digits) prime number, just concatenate Fibonacci numbers from F\u003csub\u003e1\u003c/sub\u003e to F\u003csub\u003e84\u003c/sub\u003e and then reverse the result!\n\nRelated work\n------------\n\nA comment on [this OEIS sequence](http://oeis.org/A019523) says that no other non-reversed Fibonacci concat primes are currently known.\n\nThere is another related sequence at OEIS: [A134069](http://oeis.org/A134069). Note that it is different from what I call reversed Fibonacci concat primes: the sequence of Fibonacci numbers is reversed, but the numbers themselves are not, e.g., it contains 13853211 instead of 31853211. To distinguish the sequences, I will refer to A134069 as _semireversed Fibonacci concat primes_. I have implemented their generation as well (try the `-semireversed` option); the only semireversed Fibonacci concat primes below 10\u003csup\u003e20000\u003c/sup\u003e are 11, 211 and 853211.\n\nInstructions\n------------\n\nTo clone this repository, run the following command:\n```\ngit clone --recursive https://github.com/snowleopard/fib-concat-primes.git\n```\nNote that `--recursive` is important, as otherwise submodule `Primes` will not be cloned.\n\nTo build the sources, run the `build.bat` script (should be cross-platform).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsnowleopard%2Ffib-concat-primes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsnowleopard%2Ffib-concat-primes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsnowleopard%2Ffib-concat-primes/lists"}