# 1、2、3、14…还是15？

32

k这样的整数10^k + 31就是素数。
12314184454，...

123153921194189897，...

# 附加规则

• 对于每个序列，输出可以1基于-或- 0基于（因此，如果其中一个程序1基于-，而另一个程序基于-，则允许输出0）。

• 每个程序可以一致但彼此独立地输出n-th项或first n项。

• 程序或功能被允许，独立于每个序列。

• 输入和输出方式和格式照常灵活禁止出现标准漏洞

20

# 果冻，16 + 16 +1²= 33

### A107083

⁵*+31ÆḍÆNB>/
1Ç#


### A221860

⁵*+31ÆạÆNB>/
1Ç#


### 怎么运行的

1Ç#           Main link. Argument: n

1             Set the return value to 1.
Ç#           Call the helper link with arguments k, k + 1, k + 2, ... until n of
them return a truthy value. Return the array of n matches.

⁵*            Yield 10**k.
+31         Yield 10**k + 31.
Æḍ       Count the proper divisors of 10**k + 31.
This yields c = 1 if 10**k + 31 is prime, an integer c > 1 otherwise.
ÆN     Yield the c-th prime.
This yields q = 2 if 10**k + 31 is prime, a prime q > 2 otherwise.
B    Binary; yield the array of q's digits in base 2.
>/  Reduce by "greater than".
This yields 1 if and only if the binary digits match the regex /10*/,
i.e., iff q is a power of 2, i.e., iff 10**k + 31 is prime.

Æ        Unrecognized token.
The token, as well as all links to its left, are ignored.
ÆN     Yield p, the k-th prime.
ạ       Take the absolute difference of k and p, i.e., p - k.
B    Binary; yield the array of (p - k)'s digits in base 2.
>/  Reduce by "greater than".
This yields 1 if and only if the binary digits match the regex /10*/,
i.e., iff p - k is a power of 2.


5

# Pyth，9 + 11 +9²= 101字节

## 1，2，3，14

.fP_+31^T


## 1，2，3，15

.fsIl-e.fP_


4

# 果冻，12 + 12 +8²= 88字节

## 1，2，3，14

ÆN_µæḟ2=
1Ç#


## 1，2，3，15

10*+31ÆP
1Ç#


1）应该输出第n个项，而不是前n个项。2）嘿，我们的一个片段几乎是相同的！3）呃... 10感觉很长。

1）每个程序可以独立输出前n个项，而不是输出第n个项。
Leaky Nun

@EriktheOutgolfer抱歉，我将其合并到正文中以更加清楚（以前只是在“附加规则”下）
Luis Mendo

3

# 果冻，11B + 10B +7B²= 70

## 1，2，3，14

⁵*+31ÆP
1Ç#


## 1，2，3，15

ạÆNBSỊ
1Ç#


3

# MATL，17 + 17 +7²= 83

## 1，2，3，14，...（17个字节）

0G:"Q11qy^31+Zp~


## 1，2，3，15，...（17个字节）

0G:"QtYqy-Bzq~p~


0      % Push counter (initially zero)
G:"   % Loop n times
% Do .... while true
Q % Increment counter


11q         % Push 10
y        % Duplicate counter
^       % Power
Zp  % isprime
~ % If not, implicitly continue to next iteration.
% Else, implicit display of counter.


tYq         % Nth prime based on counter
y-       % Duplicate counter, subtract from nth prime.
Bzq    % Number of ones in binary presentation, minus one (only zero for powers of two).
~p~ % Filler, effectively a NOP.
% If not zero, implicitly continue to next iteration
% Else, implicitl display of counter.


1

# 05AB1E（旧版），10 + 11 + 6 2 = 84 69 57 字节

## 1，2，3，14，...（A107083）

Îµ>Ð°32<+p


## 1，2，3，15，...（A221860）

Îµ>Ð<ØαD<&_


Î            # Push 0 and the input
µ           # While the counter_variable is not equal to the input yet:
>          #  Increase the top by 1
Ð         #  Triplicate it (which is our k)
°32<+    #  Take 10 to the power k, and add 31
p   #  Check if this is a prime
#  (implicit: if it is a prime, increase the counter_variable by 1)
# (implicitly output the top of the stack after the while-loop)

Î            # Push 0 and the input
µ           # While the counter_variable is not equal to the input yet:
>          #  Increase the top by 1
Ð         #  Triplicate it (which is out k)
<Ø       #  Get the 0-indexed k'th prime
α      #  Get the absolute difference of this prime with the copied k
D<&   #  Calculate k Bitwise-AND k-1
_  #  And check if this is 0 (which means it's a power of 2)
#  (implicit: if it is 0, increase the counter_variable by 1)
# (implicitly output the top of the stack after the while-loop)