Teaser 2333: [Continuous ledger]
From The Sunday Times, 10th June 2007 [link]
The firm I work for has kept a ledger since its foundation. One fresh page is used each day, and these pages have been numbered consecutively since the firm was founded. During a weekend last year I noticed that the page number was a perfect square. Then, during a weekend earlier this year, I noticed that the page number was a perfect cube. On another day earlier that month, I had noticed that the page number was a perfect fourth power.
When will the number next be palindromic?
This puzzle was originally published with no title.
There are now 1300 Teaser puzzles available on the site — which is 25 years worth of weekly puzzles. (And between S2T2 and Enigmatic Code there are 3866 puzzles available in total).
[teaser2333]
Jim Randell 9:44 am on 10 February 2026 Permalink |
You need to take into account the date the puzzle was originally published when solving this puzzle.
This Python program runs in 72ms. (Internal runtime is 1.12ms).
from datetime import (date, timedelta) from enigma import (powers, inf, first, le, repeat, inc, peek, irange, is_npalindrome, printf) # date of puzzle (all dates must be earlier than this) pub = date(2007, 6, 10) # consider numbers up to 200_000 (sqs, cbs, p4s) = (first(powers(1, inf, k), count=le(200000)) for k in [2, 3, 4]) # is a date a weekend (= Saturday (6) or Sunday (7)) is_weekend = lambda d: d.isoweekday() in {6, 7} # consider powers of 4 for p4 in p4s: # look for a higher cube, potentially within the same month for cb in reversed(cbs): if not (cb > p4): break if cb - p4 > 30: continue # consider possible dates for the cube in the current year (before publication) for dcb in repeat(inc(timedelta(days=-1)), pub): if dcb.year < pub.year: break # must be on a weekend if not is_weekend(dcb): continue # calculate date for the power of 4 dp4 = dcb - timedelta(days=cb - p4) # must be in the same month if not (dp4.month == dcb.month): continue # look for earlier perfect squares for sq in sqs: if not (sq < p4): break # calculate date for the square dsq = dp4 - timedelta(days=p4 - sq) y = dp4.year - dsq.year if not (0 < y < 2): continue # must be on a weekend if not is_weekend(dsq): continue # when is the next palindromic date (after cb) pl = peek(n for n in irange(cb + 1, inf) if is_npalindrome(n)) dpl = dp4 + timedelta(days=pl - p4) # calculate founding date df = dp4 - timedelta(days=p4 - 1) # output solution printf("p4 = D{p4} = {dp4}; cb = D{cb} = {dcb}; sq = D{sq} = {dsq}; pl = D{pl} = {dpl}; D1 = {df}")Solution: The next palindromic number will occur on 20th June 2007.
The square number is day 50176 (= 224^2) on 2006-01-07 (Saturday).
The perfect cube is day 50653 (= 37^3) on 2007-04-29 (Sunday).
The power of 4 is day 50625 (= 15^4) on 2007-04-01 (Sunday).
And the next palindromic number after 50653 is 50705 on 2007-06-20 (Wednesday), i.e. 10 days after the puzzle was published.
If the ledger has been in continual operation from the day of founding, then day 1 was 1868-08-23 (Sunday).
LikeLike