## p: y (Primes)

The y-th prime

• starting with 2 as the 0-th prime

```   p: i.9
2 3 5 7 11 13 17 19 23
p: 2000
17393```

### Common uses

Mathematical investigations.

## x p: y (Primes)

A collection of prime-related functions of integer y.

x determines which function applies.

```   ]y=: p: 2000   NB. The 2000th prime
17393

_4 p: y        NB. Next prime down from y
17389
4 p: 17389     NB. Next prime up from 17389
17393
_1 p: y        NB. Number of primes <y
2000
1 p: y         NB. Boolean: y is prime
1
0 p: y         NB. Boolean: y is non-prime
0

1 p: i.25      NB. flags the primes in i.25
0 0 1 1 0 1 0 1 0 0 0 1 0 1 0 0 0 1 0 1 0 0 0 1 0
I. (1 p: i.25) NB. Primes in (i.25)
2 3 5 7 11 13 17 19 23

3 p: 2+ 2^31   NB. prime factorization of 2+(2^31)
2 5 5 13 41 61 1321
2 p: 2+ 2^31   NB. table of prime factors of 2+(2^31) with their exponents
2 5 13 41 61 1321
1 2  1  1  1    1

5 p: y   NB. Totient function: number of co-prime integers less than y
17392
NB. --they all are.
5 p: y+1
5328```

### Common uses

Mathematical investigations.