Seven "patterns" in Psalm 12:6, and how I found them in the Quran

A bit over a week ago, I saw an interesting video on YouTube from KingJamesCode37 called “The Number 7 in the BIBLE”. It’s a 46-minute collection of tidbits about the Bible – specifically, the King James Version – that have to do with the number 7. This is apparently supposed to prove that the King James Bible is the preserved word of God.

However, I didn’t find this video interesting because of its content.

I’m an atheist, and I regularly talk about religious arguments on my TikTok account (@kingyoshiyahu). So I’ve seen many religious arguments based on numerology. And I’ve also seen many arguments for “KJV Onlyism” – the belief that the King James Version is the only English translation of the Bible that isn’t corrupt.

And I found this video interesting because this is the first time I’ve seen both kinds of arguments being made at the same time.

After a short back-and-forth in the comments of that video, KingJamesCode37 gave me a very interesting challenge:

…I show in another video seven 777 patterns in Psalm 12-6. I challenge you to find seven 777 patterns in a verse in the Quran that contains the word “seven.”

Challenge accepted.

What are his patterns?

To start, he clarifies that he found these “patterns” with a piece of software called King James Pure Bible Search, which allows you to search for words and phrases in the King James Bible.

He finds the “patterns” in Psalm 12:6: “The words of the LORD are pure words: as silver tried in a furnace of earth, purified seven times” (KJV). This verse is significant to KJV Onlyists, because they interpret “the words of the LORD” to mean the KJV specifically.1

For the “patterns” themselves, he presents seven different partitions of the verse into phrases, underlining some phrases and omitting others.

The words of / the LORD are / pure words: as / silver / tried / in a / furnace / of earth, / purified / seven times. = 777 KJB

The words / of the LORD are / pure / words: as / silver tried in a furnace of earth, purified / seven / times. = 777 OT

The words of / the LORD are / pure / words: as / silver tried in a / furnace of earth, / purified / seven / times. = 777 verses KJB

The words / of the LORD are / pure / words: as / silver tried / in a / furnace / of earth, / purified / seven / times. = 777 KJB

The words of / the LORD are / pure / words: / as silver / tried / in a / furnace / of earth, / purified / seven times. = 777 KJB

The words of / the LORD are / pure / words: as / silver / tried in / a / furnace / of earth, / purified / seven / times. = 777 KJB

The words of / the LORD are / pure / words: as / silver / tried / in a furnace / of earth / purified seven / times. = 777 KJB

If you search for these phrases in King James Pure Bible Search (treating the underlined phrases as case-sensitive, and omitting the omitted phrases), it will return the number of occurrences (or number of verses they occur in) as 777.

So to find this kind of “pattern” in the Quran, I could simply take a verse, partition it into phrases, and search for those phrases in the Quran. If I ever got 777 occurrences (or 777 verses) as a result, that partition would be a “pattern”. And if I found 7 of these “patterns”, the challenge would be complete.

How would I find the patterns?

KingJamesCode37 said that the Quran verse I choose must contain the word “seven”. So I decided to use the most similar verse to Psalm 12:6 I could find:

We have given thee seven of the oft-repeated (verses), and the great Qur’an.

— Surah 15:87

I also decided to use the most similar English translation to the KJV I could find: Muhammad Marmaduke Pickthall’s “The Meaning of the Glorious Koran”.

Finally, because manually going through each partition and searching for phrases would be tedious and error-prone, I decided to write a Python program to do it for me.

Looping through every possible partition of the verse is easy enough with a recursive algorithm, which leaves me with only one question: how do I conduct a search of the Pickthall Quran translation using Python?

How do I search the Quran?

No ready-made code exists for my specific use case, so I knew early on that I would have to write my own. Because I’m doing this in response to a user of King James Pure Bible Search, I thought it would be proper to figure out how exactly it does its searches. Thankfully, the developer dedicates an entire section of the user manual to this (starting at page 156) – and KJV Onlyist editorializing aside, it does remove a lot of guesswork I would’ve done otherwise.

For the character set, King James Pure Bible Search treats all letters, the hyphen, and the apostrophe, as unique characters composing a word. It also treats regular Arabic Numerals as unique characters too, but the King James Bible doesn’t have any numbers written as numbers, they are all written as words. It’s the “Holy Word of God”, not the “Holy Numbers”.

Using this character set, all 12838(*) unique words (excluding case) were extracted. A concordance was created mapping each word to its exact position in the text. For example, using Genesis 1:1, we have the following unique words and index mappings:

and : 8
beginning : 3
created : 5
earth : 10
God : 4
heaven : 7
In : 1
the : 2, 6, 9

This is what is stored in the database, but minimized to combine words that appear with varying case, which minimizes the number of comparisons, as we can see if the words match as lowercase and if so, then compare their correct case only if the user happens to be doing a case-sensitive search.

As the database is loaded into memory, an inverse table is created mapping position back to individual words:

1: in
2: the
3: beginning
4: god
5: created
6: the
7: heaven
8: and
9: the
10: earth

All punctuation is completely discarded at this level.

When a word is typed in a Search Phrase, we simply find that word in the concordance and see what indexes it appears at in the text. In the above example, if the user types “the”, we would find that we have indexes 2, 6, and 9.

My code counts words and conducts searches in the same way as described there, but instead of building a list of words from a word-index mapping, it builds a word-index mapping from a list of words. Also, to extend searching to multi-word phrases, I do a linear scan of each word after each occurrence of the first word and check that they all match.

The resulting code is decently fast – especially after liberally sprinkling functools.cache over a few functions – and the core functionality ended up being a relatively small 344 lines of code, half of which are blank lines or comments.

Of course, it would be great to publish my code in such a way that KingJamesCode37 could run it to verify my results for himself. To make this as easy as possible, I turned it into a Python module called purequransearch, and I bundled it with every English translation available in tanzil.net’s collection of Quran translations.

Tip

In addition to being importable in a Python program, purequransearch can be run on the command line. Once you install it with the the following command (this only needs to be done once)…

pip install purequransearch

…you can run purequransearch on the command line like so:

purequransearch search "search for;^the Words;in a book" -c pickthall

This command will search in the Pickthall translation for the phrases “search for” (case insensitive), “the Words” (case sensitive), and “in a book” (case insensitive). The results are printed in the terminal by default, but you can also write the results to a file by specifying the -o option, e.g. -o filename.txt.

With this module published on PyPI, my pattern-searching code can simply import from purequransearch (provided the user has installed it, of course!).

What patterns did I find?

Once my theorizing was done, I wrote a Python program to search for “777 patterns” in the Quran’s Surah 15:87. It ended up finding 90 such “patterns”, which I curated to get a list of the 7 “patterns” I thought looked the most impressive and diverse.

We have given / thee / seven of the oft-repeated / verses and the / great / Quran = 777 occurrences

We have / given thee seven of the oft-repeated / verses / and the / great / Quran = 777 verses

We have / given / thee / seven of the oft-repeated / verses / and the great Quran = 777 occurrences

We have given / thee / seven of the / oft-repeated / verses / and the / great / Quran = 777 occurrences

We have / given / thee / seven / of the oft-repeated verses / and the / great / Quran = 777 verses

We have / given / thee / seven / of the oft-repeated / verses / and / the great / Quran = 777 occurrences

We / have given / thee / seven / of the oft-repeated / verses / and the / great / Quran = 777 occurrences

Challenge complete.

What did this prove?

To be absolutely clear: I am not a Muslim, nor do I believe the Quran is the preserved word of God.

The reason I tried finding these “patterns” in the Quran is to demonstrate that these “patterns” are not special or unique to the Bible. In fact, they’re also not unique to the target number 777, or verses with the word “seven” in them, as you would see by running my program with other verses and target numbers.

And because these types of “patterns” aren’t unique to the Bible – much less the King James Version – this kind of argument for God or the Bible is unsound at best, and proves contradictory religious claims at worst.

Did I let him know about this?

Yes, via an email and a TikTok video (which I linked to him in said email). I also tried posting a comment about it under the same YouTube video we commented under earlier, but the comment seems to have disappeared.

He hasn’t responded yet, or acknowledged my response to his challenge in any way. When (or if) he does, I’ll post an update. But somehow, I don’t think he’ll take this well…


  1. The next verse says “Thou shalt keep them, O LORD, thou shalt preserve them from this generation for ever.” KJV Onlyists also interpret this verse as talking about the KJV, because they interpret the word “them” as referring to the “words of the LORD” from the previous verse.

    Some other translations make it clearer that this verse means the Lord will preserve the poor and the needy (mentioned in verse 5). KJV Onlyists see this as a corruption of the text – though their reasons for this are often circular.