![]() I started with the constraint that a digit could only appear once, so in the range 0-99 there are 9 invalid sequences, 11, 22, 33 etc., leaving 91 valid 'names of God'. ![]() Not being very knowledgable about math, I thought I'd write a program iterate over ranges and count all the elements that match the above condition, then put the results in a spreadsheet to see if a clear pattern of some kind emerged that would let me write an algorithm to determine the number of valid sequences in a given range. I started with digits repeating in base 10 numbers, at heart it's the same problem as letters repeating in an alphabet. Out of curiosity, I started playing around with determining how many valid sequences there are in a range. In Arthur C Clarke's story "The 9 Billion Names of God" the names of God are all possible sequences in an unspecified alphabet, having no more than nine characters, where no letter occurs more than three times in succession. ![]() I've done the first dozen or so Euler problems and intend to continue with that when I have time. My maths isn't great (I can't read notation) but I'm a competent programmer and reasonable problem solver. TLDR I go on a math adventure and get overwhelmed :) ![]()
0 Comments
Leave a Reply. |