Happy CPFC Day!
Share Your Prime Factor Counts With Friends, Family And Fame
Share Your Prime Factor Counts With Friends, Family And Fame
Many of us spend quite a few days in isolation and involuntarily reduce the amount of things to celebrate except for the occasional public holiday. Soon Valentine’s Day is up which is a good opportunity in itself but it may be fun to invent mathematical ways to create other opportunities for celebration to connect people.
All you need for this little diversion is the birthdays of the people of interest.
My first idea was to get the calendar dates where we all in the family have lived an individual number of prime days at a given date. But as you immediately can see there is a fifty fifty chance that you have no such days in common with any given person when the difference in days between you is odd, so that turns out to be dull for larger groups and we want to avoid further gloom.
Instead we can look for calendar dates where we share the same count of prime factors that multiply to give the number of days we have been on earth or part of common human history. To make it a little more fancy you can also take this common count to signify the number of courses you will have for dinner that day (which makes common prime numbers days even less interesting).
Let’s call these the common prime factor count days or short “CPFC” days. So for example if you are born on the first of January 2000 your CPFC for today would be:
All you need for this little diversion is the birthdays of the people of interest.
My first idea was to get the calendar dates where we all in the family have lived an individual number of prime days at a given date. But as you immediately can see there is a fifty fifty chance that you have no such days in common with any given person when the difference in days between you is odd, so that turns out to be dull for larger groups and we want to avoid further gloom.
Instead we can look for calendar dates where we share the same count of prime factors that multiply to give the number of days we have been on earth or part of common human history. To make it a little more fancy you can also take this common count to signify the number of courses you will have for dinner that day (which makes common prime numbers days even less interesting).
Let’s call these the common prime factor count days or short “CPFC” days. So for example if you are born on the first of January 2000 your CPFC for today would be:
In[]:=
Total[FactorInteger[QuantityMagnitude[DateDifference[DateObject[{2000,1,1}],Today,"Day"]]][[;;,2]]]
Out[]=
3
It is a pleasure with how little code of Mathematica you can do these things altough nesting provides some headaches of its own. Do the following example with birthdays of people close to you to find your CPFC days.
For privacy however here let us take a bunch of the people who have worked hard to make math and computation fun for the rest of us:
For privacy however here let us take a bunch of the people who have worked hard to make math and computation fun for the rest of us:
In[]:=
people=Entity["Person",StringReplace[#," """]]&/@{"John Von Neumann","Kurt Godel","Alan Turing","Stephen Wolfram","Benoit Mandelbrot","Mitchell Jay Feigenbaum"}
Out[]=
,,,,,
In[]:=
#["BirthDate"]&/@people
Out[]=
,,,,,
So now bring their birthdays in order from youngest to oldest
In[]:=
bDates=Reverse[Sort[%]]
Out[]=
,,,,,
In[]:=
lM=Length[bDates]
Out[]=
6
For bookkeeping make a list of their mutual differences in days between birthdays.
In[]:=
addDays=QuantityMagnitude[DateDifference[#[[1]],#[[2]],"Day"]]&/@Flatten[Table[{bDates[[j]],bDates[[i]]},{i,lM-1},{j,i+1,lM}],1]
Out[]=
{5366,12700,17233,19481,20333,7334,11867,14115,14967,4533,6781,7633,2248,3100,852}
Let’s decide which interval of days we are interested to find CPFC days, say for the next 5 years.
In[]:=
startDay=QuantityMagnitude[DateDifference[bDates[[1]],Today,"Day"]]
Out[]=
22442
In[]:=
endDay=startDay+QuantityMagnitude[Quantity[5,"Years"],"Days"]
Out[]=
24267
Find The CPFC Days Together With the Prime Factor Count
Find The CPFC Days Together With the Prime Factor Count
In[]:=
offset=Join[{0},addDays[[1;;lM-1]]]
Out[]=
{0,5366,12700,17233,19481,20333}
In[]:=
fList=Table[Total@FactorInteger[#][[;;,2]]&/@(Range[startDay,endDay]+offset[[i]]),{i,lM}];
In[]:=
fListwDays=Transpose@Append[fList,Range[startDay,endDay]];
In[]:=
commonPFCD=Select[fListwDays,And[Thread[Table[#[[1]],lM-1]==#[[2;;lM]]]]&]
Out[]=
{{2,2,2,2,2,2,22641},{3,3,3,3,3,3,23685}}
In[]:=
Select[{#[[1]],DatePlus[bDates[[1]],#[[2]]]}&/@commonPFCD[[;;,lM;;lM+1]],(Today<#[[2]])&&(#[[2]]<DateObject[{2150,1,1}])&]
Out[]=
2,,3,
For this bunch the upcoming CPFC days are rather rare, so either you want to form a group closer in age or with fewer members. Which brings us to wonder what is the probability of finding CPFC days of certain multiplicity as a function function of the difference of days between members and for a given day in the future. I am sure we can figure out the asymptotic formulas for this. Game on!