Another computational hack for double factorials

In an earlier post (here), I talked about a way to calculate a run of 4 double factorials (n, n+2, n+4, n+6) quickly.

((n * n+6) + 4)2 – 16

Turns out — there’s another way, too.

That number which is squared? If you’re starting with n=1, it follows a pattern.

11 + (0 * 128) = 11 * 11 = 121 -16 = 105 = 1 * 3 * 5 * 7
11 + (1 * 128) = 139 * 139 = 19321 – 16 = 19305 = 9 * 11 * 13 * 15
11 + (3 * 128) = 395 * 395 = 156025 – 16 = 156009 = 17 * 19 * 21 * 23
11 + (6 * 128) = 779 * 779 = 606841 – 16 = 606825 = 25 * 27 * 29 * 31
11 + (10 * 128) = 1291 * 1291 = 1666681 – 16 = 1666665 = 33 * 35 * 37 * 39
And so on.

0, 1, 3, 6, 10, 15, 21, 28, 36 — a pattern you can get by starting with 0, then adding 1, then 2, then 3, then 4, etc. Also known as the Triangular Number sequence.

The ultimate reason I’m interested in double factorials is because they can be used to crack a semiprime.

In principle, you ‘d simply do this:

1. Calculate the (odd) double factorial of the square root of a semiprime (p). Let’s call that d.
2. d mod p = b.
3. Highest common factor of b and p = one of the prime factors of p.

So — am I any closer to cracking semi-primes?

Not yet. But I’m definitely having fun along the way.

The madness is infectious, and out in the wild.

Hi, all.

The game is now live — and has been for almost a month.

Launch has been pretty wild. We’ve had lots more feedback than I ever thought we would, given that it’s a first time game for an indy software release. We’ve had video game reviewers give us scores from 6.8/10 to 9/10, which is quite a range.

In short — some people love it, some people — not so much. Those that do love it, seem to really love it. We’re even starting to see people create fan art.

A lot of the controversy centers on the game’s main mechanic — an open text entry field — and the way the game then handles that text entry.

Without diving into specifics — parsing intent in the English language is very hard. The way it works in TIMODD is via a keyword parser, that looks for various keywords and if a match is found, plays the required response.

Some players just can’t find those keywords. We added a hint system, that basically tells the players which keywords to use to get a response, but players don’t seem to want to use it — even though there’s no penalty for doing so.

Other players want to ask questions that we haven’t recorded answers for. Even though we think we’ve produced the world’s largest FMV game (1600 responses, 7 hours of footage) — there’s no realistic way we could cover every possibility.

It’s been interesting. Once the Madness has died down a little, I’ll come back and tell you the things I’ve learned from the whole experience.

Been Busy

So, so busy.

The Infectious Madness of Doctor Dekker (TIMODD) now has an official Steam page and a release date: May 19th, 2017.

It’s also been featured in RockPaperShotgun 🙂

Aside from working on two books at the same time, I’ve also been working on not one, but two secret projects. Which are secret obviously, so I can’t tell you very much — but I can give you a hint about one of them: Natural Language Programming.

Anyway. Shocking lack of blog updates, recently. Sorry about that. I’ll pop back in after TIMODD launches, and tell you how it went.

 

Factoring semiprimes using only addition

Methodology:

  1. Create a dictionary. Add keys for all primes below the square root of the semiprime (or just odd numbers, if you don’t have a list of the primes), and set the value to be the same as the key
  2. For each dictionary entry — add the key to the value
  3. If the value == semiprime — then factor found
  4. If the value > semiprime — then remove this dictionary entry and all dictionary entries with a higher key
  5. Repeat until factor found

Why does this work?

Simply put, the semiprime is the product of two primes. For example — 3 * 7 = 21.  As such — 7 lots of 3’s (3+3+3+3+3+3+3) and 3 lots of 7’s (7+7+7) = 21. All day, every day.

Is it a fast way to factor semiprimes?

Nope. Not even close. It’s just a mathematical constraint-based curiosity — and I like those 🙂

Apparently, it’s my Birthday

I am now officially old enough to use the phrase “Get off my lawn”. Also — “I’d have got away with it, too, if it wasn’t for you darn kids!”

To celebrate, I’m breaking out the Brandy.

Cheers 🙂

How to have Less ads (and fund the Internet).

Adverts suck.

They make every user experience on the Internet worse. They’re also a vector for virus injection.

Users already hate them, as illustrated by the popular rise of ad blockers.

So — here’s a modest proposal for a new funding model for the web:

User’s opt in to an ad-free internet service, that costs X per month. Let’s say $20.

Websites that support that service remove ads when users of that service use their site. In return, they receive a slice of that X per month.

Website providers get micro transactions per view; User’s get Ad-free websites.

Win/win, right?

Like the idea? Google are already trialling the concept here, for some sites running Google Ads.

Truth is, though — it’s bigger than Google. It could be used for funding websites, anywhere — including those that aren’t traditionally ad supported — such as Wikipedia, and even your auntie’s blog.

My spin on the concept? Use it to encourage quality content.

Reward stickiness. Rather than make it hit based, which encourages bad UX — make it into a time-spent based thing, instead.

Also, weight the payments by individual user rating — from 1/2 a star through to 5 star, so the users can reward perceived high quality sites and incentivize lower quality sites to improve.

There would need to be some significant buzz to get websites on board. Proposing HTML tags for Adverts (and opting out of them) might do it:

<advert optout=’adfree.com/authenticate’><img src=’./allthethings.jpg’></advert>

Get the browser to check to see if the user is authenticated for one of the current optout services (returns true or false). If so, remove the advert from the Dom, and send the optout service time spent info and the user’s current rating for the site on page exit.

And then, sites can choose to opt in to the no advert service, and serve ads for those they don’t support.

Alternatively — create a monolithic non-profit organization to run a single central optout service, staffed by volunteers from the major tech companies. The best single company to attempt this at the moment, imo, is probably Paypal, who already have the ability to debit money from bank balances and distribute that money to other Paypal accounts at (presumably) extremely low cost.

And once we’ve got adverts sorted — maybe we can do the same thing with subscription services, such as Netflix, Pandora et al. A pot of money shared between them all, based on their usage and rating.

 

Announcing: The Infectious Madness of Doctor Dekker

691937244_preview_dekkerprofilesteam5

Coding for the day job eats most of my time. But when I’m not doing that, I’m working on other things – for myself, and in collaboration with others.

That's what I do. I write and I code things.

That’s what I do. I write and I code things.

This one’s still in progress, and probably won’t be released until mid-next year, but I’m going to announce it early.

“The Infectious Madness of Doctor Dekker” is a Full Motion Video game with Lovecraftian themes. Think “Her Story” meets Cthulhu.

The game framework is being coded by me in Node.js and runs on Windows, OS/X and Linux. My brother and sister-in-law are working hard on producing the content.

It’s currently in Steam Greenlight concepts. Feel free to take a peek / vote / follow / fave.