# Advance Happy New Year, 2016!

Your input will be a integer between 1970 and 2090 (inclusive), representing a year. Your program should output the next year on which New Years Day falls on the same day of the week as the input year.

Test Cases:

Below are the sample inputs and outputs

2001 => 2007
2047 => 2058
2014 => 2020
1970 => 1976
1971 => 1982
1977 => 1983
2006 => 2012

20% Bonus: Output the day of the week of New Years Day

2001 => 2007 (Mon)
2047 => 2058 (Tue)
2014 => 2020 (Wed)
1970 => 1976 (Thu)
1971 => 1982 (Fri)
1977 => 1983 (Sat)
2006 => 2012 (Sun)

30% Bonus: Output Advance Happy New Year, <year>

2010 => Advance Happy New Year, 2016

50% Bonus: Do both above bonuses

2010 => Advance Happy New Year, 2016 (Fri)

Write a program which reads input from STDIN or accepts command line arguments, or a function which takes an argument.

• I feel like every single dates challenge requires doing the leap years calculation as a subproblem, and it's getting stale.
– xnor
Commented Dec 15, 2015 at 10:35
• Related: this question. Commented Dec 15, 2015 at 11:09
• @xnor If that wasn't the case, it would have been just a +7. I.e. "too broad" Commented Sep 11, 2016 at 1:08
• @EriktheGolfer No. When I wrote that comment, my answer was the accepted one. Commented Sep 11, 2016 at 1:37

# Vyxal, 9 bytes

4%3e7%+5+

Try it Online!

-2 thanks to @lyxal

#### Explanation

4%3e7%+5+  # Implicit input
4%         # Input mod 4
3e       # Cubed
7%     # Mod 7
+5+  # Plus 5 plus input
# Implicit output

Old:

4%»&ṗ»12τi+  # Implicit input
4%           # Input mod 4
i   # Indexed into
»&ṗ»12τ    # The list [5,6,6,11]
+  # Added to the input
# Implicit output
• Try it Online! for 9 bytes porting Jelly. Smh making long answers like this. Commented Aug 25, 2023 at 4:41
• @lyxαl thanks. And we were talking the other day about how you don't have a monograph for "cube" lol Commented Aug 25, 2023 at 6:41

# Thunno 2, 8 bytes

4%³7%+5+

Try it online!

#### Explanation

4%³7%+5+  # Implicit input
4%        # Input mod 4
³       # Cubed
7%     # Mod 7
+5+  # Plus 5 plus input
# Implicit output

Old:

4%¿çƑ{ç¿i+  # Implicit input
4%          # Input mod 4
i   # Indexed into
¿çƑ{ç¿    # The list [5,6,6,11]
+  # Added to the input
# Implicit output

# Python 2, 32 bytes

x=input()
print[5,6,6,11][x%4]+x

Uses the 5 6 6 11 trick.

# 𝔼𝕊𝕄𝕚𝕟 2, 12 chars / 18 bytes (non-competitive)

ï+⟨566ḋ[ï%4]

Try it here (Firefox only).

# Explanation

ï+⟨566ḋ[ï%4] // implicit: ï = input, ḋ = 11