More specifically, the template for this one was `${p}/k%${m0}%${m1}|1` with \0ドル<p<10^5\$, \0ドル<m_0<10^3\$ and \12ドル\le m_1 \le 15\$.
More specifically, the template for this one was `${p}/k%${m0}%${m1}|1` with \0ドル<p<10^5\$, \0ドル<m_0<10^3\$ and \12ドル\le m_1 \le 15\$.
Commented
a => // a[] = input
a.map(g = k => // for each ASCII code k in a[]:
--d - 1 ? // decrement d; if d is not equal to 1:
g( // do a recursive call to the callback function:
k, // pass k unchanged
d = // update d:
n % d ? d // if d is not a divisor of n, leave d unchanged
: ++n // otherwise, increment n and set d = n
) // end of recursive call
: // else (n is now the next prime):
p *= // multiply p by
n ** ( // n raised to the power of
17088 / k // the odd positive integer <= 13 which is obtained
% 75 % 14 // by applying our magic formula to k
| 1 //
), //
d = p = n = 1 // start with d = p = n = 1
) && p // end of map(); return p
Commented
a => // a[] = input
a.map(g = k => // for each ASCII code k in a[]:
--d - 1 ? // decrement d; if d is not equal to 1:
g( // do a recursive call to the callback function:
k, // pass k unchanged
d = // update d:
n % d ? d // if d is not a divisor of n, leave d unchanged
: ++n // otherwise, increment n and set d = n
) // end of recursive call
: // else (n is now the next prime):
p *= // multiply p by
n ** ( // n raised to the power of
17088 / k // the odd positive integer <= 13 which is obtained
% 75 % 14 // by applying our magic formula to k
| 1 //
), //
d = p = n = 1 // start with d = p = n = 1
) && p // end of map(); return p
JavaScript (ES7), (削除) 75 (削除ここまで) 72 bytes
Expects an array of ASCII codes.
a=>a.map(g=k=>--d-1?g(k,d=n%d?d:++n):p*=n**(17088/k%75%14|1),d=p=n=1)&&p
Magic formula
The formula 17088/k%75%14|1 was found by injecting random values into several handcrafted templates.
char. | k | floor(17088 / k) | mod 75 | mod 14 | OR 1
-------+-----+------------------+--------+--------+------
'(' | 40 | 427 | 52 | 10 | 11
')' | 41 | 416 | 41 | 13 | 13
'0' | 48 | 356 | 56 | 0 | 1
'A' | 65 | 262 | 37 | 9 | 9
's' | 115 | 148 | 73 | 3 | 3
'|' | 124 | 137 | 62 | 6 | 7
'~' | 126 | 135 | 60 | 4 | 5
JavaScript (ES7), (削除) 75 (削除ここまで) 72 bytes
Expects an array of ASCII codes.
a=>a.map(g=k=>--d-1?g(k,d=n%d?d:++n):p*=n**(17088/k%75%14|1),d=p=n=1)&&p
JavaScript (ES7), (削除) 75 (削除ここまで) 72 bytes
Expects an array of ASCII codes.
a=>a.map(g=k=>--d-1?g(k,d=n%d?d:++n):p*=n**(17088/k%75%14|1),d=p=n=1)&&p
Magic formula
The formula 17088/k%75%14|1 was found by injecting random values into several handcrafted templates.
char. | k | floor(17088 / k) | mod 75 | mod 14 | OR 1
-------+-----+------------------+--------+--------+------
'(' | 40 | 427 | 52 | 10 | 11
')' | 41 | 416 | 41 | 13 | 13
'0' | 48 | 356 | 56 | 0 | 1
'A' | 65 | 262 | 37 | 9 | 9
's' | 115 | 148 | 73 | 3 | 3
'|' | 124 | 137 | 62 | 6 | 7
'~' | 126 | 135 | 60 | 4 | 5