Thursday, 26 January 2023

Turning Dates Into Numbers

26th January 2023 --> 20230126

There are a variety of ways in which a unique date could be converted into a unique number but perhaps the most logical is the concatenation of year, month and day to generate the number. For example, today's date is 26th January 2023 and thus the concatenation of 2023, 01 and 26 produces 20230126. The leading zero is important or else ambiguity occurs with certain dates. For example, 11th January 2023 produces 2023111 but the 1st November 2023 will also produce 2023111. For this reason, the format YYYYMMDD with leading zeros included must be followed.

Follow this link for SageMath code to generate the output below.

The numbers increase by 1 with each passing day and every number is unique and can thus be examined for whatever properties are of interest. Each year will produce 365 numbers or 366 numbers when there is a leap year. Let's look at the numbers that are produced for the year 2023:

20230101, 20230102, 20230103, 20230104, 20230105, 20230106, 20230107, 20230108, 20230109, 20230110, 20230111, 20230112, 20230113, 20230114, 20230115, 20230116, 20230117, 20230118, 20230119, 20230120, 20230121, 20230122, 20230123, 20230124, 20230125, 20230126, 20230127, 20230128, 20230129, 20230130, 20230131, 20230201, 20230202, 20230203, 20230204, 20230205, 20230206, 20230207, 20230208, 20230209, 20230210, 20230211, 20230212, 20230213, 20230214, 20230215, 20230216, 20230217, 20230218, 20230219, 20230220, 20230221, 20230222, 20230223, 20230224, 20230225, 20230226, 20230227, 20230228, 20230301, 20230302, 20230303, 20230304, 20230305, 20230306, 20230307, 20230308, 20230309, 20230310, 20230311, 20230312, 20230313, 20230314, 20230315, 20230316, 20230317, 20230318, 20230319, 20230320, 20230321, 20230322, 20230323, 20230324, 20230325, 20230326, 20230327, 20230328, 20230329, 20230330, 20230331, 20230401, 20230402, 20230403, 20230404, 20230405, 20230406, 20230407, 20230408, 20230409, 20230410, 20230411, 20230412, 20230413, 20230414, 20230415, 20230416, 20230417, 20230418, 20230419, 20230420, 20230421, 20230422, 20230423, 20230424, 20230425, 20230426, 20230427, 20230428, 20230429, 20230430, 20230501, 20230502, 20230503, 20230504, 20230505, 20230506, 20230507, 20230508, 20230509, 20230510, 20230511, 20230512, 20230513, 20230514, 20230515, 20230516, 20230517, 20230518, 20230519, 20230520, 20230521, 20230522, 20230523, 20230524, 20230525, 20230526, 20230527, 20230528, 20230529, 20230530, 20230531, 20230601, 20230602, 20230603, 20230604, 20230605, 20230606, 20230607, 20230608, 20230609, 20230610, 20230611, 20230612, 20230613, 20230614, 20230615, 20230616, 20230617, 20230618, 20230619, 20230620, 20230621, 20230622, 20230623, 20230624, 20230625, 20230626, 20230627, 20230628, 20230629, 20230630, 20230701, 20230702, 20230703, 20230704, 20230705, 20230706, 20230707, 20230708, 20230709, 20230710, 20230711, 20230712, 20230713, 20230714, 20230715, 20230716, 20230717, 20230718, 20230719, 20230720, 20230721, 20230722, 20230723, 20230724, 20230725, 20230726, 20230727, 20230728, 20230729, 20230730, 20230731, 20230801, 20230802, 20230803, 20230804, 20230805, 20230806, 20230807, 20230808, 20230809, 20230810, 20230811, 20230812, 20230813, 20230814, 20230815, 20230816, 20230817, 20230818, 20230819, 20230820, 20230821, 20230822, 20230823, 20230824, 20230825, 20230826, 20230827, 20230828, 20230829, 20230830, 20230831, 20230901, 20230902, 20230903, 20230904, 20230905, 20230906, 20230907, 20230908, 20230909, 20230910, 20230911, 20230912, 20230913, 20230914, 20230915, 20230916, 20230917, 20230918, 20230919, 20230920, 20230921, 20230922, 20230923, 20230924, 20230925, 20230926, 20230927, 20230928, 20230929, 20230930, 20231001, 20231002, 20231003, 20231004, 20231005, 20231006, 20231007, 20231008, 20231009, 20231010, 20231011, 20231012, 20231013, 20231014, 20231015, 20231016, 20231017, 20231018, 20231019, 20231020, 20231021, 20231022, 20231023, 20231024, 20231025, 20231026, 20231027, 20231028, 20231029, 20231030, 20231031, 20231101, 20231102, 20231103, 20231104, 20231105, 20231106, 20231107, 20231108, 20231109, 20231110, 20231111, 20231112, 20231113, 20231114, 20231115, 20231116, 20231117, 20231118, 20231119, 20231120, 20231121, 20231122, 20231123, 20231124, 20231125, 20231126, 20231127, 20231128, 20231129, 20231130, 20231201, 20231202, 20231203, 20231204, 20231205, 20231206, 20231207, 20231208, 20231209, 20231210, 20231211, 20231212, 20231213, 20231214, 20231215, 20231216, 20231217, 20231218, 20231219, 20231220, 20231221, 20231222, 20231223, 20231224, 20231225, 20231226, 20231227, 20231228, 20231229, 20231230, 20231231

A question could be asked such as how many of these numbers are prime? Well, as it turns out, only 18 and these are:

20230103, 20230109, 20230121, 20230201, 20230219, 20230303, 20230411, 20230517, 20230519, 20230619, 20230621, 20230831, 20230919, 20231011, 20231017, 20231023, 20231129, 20231203

It's easy enough to write an algorithm (permalink) to return these numbers to their equivalent dates.

03 - 01 - 2023

09 - 01 - 2023

21 - 01 - 2023

01 - 02 - 2023

19 - 02 - 2023

03 - 03 - 2023

11 - 04 - 2023

17 - 05 - 2023

19 - 05 - 2023

19 - 06 - 2023

21 - 06 - 2023

31 - 08 - 2023

19 - 09 - 2023

11 - 10 - 2023

17 - 10 - 2023

23 - 10 - 2023

29 - 11 - 2023

03 - 12 - 2023

My habit is to investigate the number associated with my diurnal age, meaning the number of days that have elapsed since I was born, counting the day I was born as day zero. These numbers have a personal significance and are only shared by individuals born on the same date as myself, namely 3rd April 1949. A more impersonal investigation could be carried out using the numbers associated with the daily date. The only drawback is that these eight digit numbers often turn up nothing in the OEIS or Online Encyclopedia of Integer Sequences. For example, today's number of 20230126 turns up nothing. See Figure 1.


Figure 1

The OEIS is my major source of information about numbers and their properties so this is unfortunate. Numbers Aplenty, my next most popular source of information, does generate some output. See Figure 2.


Figure 2

These numbers offer an opportunity to investigate larger numbers because my diurnal age is limited to five digit numbers (I am 26961 days old). Take today's number of 20231026. This number has four distinct prime factors (2, 7, 97 and 14897) and so the question could be asked: how many dates in 2023 produce numbers that have four distinct prime factors? The answer is 52 and these are:

20230105, 20230114, 20230122, 20230126, 20230206, 20230215, 20230221, 20230223, 20230226, 20230302, 20230305, 20230306, 20230315, 20230322, 20230323, 20230330, 20230401, 20230406, 20230410, 20230413, 20230414, 20230419, 20230422, 20230503, 20230507, 20230509, 20230602, 20230606, 20230611, 20230706, 20230710, 20230719, 20230727, 20230730, 20230806, 20230815, 20230914, 20230917, 20230922, 20231003, 20231007, 20231029, 20231030, 20231102, 20231105, 20231106, 20231110, 20231115, 20231130, 20231214, 20231222, 20231230

Overall it can be said that in 2023 there are:

  • 18 primes
  • 66 semiprimes with distinct prime factors
  • 82 sphenic numbers
  • 51 numbers with four distinct prime factors
  • 11 numbers with five distinct prime factors
  • 1 number with seven distinct prime factors (20230210 → 10-02-2023)

Thus it can be seen that the 10th February 2023 produces the only number that has seven distinct prime factors. 

20230210 = 2 x 5 x 7 x 11 x 13 x 43 x 47

It can also be noted that no palindromic number is possible this year. Here are the numbers that are palindromic between 2000 up to 2090 (I hope it's complete):

  • 20011002
  • 20100102
  • 20111102
  • 20211202
  • 20300302
  • 20400402
  • 20500502
  • 20600602
  • 20700702
  • 20800802
  • 20900902

This year the smallest number, 20230101, and the largest, 20231231, have a difference of 1130 but only 365 numbers in this range are possible in terms of dates.

So we'll see what comes of this. It's another mathematical toy to play around with. See my post The Julian Day Number on the 16th February 2023 for information that relates to this problem of numbering the days of each year.

No comments:

Post a Comment