# GF（5）上的不可约多项式

13

### 例子

``````In : Out
1 : 5
2 : 10
3 : 40
4 : 150
5 : 624
6 : 2580
7 : 11160
8 : 48750
9 : 217000
10 : 976248
11 : 4438920
``````

A001692上的PARI / GP 46字节;）有时间限制吗？
ბიმო

@Bruce_Forte不。
Alex A.

9

# 果冻，30 23 22 20 字节

``````ÆF>1’PḄ
ÆDµU5*×Ç€S:Ṫ
``````

### 码

``````ÆF>1’PḄ       Monadic helper link. Argument: d
This link computes the Möbius function of d.

ÆF            Factor d into prime-exponent pairs.
>1          Compare each prime and exponent with 1. Returns 1 or 0.
’         Decrement each Boolean, resulting in 0 or -1.
P        Take the product of all Booleans, for both primes and exponents.
Ḅ       Convert from base 2 to integer. This is a sneaky way to map [0, b] to
b and [] to 0.

ÆD            Compute all divisors of n.
µ           Begin a new, monadic chain. Argument: divisors of n
U          Reverse the divisors, effectively computing n/d for each divisor d.
Compute 5 ** (n/d) for each n/d.

Ç€     Map the helper link over the (ascending) divisors.
×       Multiply the powers by the results from Ç.
Ṫ   Divide the sum by the last divisor (n).
``````

1

3

# Mathematica，39 38字节

``````DivisorSum[a=#,5^(a/#)MoebiusMu@#/a&]&
``````

+1可以教我有关命名函数运算符的信息，但如果没有以下内容，我认为它要短一个字节：`DivisorSum[n=#,5^(n/#)MoebiusMu@#/n&]&`
Martin Ender

1

# Pari / GP，17个字节

``````n->ffnbirred(5,n)
``````

# Pari / GP，无内置，35字节

``````n->sumdiv(n,d,5^(n/d)*moebius(d)/n)
``````