Source: Day 2: Gift Shop
Full solution for today (spoilers!).
Part 1
Given a list of ranges
a-b(ie11-22), sum all values that are made of two repeated chunks of digits (ie123123)
Full solution for today (spoilers!).
Given a list of ranges
a-b(ie11-22), sum all values that are made of two repeated chunks of digits (ie123123)
Mathematicians are an odd bunch. Names for just about everyhing. There are amicable numbers and perfect number, sociable number and betrothed numbers. There are sublime number, frugal number, and quasiperfect number. Heck, there are powerful number, smooth number, and even sphenic numbers. Rather a lot to deal with all told… So let’s just focus on two of them: perfect numbers and amicable numbers.
There was a new post on Programming Praxis a few days ago that seemed pretty neat:
Given a positive integer n, compute the prime factorization, including multiplicities, of n! = 1 · 2 · … · n. You should be able to handle very large n, which means that you should not compute the factorial before computing the factors, as the intermediate result will be extremely large.