[Question]
  [
Given list of integers `{0, 3, 2, 5, 0, 3, 5, 1, 4, 6, 2, 4}`.
For those who interested these numbers are used in weekday calculation.
Weekday = `(m[n] + d + y + y>>2 + y/400 - y/100) % 7;`, where `m[n]` - expression I'm searching, `d` - day of month, `y` - `year - (month <= 2)`.
Construct expression consisting of arithmetic, logic and bitwise operators, which will output for positive integer `n` integer `m` so that `m % 7` equals n-th number in the list.
Branches, ternary operators, table lookups and pointers are not allowed.
**Score:**  
1 - for `| & ^ ~ >> <<` operators  
1.1 - for `+ - < > <= >= == != ! && ||` operators  
1.2 - for `*` operator  
1.4 - for `/ %` operators 
Answer with lowest score wins.
Personally I have found:
> 
>  `(41*n)>>4+((n+61)>>4)<<2` with score 6.4.
>  I thought this will be hard to find so provided own expression to start with.
> 
> 
> 
  
[Answer]
# 2 2.2
I love arbitrary precision arithmetic.
```
0x4126030156610>>(n<<2)
```
Or, if you don't like hex,
```
1146104239711760>>(n<<2)
```
Test:
```
print([(0x4126030156610>>(n<<2))%7 for n in range(1,13)])
[0, 3, 2, 5, 0, 3, 5, 1, 4, 6, 2, 4]
```
[Answer]
## 2.0
```
(127004 >> i) ^ 60233
```
or (score 2.2) :
```
(i * 3246) ^ 130159
```
All found with brute force :-)
[Answer]
## 35.3
I suspect this may be the least efficient method to create the list:
```
1.7801122128869781e+003 * n - 
1.7215267321373362e+003 * n ^ 2 + 
8.3107487075415247e+002 * n ^ 3 - 
2.0576746235987866e+002 * n ^ 4 + 
1.7702949291688071e+001 * n ^ 5 + 
3.7551387326116981e+000 * n ^ 6 - 
1.3296432299817251e+000 * n ^ 7 + 
1.8138635864087030e-001 * n ^ 8 - 
1.3366764519057219e-002 * n ^ 9 + 
5.2402527302299116e-004 * n ^ 10 - 
8.5946393615396631e-006 * n ^ 11 -
7.0418841304671321e+002
```
I just calculated the polynomial regression. I'm tempted to see what other terrible method could be attempted. 
Notably, I could save 3.3 points if the result was rounded. At this point, I don't think that matters.
[Answer]
## 3.2
Zero based solution:
```
7 & (37383146136 >> (i*3))
```
One based solution:
```
7 & (299065169088 >> (i*3))
```
I initially thought that the `%7` operation would be counted as well and `%` being an expensive operation here, I tried to solve it without it.
I came to a result of 3.2 like this:
```
// Construction of the number
// Use 3 bits per entry and shift to correct place
long c = 0;
int[] nums = {0, 3, 2, 5, 0, 3, 5, 1, 4, 6, 2, 4};
for (int i = nums.Length - 1; i >= 0; i--)
{
    c <<= 3;
    c += nums[i];
}
// c = 37383146136
// Actual challenge
for (int i = 0; i < 13; i++)
{
    Console.Write("{0} ",7 & 37383146136 >> i*3);
}
```
I'd be interested in optimizations using this approach (without `%`). Thanks.
[Answer]
# Python (3)
Since there are quite a few of these questions these days, I decided to make a program to automatically solve them in 3 (or 2) tokens. Here's the result for this challenge:
```
G:\Users\Synthetica\Anaconda\python.exe "C:/Users/Synthetica/PycharmProjects/PCCG/Atomic golfer.py"
Input sequence: 0 3 2 5 0 3 5 1 4 6 2 4
f = lambda n: (72997619651120 >> (n << 2)) & 15
f = lambda n: (0x426415305230L >> (n << 2)) & 15
f = lambda n: (0b10000100110010000010101001100000101001000110000 >> (n << 2)) & 15
Process finished with exit code 0
```
Proof that this works:
```
f = lambda n: (72997619651120 >> (n << 2)) & 15
for i in range(12):
   print i, f(i)
 
0 0
1 3
2 2
3 5
4 0
5 3
6 5
7 1
8 4
9 6
10 2
11 4
```
]