[Question]
  [
(Inspired by [last week's Riddler](https://fivethirtyeight.com/features/when-will-the-arithmetic-anarchists-attack/) on FiveThirtyEight.com. [Sandbox post](https://codegolf.meta.stackexchange.com/a/16158/70172).)
Given a year between 2001 and 2099, calculate and return the number of days during that calendar year where `mm * dd = yy` (where `yy` is the **2-digit** year).
2018, for example, has 5:
* January 18th (1 \* 18 = 18)
* February 9th (2 \* 9 = 18)
* March 6th (3 \* 6 = 18)
* June 3rd (6 \* 3 = 18)
* September 2nd (9 \* 2 = 18)
Input can be a 2 or 4-digit numeric year.
Output should be an integer. Optional trailing space or return is fine.
# Complete input/output list:
```
Input = Output
 2001 = 1     2021 = 3     2041 = 0     2061 = 0     2081 = 2
 2002 = 2     2022 = 3     2042 = 4     2062 = 0     2082 = 0
 2003 = 2     2023 = 1     2043 = 0     2063 = 3     2083 = 0
 2004 = 3     2024 = 7     2044 = 3     2064 = 2     2084 = 5
 2005 = 2     2025 = 2     2045 = 3     2065 = 1     2085 = 1
 2006 = 4     2026 = 2     2046 = 1     2066 = 3     2086 = 0
 2007 = 2     2027 = 3     2047 = 0     2067 = 0     2087 = 1
 2008 = 4     2028 = 4     2048 = 6     2068 = 1     2088 = 3
 2009 = 3     2029 = 1     2049 = 1     2069 = 1     2089 = 0
 2010 = 4     2030 = 6     2050 = 3     2070 = 3     2090 = 5
 2011 = 2     2031 = 1     2051 = 1     2071 = 0     2091 = 1
 2012 = 6     2032 = 3     2052 = 2     2072 = 6     2092 = 1
 2013 = 1     2033 = 2     2053 = 0     2073 = 0     2093 = 1
 2014 = 3     2034 = 1     2054 = 4     2074 = 0     2094 = 0
 2015 = 3     2035 = 2     2055 = 2     2075 = 2     2095 = 1
 2016 = 4     2036 = 6     2056 = 4     2076 = 1     2096 = 4
 2017 = 1     2037 = 0     2057 = 1     2077 = 2     2097 = 0
 2018 = 5     2038 = 1     2058 = 0     2078 = 2     2098 = 1
 2019 = 1     2039 = 1     2059 = 0     2079 = 0     2099 = 2
 2020 = 5     2040 = 5     2060 = 6     2080 = 4
```
This is a [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'") challenge, lowest byte count in each language wins.
Pre-calculating and simply looking up the answers is [normally excluded per our loophole rules](https://codegolf.meta.stackexchange.com/questions/1061/loopholes-that-are-forbidden-by-default/1063#1063), but I'm explicitly allowing it for this challenge. It allows for some interesting alternate strategies, although its not likely a ~~98~~ 99-item lookup list is going to be shortest.
  
[Answer]
# Excel, 48 bytes
Hooray! Finally something Excel is actually good at. 
```
=COUNT(VALUE(ROW(1:12)&"/"&A1/ROW(1:12)&"/"&A1))
```
Takes input from A1 in the form of an integer 1-99 representing the year, and outputs to wherever you enter this formula. It's an array formula, so use Ctrl-Shift-Enter instead of Enter to enter it. 
This takes advantage of the fact that `COUNT` ignores errors, so any errors that are caused by either the month not dividing the year (leading Excel to parse something like `2/12.5/25` or by the date not being valid, like `2/29/58`, are just silently ignored.
[Answer]
# [Python 2](https://docs.python.org/2/), 44 bytes
```
[k/32%13*(k%32)for k in range(96,509)].count
```
[Try it online!](https://tio.run/##LZPLboMwEEX3/QpvIkGFWvweL/gSmkVUJS1JRCKaLvL1FHfO6mrs4XDv2L4/H9@32a2n4WMdL@/e7ax/bS4779rTbTEXM81mOcxfx6akLval3b993n7nx/o8HpYfM5hxtJ2x@250nXGbeJXQGb9J1Cp1JmyStRKtirbYXktrddduoFTVK9eCshEFZjP7Gy5WLfjotXZW@51D4bmNl6vizSU004c9B8/36seT08PzJPWBdXg@0b/x@qrCPryAv2B1Pzj9X/DU5A3kDYnv4AVRfoAXe0aNv8hBRHgxKD/iLzK/yPyi0FdUE3kT/pJDvf4nBc406vcpsY6/RN6Ev4y/DC9zvhl/OaD4y@TN3JYsKP6E@yLcF8GfwJOg8xX8SWKdvCLqR@AVzqMwv@JQ7kvBX4FXmF8hbyFvKdXP/uXlvkzzozlcr82pmVozDOZs6luaunN9Tf8Pp23XPw "Python 2 – Try It Online")
An anonymous function given as a method object. Produces all products of `(month, day)` pairs `(m, d)` as encoded by `k=32*m+d` with `0≤m≤12`, `0≤d≤31`, wrapping around. Eliminates Feb 29-31 by excluding them from the range.
[Answer]
# [Java (JDK 10)](http://jdk.java.net/), 65 bytes
```
y->{int m=13,c=0;for(;m-->1;)if(y%m<1&y/m<29+m%2*3)c++;return c;}
```
[Try it online!](https://tio.run/##dZJfb5swFMXf8ymukJigOMyGJlPq0Gnq0zRteej2VPXBI1A5wwbZppIV5bNntmGTpjLQ5d89/I51j0/sla1Px19XLoZeGTi593w0vMtv6OrNt3aUteG9XGxqoxomfKvumNbwlXEJ5xXAMP7seA3aMONurz0/gnC95NEoLl@enoGpF50GKcBnaX5IpuxhaBQzvYIWqqtd35@5NCAqUqK6wrTtVULFen1PaMrbxMZiT97Z92Jf7DIRFzdlWmcZVY0ZlYSaXq40wB3D2T1ABWeMCCrcWbq6DVW6Cqp/jgJtnbIMXYI2od6qfJ@gDzPRK7cLKhLcvO8Wef9lFnb/YzQR8ey@xCoQnlfudXjREQdSERiTY7mo2gZCMc8E/2cSXrMJbhNvs7guMitu0TTjyzR7H5nP0FaE2n2121GbZX9SD9GAavTYGZdOm7Nh6Own7XZDYlM6ax6tNo3I@9Hkg9s6pk2iuDjegbtAEus0lhECi2YO@sur4OHJPsNHiA5fIriD6NvhO7jHGXxZ@bpcfwM "Java (JDK 10) – Try It Online")
# Credits
* 8 bytes saved thanks to [l4m2](https://codegolf.stackexchange.com/users/76323/l4m2).
* 4 bytes saved thanks to [Asone Tuhid](https://codegolf.stackexchange.com/users/77598/asone-tuhid) on their [Ruby answer](https://codegolf.stackexchange.com/a/162163/16236).
[Answer]
# [PowerShell](https://github.com/TryItOnline/TioSetup/wiki/Powershell), 94 bytes
```
param($a)for($x=Date 1/1/$a;$x-le(Date 12/9/$a);$x=$x.AddDays(1)){$z+=$x.Month*$x.Day-eq$a};$z
```
[Try it online!](https://tio.run/##JcmxDkAwEIDhVzHc0BKaikXEILF6iEucGEopiSKe/VRsf75/sQe5bSRjmBd0OAlAOVgnwNct7hRppRVgBT41JH7JVRlIBqvBZ03ft3huQkt5w5V81Nl5H@MQYaS0Aj4VXMycFy8 "PowerShell – Try It Online")
Takes input as a two-digit year, then constructs a `for` loop from `1/1/year` to `12/9/year` (because 12/10 and beyond will never count and this saves a byte). Each iteration, we increment `$z` iff the `.Month` times the `.Day` is equal to our input year. Outside the loop, `$z` is left on the pipeline and output is implicit.
*Edit - this is culture dependent. The above code works for `en-us`. The date format may need to change for other cultures.*
[Answer]
# [Ruby](https://www.ruby-lang.org/), ~~46~~ 42 bytes
```
->y{(1..12).count{|j|y%j<1&&y/j<29+j%2*3}}
```
[Try it online!](https://tio.run/##LZPLTsMwEEX3/QpvWvEIIX6PpQY@JOqiICo1qgAVuoiafntImLO6GntyfO/YOV/ehunQTk8vw/XO1rV19/X71@Xz9zr247Dut3azGZ77rSuP/do9@NttGj725x/Tmq6zlbG7qnOVcbN4lVAZP0vUKlUmzJK1Eq2KtthGS2t1186gtKhXrgVlIwrMZvZnXFy04KPR2lntdw6F52ZeXhRvLqGZPuw5eL5RP56cHp4nqQ@sw/OJ/pnXLCrswwv4C1b3g9PzgqcmbyBvSHwHL4jyA7zYMGr8RS4iwotB@RF/kflF5heFvqKayJvwlxzq9ZwUuNOo36fEOv4SeRP@Mv4yvMz9ZvzlgOIvkzfzWrKg@BPei/BeBH8CT4LOV/AniXXyiqgfgVe4j8L8ikN5LwV/BV5hfoW8hbylLH52q9W3@f836v3p9Gqu47HqR3PojjvTtqa/TX8 "Ruby – Try It Online")
[Answer]
# [JavaScript (Node.js)](https://nodejs.org), ~~48~~ ~~44~~ 43 bytes
```
F=(x,h)=>h>12?0:F(x,-~h)+(x/h<3*h%6+28>x%h)
```
[Try it online!](https://tio.run/##DcxBDoIwEADAr3Ah2XWh1poYQVvjhU8YIw0SV4KUFGPqxa/XHucyg/3YpfPP@V1O7t7H2GgIBaM2bDbqJOsmsfwxEoQ1H7crznek9ibkjPHQuWlxYy9G94CLEOLsvf1CVeFVvOwMcCtCmoAokJJSIrWZzlpKJyLGPw "JavaScript (Node.js) – Try It Online")
# [JavaScript (Node.js)](https://nodejs.org), ~~59~~ 58 bytes
```
x=>[a=0,...'030101001010'].map((k,m)=>x%m|x/m>31-k||a++)|a
```
[Try it online!](https://tio.run/##LYzRCoIwFEB/xZdwl6vrmk8iG/TiT0jkxSRK52RGLNi/rxFx4Lyd8@Q376N7bK9ytbcpdip6pXtWVEgpc6qpSvyUX6ThTYi5MKC0P5jgj0bXVTmHwIgQOLajXXe7THKxd9Gnwdk5/oimgX97LXxqBaLHExEBDpnKBuyEB4D4BQ "JavaScript (Node.js) – Try It Online")
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 15 bytes
```
31x12_2¦3RĖP€Fċ
```
[Try it online!](https://tio.run/##y0rNyan8/9/YsMLQKN7o0DLjoCPTAh41rXE70v0/5VHj1kcNc4wMgISCncKjhrlZ1ofbuQwNDB7u2Ha4Hagq8j8A "Jelly – Try It Online")
Take a number in range `[0,100[` as input.
[Answer]
# JavaScript (ES6), 91 bytes
I was curious to know how hardcoding would compare to an iterative computation. It's definitely longer (see [@Shaggy's answer](https://codegolf.stackexchange.com/a/162141/58563)), but not *awfully* longer.
*Edit*: It is, however, much longer than a more direct formula (see [@l4m2 answer](https://codegolf.stackexchange.com/a/162155/58563)).
Takes input as an integer in **[1..99]**.
```
n=>(k=parseInt('8ijkskercdtbnqcejh6954r1eb2kc06oa3936gh2k0d83d984h'[n>>1],36),n&1?k>>3:k&7)
```
[Try it online!](https://tio.run/##Dca7DoIwFADQna@4E7QBTEsRQaTOfoNxgFJeJbdYiIvx25Hl5Ez1p16VG5ctRtvqvat2rCQx1VK7VT9wI0E@TmY12ql2a/Ct9DRkxTl1XDeJUSyztShE1g@JYW0u2iJPh@CJUvJXJDIaoc/vRkpxNf6F7p11BKECXgLCDThjR8KQwtcDUBZXO@vTbHtCEsYYhID0IIA4lochdAQpLb3f/gc "JavaScript (Node.js) – Try It Online")
### How?
Odd years have significantly less chance of having **mm \* dd = yy** than even years. More concretely, odd years have **0** to **3** matches, while even years have **0** to **7** matches. This allows us to code each pair of years with just 5 bits, which can conveniently be represented as a single character in base 36.
[Answer]
# [Perl 6](https://github.com/nxadm/rakudo-pkg), 40 bytes
```
{+grep {$_%%$^m&&29+$m%2*3>$_/$m},1..12}
```
[Try it online!](https://tio.run/##PYzBDoIwDIbvPsUOg6A02G6A4aCPIiEGvbhkwRMhPPvsummWf23/fn/9vLz74FZVPtU1bPVrmb3a9FgU@u7K0gy1doU52Zsez9rtQE1DZg@faVWVmzzHQLE3DEf1cP5QERh@ltWKrNQeiLvYE3SiOBFcMh39xBgg4ZFr5JB3mGnMTCQw348uCo85bXPW/v1085eJTie5xHRCp7mV3xzDFw "Perl 6 – Try It Online")
[Answer]
# [Python 2](https://docs.python.org/2/) and [3](https://docs.python.org/3/), ~~55~~ 52 bytes
```
lambda y:sum(y%i<(y/i<29+i%2*3)for i in range(1,13))
```
[Try it online!](https://tio.run/##LZPLbsIwEEX3fIU3SEkbqfHbrsiXUBapCiUIAgp0ka@nDnNWV2NPTu4d27f5cbyO5nnovp7n/vL906v58/53qeb1sKnmj2Fj8vuwNm@2PlwnNahhVFM//u4r3Whb189530931antVjdK75qtaZQpYkVco2wRL1VolCsSpUpSZWnRrZRay64uoLCoFa4GpT0KTEf2C84vmvHRSm209BuDwjOFFxfFmwlopA97Bp5txY8lp4VnSWod6/BsoL/w2kUT@/Ac/pyWfWfkf85Sk9eR1wW@g@eS8B083zJq/HkOwsPzTvgef575eebnE31ZNJA34C8Y1Mp/guNMvXwfAuv4C@QN@Iv4i/Ai5xvxFx2Kv0jeyG2JCcVf4r4k7kvCX4KXnMw34S8F1smbkvhJ8DLnkZlfNij3JeMvw8vML5M3kzfnxc9utbpNw/io@vO5OlRDrbpOndTrDTWn5RW9Hk55QP8 "Python 2 – Try It Online")
[Answer]
# [Bash + GNU utilities](https://www.gnu.org/software/bash/), 57
* 1 byte saved thanks to @SophiaLechner
```
seq -f1/1/$1+%gday 0 365|date -f- +%m*%d-%y|bc|grep -c ^0
```
Note that the `seq` command always produces a list of 366 dates - for non-leap years January 1st of the next year will be included. However in the date range 2001..2099, MM\*DD will never be YY for January 1st of the next year for any of these years, so this extra day won't affect the result.
[Try it online!](https://tio.run/##JcpBDoIwFEXROat4IXQi@dBiNCEmLsWk0F9kIMW2k8a69qpxeHPupMO9WOeRWHusG16DlKrrBjmO7wuMq3a/btGiFgF0RY3md1aBI4j@UQI/QVb1qm9UKxajEySO51M2OvJXCK14HIQhkfI058XzDppxk8W4jcsH "Bash – Try It Online")
[Answer]
# T-SQL, ~~123~~ 121 bytes
[Per our IO rules](https://codegolf.meta.stackexchange.com/questions/2447/default-for-code-golf-input-output-methods/5341#5341), input is taken via pre-existing table **t** with an integer field **y**, which contains a 2-digit year.
```
WITH c AS(SELECT 1m UNION ALL SELECT m+1FROM c WHERE m<12)
SELECT SUM(ISDATE(CONCAT(m,'/',y/m,'/',y)))FROM c,t WHERE y%m=0
```
Line break is for readability only. Inspired largely by [Sophia's Excel solution](https://codegolf.stackexchange.com/a/162180/70172).
* The top line generates a 12-item number table **c** which is joined to the input table **t**.
* If that passes I mash together a date candidate using `CONCAT()`, which does implicit `varchar` datatype conversions. Otherwise I'd have to do a bunch of `CAST` or `CONVERT` statements.
* Found the perfect evaluation function `ISDATE()`, which returns 1 for valid dates and 0 for invalid dates.
* Wrap it in a SUM and I'm done.
* **EDIT**: Moved the integer division check (`y%m=0`) into the `WHERE` clause to save 2 bytes, thanks @RazvanSocol.
Unfortunately, it's not much shorter than the lookup table version (using the string from [osdavison's version](https://codegolf.stackexchange.com/a/162189/70172)):
# T-SQL lookup, 129 bytes
```
SELECT SUBSTRING('122324243426133415153317223416132126011504033106131204241006003213011306002122042005101305111014012',y,1)FROM t
```
**EDIT**: Leaving my original above, but we can save a few bytes by using a couple of new functions:
* `STRING_SPLIT` is available in MS SQL 2016 and above.
* `CONCAT_WS` is available in MS SQL 2017 and above.
* As above, replaced `IIF` with `WHERE`
# MS-SQL 2017, ~~121~~ 118 bytes
```
SELECT SUM(ISDATE(CONCAT_WS('/',value,y/value,y)))
FROM t,STRING_SPLIT('1-2-3-4-5-6-7-8-9-10-11-12','-')
WHERE y%value=0
```
# MS-SQL 2017, extra cheaty edition: 109 bytes
```
SELECT SUM(ISDATE(CONCAT_WS('/',number,y/number,y)))
FROM t,spt_values WHERE number>0AND y%number=0AND'P'=TYPE
```
Requires you to be in the `master` database, which contains a system table `spt_values` that (when filtered by `TYPE='P'`), gives you counting numbers from 0 to 2048. 
[Answer]
# [Julia 0.6](http://julialang.org/), 49 44 42 bytes
```
y->sum(y/i∈1:28+3(i%2⊻i÷8)for i=1:12)
```
[Try it online!](https://tio.run/##LZNNTsMwEIX3PYU3SIkIIv4fVwoXqbrogkquSkEpXfQGFRdiwZKb9CIhYb7V09iTz@@NncPlWHdp2g/T9enlfHlrrs/1frvZtZNH39QHd//6qb/f0u7fR1MHu7auna6vu/FsBrPZ2M7YbbdxnXGzeJXQGT9L1Cp1JsyStRKtirbYXktrddfOoLSoV64FZSMKzGb2Z1xctOCj19pZ7XcOhedmXl4Uby6hmT7sOXi@Vz@enB6eJ6kPrMPzif6Z1y8q7MML@AtW94PT84KnJm8gb0h8By@I8gO82DNq/EUuIsKLQfkRf5H5ReYXhb6imsib8Jcc6vWcFLjTqN@nxDr@EnkT/jL@MrzM/Wb85YDiL5M381qyoPgT3ovwXgR/Ak@CzlfwJ4l18oqoH4FXuI/C/IpDeS8FfwVeYX6FvIW8pSx@tqvVx1hPn83ueGz2TW3NMJiDWf6cpnaH1tST@f91WtOupj8 "Julia 0.6 – Try It Online")
*-5 bytes inspired by Asone Tuhid's Ruby answer.*  
*-2 bytes replacing count with sum*
### Explanation:
For each month `i` from 1 to 12, calculate `y/i`, and check if it's one of that month's days. Months with 31 days are 1, 3, 5, 7, 8, 10, 12 - so they're odd below 8 and even at and above 8. So either `i%2` or `i÷8` (which is 0 for i<8 and 1 for i>=8 here) should be 1, but not both - so we XOR them. If the xor result is true, we check dates `1:28+3` i.e. `1:31`, otherwise we check just dates `1:28`. 
`1:28` is sufficient for the rest of the months (this improvement inspired by [Asone Tuhid's Ruby answer](https://codegolf.stackexchange.com/a/162163/8774)) because: 
* for February, the only possibility would have been `2*29 = 58`, but `2058` is not a leap year, so we can assume Feb always has 28 days.
* the other months with 30 days are month 4 and above - for which `i*29` (and `i*30`) would be above 100, which can be ignored.
Finally, we count out the number of times `y/i` belongs in this list of days (by using boolean `sum` here), and return that. 
[Answer]
# JavaScript, ~~91~~ ~~85~~ ~~82~~ ~~81~~ 77 bytes
Takes input as a 2-digit string (or a 1 or 2 digit integer).
Takes advantage of the fact that `new Date` will rollover to the next month, and continue doing so, if you pass it a day value that exceeds the number of days in the month you pass to it so, on the first iteration, it tries to construct the date `yyyy-01-345` which becomes `yyyy-12-11`, or `yyyy-12-10` on leap years. We don't need to check dates after that as `12*11+` results in a 3-digit number.
```
y=>(g=d=>d&&([,M,D]=new Date(y,0,d).toJSON().split(/\D/),D*M==y)+g(--d))(345)
```
3 bytes saved thanks to [Arnauld](https://codegolf.stackexchange.com/users/58563/arnauld).
---
## Test It
```
f=
y=>(g=d=>d&&([,M,D]=new Date(y,0,d).toJSON().split(/\D/),D*M==y)+g(--d))(345)
o.innerText=[...Array(99)].map((_,x)=>(2001+x++)+` = `+f(x)).join`\n`
```
```
pre{column-count:5;width:480px;}
```
```
<pre id=o></pre>
```
[Answer]
# [Python 2](https://docs.python.org/2/), ~~89~~ ~~84~~ ~~68~~ 58 bytes
```
f=lambda y,d=62:d-59and((d/31+1)*(d%31+1)==y)+f(y,-~d%372)
```
[Try it online!](https://tio.run/##Hc09DsMgDAXgvafwUgUaUIH80ESid6GyUCM1JIqysPTq1O7y6T0Pz3s531t2tabwiesLIxSFYXQz6mGKGYXAe2dbK28Cr/8QQpFtEkXpL128kzVtBxRYMjhjrCJ6wj4Ix6nzRM91YDzXaWT8fAHYjyWf9BWaZ6OAhkHzkJH1Bw "Python 2 – Try It Online")
[Answer]
# Excel, 83 bytes
```
{=SUM(IF(MONTH(DATE(A1,1,0)+ROW(1:366))*DAY(DATE(A1,1,0)+ROW(1:366))=A1-2000,1,0))}
```
Input is in cell `A1` in the format `yyyy`. This is an array formula and is entered with `Ctrl`+`Shift`+`Enter` to get the curly brackets `{}`. It is fairly straightforward and without any cleverness.
When in an array formula, `DATE(A1,1,0)+ROW(1:366)` gives us an array of 366 date values. On non-leap years, this will include Jan 1 of the next year but that is not a problem because `1*1=1` and would only count as a false positive if the next year is `2001` but, since the required year range is `2001 - 2099`, it will never arise as an issue.
If you shorted that bit into simply `~`, the formula because much easier to follow:
```
{=SUM(IF(MONTH(~)*DAY(~)=A1-2000,1,0))}
```
---
I tried using `COUNTIF()` instead of `SUM(IF())` but Excel wouldn't even let me enter it as an array formula, much less give me a result. I *did* find a **Google Sheets** solution using `CountIf()` but the same method otherwise that turned out to be 91 bytes, mostly because it uses `ArrayFormula()` instead of simply `{ }`.
```
=CountIf(ArrayFormula(Month(Date(A1,1,0)+Row(1:366))*Day(Date(A1,1,0)+Row(1:366))),A1-2000)
```
[Answer]
# [Retina 0.8.2](https://github.com/m-ender/retina/wiki/The-Language/a950ad7d925ec9316e3e2fb2cf5d49fd15d23e3d), 55 bytes
```
..
$*
(?<=^(1{1,12}))(?=(?(?<=^11$)\1{0,27}|\1{0,30})$)
```
[Try it online!](https://tio.run/##K0otycxL/P9fT49LRYtLw97GNk7DsNpQx9CoVlNTw95Wwx4sZmioohljWG2gY2ReWwNmGBvUaqpo/v9vZgAA "Retina 0.8.2 – Try It Online") Takes a two-digit year; add 1 byte to support 4-digit years. Explanation: The first stage simply converts to unary. The second stage starts by matching 1 to 12 characters before the match position, representing the month, and then attempts to look ahead for a whole number of repetitions of that month. However, the lookahead contains a conditional, which chooses between up to 27 or 30 further repetitions depending on the month. The count of match positions is then the desired result.
[Answer]
# [R](https://www.r-project.org/), ~~22~~ 122 bytes
```
x=scan();substr("122324243426133415153317223416132126011504033106131204241006003213011306002122042005101305111014012",x,x)
```
[Try it online!](https://tio.run/##FcpBDsJADEPRu3TVSl3YTjIgIQ5T2LPogDS3H9xVovd9zjme/X181u3Rf6/@PdeFUiiVkWqMSBYrgjdz0iKqgSwkzLBQ8J5AA5zDNa7fy6sARViK9E1Qyz72sU3e5x8 "R – Try It Online")
Decided to go with a lookup table approach. Input year needs to be 2 digits.
[Answer]
# C (gcc), ~~65~~ ~~60~~ 59 bytes
```
d(a,t,e){for(t=0,e=13;e-->1;)t+=a%e<1&a/e<(e-2?32:29);a=t;}
```
Port of user202729's Java [answer](https://codegolf.stackexchange.com/a/162150/79343). Try it online [here](https://tio.run/##FYtBCsMgEADP5hVLIMVFpdWcjLH9SC@im5JDbQleJOTtNj3NwDBRvWJsLfEgiyTcl8/Gi79J8np0pNRdOyzCh4FmfQlXmjkp8xjNZCy64Is72jusmSPsHfvPay5QwYN2J2YP1p4iBHaMfbczLrwf0gRDeuZeQpWQeEV03dF@). Thanks to [Jonathan Frech](https://codegolf.stackexchange.com/users/73111/jonathan-frech) for golfing 1 byte.
[Answer]
# [J](http://jsoftware.com/), 29 bytes
```
1#.(,x*i."+29+3*2~:x=.i.13)=]
```
[Try it online!](https://tio.run/##PYs9D4IwGAZ3fsWTagRa@tqPQGyTTiZOTu5OhmJdXDvx1ytgwnDT3X0KozoieNTooOAXJOH6uN@KPlDTZZ6ICeOE5Wb2OVAibdvwLG01rdtIp/6CQWEwct6OZiv4OZE1S1iNr/cXMa9xD6OOkQlokci5Xcm/mXZTfg "J – Try It Online")
### How it works
```
1#.(,x*i."+29+3*2~:x=.i.13)=]    Input: year (2-digit, 1..99)
                   x=.i.13       array of 0..12; assign to x
                2~:              1 1 0 1 .. 1
              3*                 3 3 0 3 .. 3
           29+                   32 32 29 32 .. 32
       i."+                      for each item of above, generate a row 0 .. n
    ,x*                          each row times 0 .. 12 and flatten
                           =]    1 for each item == input, 0 otherwise
1#.                              sum
```
Tried hard to get under 2 times Jelly solution :)
### Side note
If someone really wants to hardcode the 99-digit data, here's a bit of information:
Divide the 99-digit into chunks of 2 digits. Then the first digit is `<4` and the second `<8`, which means five bits can encode two numbers. Then the entire data can be encoded in 250 bits, or 32 bytes.
[Answer]
# [Python 3](https://docs.python.org/3/), 158 ~~162~~ ~~215~~ ~~241~~ bytes
Removed 4 Thanks to Stephen for golfing the conditionals.
Removed 53 thanks Stephen for pointing out the white space
Removed 26 thanks to the link provided by caird
I'm pretty new at this. Couldn't think of how to do this without having the days in a month be described.
```
r=range
def n(Y):
 a,b,c=31,30,0
 for x in r(12):
  for y in r([a,(28if Y%4else 29),a,b,a,b,a,a,b,a,b,a][x]):
   if(x+1)*(y+1)==int(str(Y)[2:]):c+=1
 return c
```
[Try it online!](https://tio.run/##RU5LDsIgEN1zitkYQVgAdaFN8B5N00WtoCSGNhSTcnoEmujiTSZv5n2WGF6za1Lyyo/uqdFDG3C4Iy2Ckd3ZpBrBGs44AjN72MA68FjIcq9M3Jl@ZFherIHucNbvVYO8ElYMdvy2od@GqgVr8EYFOeGYp1LWBbwGn5N72eaXiSqBwOvw8Q6m9I8qLbHknOdanFevxWc1VHkkQOEItwwKhXCZIiR9AQ "Python 3 – Try It Online")
[Answer]
# [Forth (gforth)](http://www.complang.tuwien.ac.at/forth/gforth/Docs-html/), 60 59 bytes
```
: f 0 13 1 do over i /mod swap 32 i 2 = 3 * + 0 d< - loop ;
```
[Try it online!](https://tio.run/##TY1LDsIwDET3nGLUJajFcdQNn8NUTcNHIFtJBccPTmDBxtZ43niipPXaX2JdpRwQQXAeDkEgryXhhv1TAvJ7Ung2yTjDY4udkeGEHg8RxdGyCiZ2NqjFxwoTk/GNlaYteTc9YOjM6P5vjgi1K5o7Ius0L/n7fU6/Fmy0fAA "Forth (gforth) – Try It Online")
This version takes advantage of the fact that there can't be more than 1 matching day per month, and that the year has to be divisible by the month for it to match.
### Explanation
Iterates over the months, checks if year is divisible by month, and if the quotient is < 31 (28 for Feb) Months after March can't match for days greater than 25, so we can just assume all months (other than Feb) have 31 days for the purpose of the puzzle.
### Code Explanation
```
: f                   \ start new word definition
  0                   \ set up counter
  13 1 do             \ start a counted loop from 1 to 12
    over i /mod       \ get the quotient and remainder of dividing year by month
    swap              \ default order is remainder-quotient, but we want to swap them
    32 i 2= 3 * +     \ we want to compare to 32 days unless month is Feb
    0 d<=             \ treat the 4 numbers on the stack as 2 double-length numbers
                      \ and compare [1]
    -                 \ subtract result from counter (-1 is true in Forth)
  loop                \ end loop
;                     \ end word definition    
    
```
[1] - Forth has the concept of double length numbers, which are stored on the stack as two single-length numbers (of the form x y, where the value of the double = `y * 2^(l) + x`where l is the size in bits of a single in the forth implementation you're working with).
In this case, I compared the quotient and remainder to 32 (or 29) 0. If the remainder was greater than 0 (year not divisble by month), the first double would be automatically bigger than 32 (or 29) 0 and the result would be false. If the remainder is 0, then it resolves to effectively a regular check of quotient <= 32 (or 29)
# [Forth (gforth)](http://www.complang.tuwien.ac.at/forth/gforth/Docs-html/), 61 bytes
```
: f 0 13 1 do i 2 = 3 * 32 + 1 do over i j * = - loop loop ; 
```
[Try it online!](https://tio.run/##NYtLCoAwEEP3nuKtFaW1O6WnUesHYaQUr19Hqosk8JIEiWlr1/BGzgMBg3VYZmGnx@OocT1NYXIvUYtDoaflFLmKjeg7YY35z50qqE/xW1QpPw "Forth (gforth) – Try It Online")
Saved some bytes by realizing that only February matters in terms of having the correct number of days in the month
# Explanation
Forth (at least gforth) comparisons return -1 for true and 0 for false
```
0                     \ place 0 on top of the stack to use as a counter
13 1 do               \ begin the outer loop from 1 to 12
  i 2 = 3 *           \ if i is 2 place -3 on top of the stack, otherwise 0
  32 + 1 do           \ begin the inner loop from 1 to 31 (or 28)
    over              \ copy the year from stack position 2 and place it on top of the stack
    i j * = -         \ multiply month and day compare to year, subtract result from counter 
  loop                \ end the inner loop
loop                  \ end the outer loop
```
[Answer]
# [Java (JDK 10)](http://jdk.java.net/), ~~79~~ ~~72~~ 70 bytes
```
y->{int a=0,m=13;for(;m-->1;)a+=y%m<1&&y/m<(m==2?29:32)?1:0;return a;}
```
[Try it online!](https://tio.run/##bU47b4MwEN7zK06RiKA8GsgExok6dqg6RJ2qDlcekSk2yD4iWRG/nZpUndrh7nT33ffo8IpxV38tQo6DJujcnkwk@uSBbf7c2klVJAb1L2hINyhXqOrRGHhBoeC2ARinz15UYAjJjesgapAO88@khbq8fwDqiwnurwDPit4Uavs6Nhpp0NACX2x8vAlFgHwfSZ4eWDton8k4PqYswJBbT5bpbmcfZelLzrNTlheHLDilxZ7phiatANm8sLvDyl3FLE@ZLXmeMxuGv/YAZ2uokckwUTK6fNT6Wy@rC3DNU9sIbARtguPY2yfjwvo2CH50581a8/IN "Java (JDK 10) – Try It Online")
[Answer]
# [JavaScript (Node.js)](https://nodejs.org), 108 bytes
```
a=>'0122324243426133415153317223416132126011504033106131204241006003213011306002122042005101305111014012'[a]
```
```
f=a=>'0122324243426133415153317223416132126011504033106131204241006003213011306002122042005101305111014012'[a]
o.innerText=[...Array(99)].map((_,x)=>(2001+x++)+` = `+f(x)).join`\n`
```
```
pre{column-count:5;width:480px;}
```
```
<pre id=o></pre>
```
[Answer]
# [Perl 5](https://www.perl.org/), 68 bytes
```
//;map$\+=$'%++$m==0&&$'/$m<$_,32,29,32,31,32,31,32,32,31,32,31,32}{
```
[Try it online!](https://tio.run/##K0gtyjH9/19f3zo3sUAlRttWRV1VW1sl19bWQE1NRV1fJddGJV7H2EjHyBJEGhsikSjc2ur//w0t/uUXlGTm5xX/1/U11TMwNPivWwAA "Perl 5 – Try It Online")
[Answer]
# Python 3, 132 bytes
This is really quite long of a program but I thought it might be of interest. 
All the values are between 0-7 so I encode each number with 3 bits in a long binary string. I tried pasting a raw binary string into my python program but I couldn't get it to work, so I settled on base64 in the file. 
I used the following string as a lookup table (ending 7 used for padding):
`01223242434261334151533172234161321260115040331061312042410060032130113060021220420051013051110140127`
The program takes this string and decodes it as a number, then uses bit shifting to extract the result. 
```
import base64
lambda n:int.from_bytes(base64.b64decode(b'pNRRxYtw01s9Jw4tFYE0QNkYsoRQgYBosEsYBFIRAUgsUkgwFQM='),'big')>>(6306-3*n)&7
```
# 66 bytes + 37 byte file = 103 bytes
This reads a binary file called `e` and avoids using base64. 
```
lambda n:int.from_bytes(open('e','rb').read(),'big')>>(6306-3*n)&7
```
Here is a hexdump of the read file (without padding):
```
00000000  a4 d4 51 c5 8b 70 d3 5b  3d 27 0e 2d 15 81 34 40  |..Q..p.[='.-..4@|
00000010  d9 18 b2 84 50 81 80 68  b0 4b 18 04 52 11 01 48  |....P..h.K..R..H|
00000020  2c 52 48 30 0a                                    |,RH0.|
```
[Answer]
# [Haskell](https://www.haskell.org/), ~~61~~ 51 bytes
```
f y=sum[1|i<-[96..508],mod(div i 32)13*mod i 32==y]
```
[Try it online!](https://tio.run/##NZPLasMwEEX3/YpZdOEUJ1hvCer@SJqFIQk1ddISp4VA/921zZyVrqTR1eFq9NGNn6dhmKazPNrx57I3f/3rdl/ibheafKgvX8fq2P9KL85ujHuZ56tu28dhepy62yit7CtTi9nUUtla7DI6HX0tbhmDzmMtfhmTzrPOi9aZRheM0QozW8ZVOL3DYGoCAluTqJmNwyoKZI2uWKOnrEXgbGfntAp4bUQkikG2OLtGCR0pOJwdOTjPFs4ucmp2blaRqcHZw@yN1nirt3vHCml40vCR4zj7rHd5nEPDw8AceLqAc/B6V4A5kHMg55ApLioiaUSYo0U4vTR62iGoT4xswRxJI8KcYE44J3ojwZw8AuZEGomeSxkBc6brMl2XYc44Z69vkWHOkS3SyFkJM86FFyzkXCyCriswF5wLORfSKKRRykJ4eHq6dP11/nrft/56l2fphkGq9377dpbqPN6l30jbyng9Lmr9p9M/ "Haskell – Try It Online")
Inspired by [xnor's Python 2 answer](https://codegolf.stackexchange.com/a/162210/77598) and Laikoni.
[Answer]
# Oracle SQL, 115 bytes
```
select count(decode(sign(decode(l,2,29,32)-y/l),1,1))from t,
xmltable('1to 12'columns l int path'.')where mod(y,l)=0
```
We may note that it does not really matter how many days in April (and later months), since 100/4 < 28. Also it's not necessary to check whether year is leap or not.
We just have to specify that there are 28 days in February (not 29 because that validation will be executed only for 2058 which is not leap) otherwise it may be just 31 for any month.
**Other approaches**
# Oracle SQL (12c Release 2 and later), 151 bytes
```
select count(to_date(y/l||'-'||l||'-1' default '' on conversion error,'dd-mm-y'))from t,
(select level l from dual connect by level<=12)where mod(y,l)=0
```
# Oracle SQL (12c Release 2 and later), 137 bytes
```
select sum(validate_conversion(y/l||'-'||l||'-1'as date,'dd-mm-y'))from t,
(select level l from dual connect by level<=12)where mod(y,l)=0
```
*Both solution could have been 8 bytes shorter if we replace `(select level l from dual connect by level<=12)` with `xmltable('1to 12'columns l int path'.')` but Oracle throws an exception because of the bug (tested on versions 12.2.0.1.0, 18.3.0.0.0).*
```
SQL> select count(to_date(y/l||'-'||l||'-1' default '' on conversion error,'dd-mm-y'))from t,
  2  xmltable('1to 12'columns l int path'.')where mod(y,l)=0
  3  /
select count(to_date(y/l||'-'||l||'-1' default '' on conversion error,'dd-mm-y'))from t,
*
ERROR at line 1:
ORA-00932: inconsistent datatypes: expected DATE got DATE
SQL> select sum(validate_conversion(y/l||'-'||l||'-1'as date,'dd-mm-y'))from t,
  2  xmltable('1to 12'columns l int path'.')where mod(y,l)=0
  3  /
select sum(validate_conversion(y/l||'-'||l||'-1'as date,'dd-mm-y'))from t,
*
ERROR at line 1:
ORA-43909: invalid input data type
```
The only case in both solution when year does matter is 2058 which is non-leap so literal '-1' was used to specify non-leap year.
# Oracle SQL, 128 bytes
```
select count(d)from t,(select date'1-1-1'+level-1 d from dual connect by level<365)
where to_char(d(+),'mm')*to_char(d(+),'dd')=y
```
# Oracle SQL, 126 bytes
```
select substr('122324243426133415153317223416132126011504033106131204241006003213011306002122042005101305111014012',y,1)from t
```
**Update**
# Oracle SQL, 110 bytes
```
select-sum(least(sign(y/l-decode(l,2,29,32)),0))from t,
xmltable('1to 12'columns l int path'.')where mod(y,l)=0
```
# Oracle SQL, 108 bytes
```
select sum(decode(sign(decode(l,2,29,32)-y/l)*mod(y+1,l),1,1))from t,
xmltable('1to 12'columns l int path'.')
```
# Spark SQL, 137 bytes
```
select count(cast(regexp_replace(concat_ws('-','2001',l,y/l),'.0$','')as date))
from(select explode(array(1,2,3,4,5,6,7,8,9,10,11,12))l),t
```
# Spark 2.3+ SQL, 126 bytes
(`replace` function becomes available)
```
select count(cast(replace(concat_ws('-','2001',l,y/l),'.0')as date))
from(select explode(array(1,2,3,4,5,6,7,8,9,10,11,12))l),t
```
[Answer]
# [PHP](https://php.net/), 73 bytes
Using pipe input and `php -nR`:
```
for(;++$m<13;$d=1)while($d<25+($m-2?$m>4?:7:4))$c+=$argn==$m*$d++;echo$c;
```
[Try it online!](https://tio.run/##K8go@P8/Lb9Iw1pbWyXXxtDYWiXF1lCzPCMzJ1VDJcXGyFRbQyVX18heJdfOxN7K3MpEU1MlWdtWJbEoPc/WViVXSyVFW9s6NTkjXyXZ@v9/Q4t/@QUlmfl5xf918/7rBilQzWwA "PHP – Try It Online")
# [PHP](https://php.net/), 76 bytes
Using command line arg input `php dm.php 18`:
```
for(;++$m<13;$d=1)while($d<25+($m-2?$m>4?:7:4))$c+=$argv[1]==$m*$d++;echo$c;
```
[Try it online!](https://tio.run/##BcFRCsIwDADQq/iRj9YgrHOiLK09iIhIW9eBtSEMPX58jyurj1x5V0S6PKRwl239LGawpK8uhhCheXckyMHZX13fxUD24wkNtMMYoV2nOJ/nyVpIGOApy/fm7iFA20NGpJJqh0Sq6i5/ "PHP – Try It Online")
Iterative approach. Since the only leap year to look at is 2 \* 29 = 58, and 2058 is not a leap year there's no need to consider leap year in the Feb days. And since wraparound is not a concern -- from April on, any day greater than 25 will exceed 100 we just say the rest of the months only have 25 days.
Input is 2 digit year via command line (-10 bytes as program, thx to suggestion from @Titus).
*OR:*
# [PHP](https://php.net/), 101 bytes
```
$y=$argv[1];for($d=strtotime("$y-1");date(Y,$d)==$y;$d+=86400)eval(date("$\x+=j*n=='y';",$d));echo$x;
```
[Try it online!](https://tio.run/##HcrhCsIgEADgVxlyMG0FGhGD6@g5oiJG2lzUlEuGPr1Rv78v@lgPx@hj45gD39jFwGmaR6kVNpBJY4VCMPC4nM0VH4ElWPokTiFNbycFlI0RCu2QnDytwSoiKAi2o36/01q5ZXjJvwq45I6eq5moLS2KX1bo7j5AxlrrVpv@Cw "PHP – Try It Online")
Still iterative but using PHP's timestamp functions. Accepts year as four digit number. Thx to @Titus for suggestion of using `strtotime()` instead of `mktime()`.
[Answer]
# PHP, ~~74~~ 70 bytes
```
while(++$m<13)for($d=$m<5?$m-2?31:28:25;$d;)$n+=$d--*$m==$argn;echo$n;
```
accepts two-digit years only.
I adopted [gwaugh´s considerations](https://codegolf.stackexchange.com/a/179446/55735) and golfed them; my 1st approach was longer than his (92 bytes):
```
for($y=$argn%100;++$m<13;)for($d=$m-2?30+($m+$m/8)%2:29-($y%4>0);$d;)$n+=$d--*$m==$y;echo$n;
```
`%100` allows to use 4-digit years.
---
Run as pipe with `-nR` or [try them online](http://sandbox.onlinephpfunctions.com/code/ace1e53f44880664f6868ec2aa1f4af209245fb5).
]