#Exemplo 2

>    for n to 50 do

>    print(n,n*n-n+41,isprime(n*n-n+41)):

>    od;

1, 41, true

2, 43, true

3, 47, true

4, 53, true

5, 61, true

6, 71, true

7, 83, true

8, 97, true

9, 113, true

10, 131, true

11, 151, true

12, 173, true

13, 197, true

14, 223, true

15, 251, true

16, 281, true

17, 313, true

18, 347, true

19, 383, true

20, 421, true

21, 461, true

22, 503, true

23, 547, true

24, 593, true

25, 641, true

26, 691, true

27, 743, true

28, 797, true

29, 853, true

30, 911, true

31, 971, true

32, 1033, true

33, 1097, true

34, 1163, true

35, 1231, true

36, 1301, true

37, 1373, true

38, 1447, true

39, 1523, true

40, 1601, true

41, 1681, false

42, 1763, false

43, 1847, true

44, 1933, true

45, 2021, false

46, 2111, true

47, 2203, true

48, 2297, true

49, 2393, true

50, 2491, false

#Exemplo 3

>    for n to 50 do

>    print(n,sqrt(991*n*n+1)):

>    od;

>   

1, 4*62^(1/2)

2, 3965^(1/2)

3, 2*2230^(1/2)

4, 15857^(1/2)

5, 2*6194^(1/2)

6, 35677^(1/2)

7, 4*3035^(1/2)

8, 5*2537^(1/2)

9, 4*5017^(1/2)

10, 99101^(1/2)

11, 2*29978^(1/2)

12, 142705^(1/2)

13, 2*41870^(1/2)

14, 194237^(1/2)

15, 16*871^(1/2)

16, 253697^(1/2)

17, 40*179^(1/2)

18, 321085^(1/2)

19, 2*89438^(1/2)

20, 396401^(1/2)

21, 2*109258^(1/2)

22, 479645^(1/2)

23, 4*32765^(1/2)

24, 570817^(1/2)

25, 4*38711^(1/2)

26, 669917^(1/2)

27, 2*180610^(1/2)

28, 776945^(1/2)

29, 2*208358^(1/2)

30, 891901^(1/2)

31, 4*59522^(1/2)

32, 1014785^(1/2)

33, 20*2698^(1/2)

34, 1145597^(1/2)

35, 2*303494^(1/2)

36, 1284337^(1/2)

37, 2*339170^(1/2)

38, 1431005^(1/2)

39, 4*94207^(1/2)

40, 1585601^(1/2)

41, 4*104117^(1/2)

42, 25*2797^(1/2)

43, 2*458090^(1/2)

44, 1918577^(1/2)

45, 2*501694^(1/2)

46, 2096957^(1/2)

47, 8*34205^(1/2)

48, 2283265^(1/2)

49, 8*37178^(1/2)

50, 2477501^(1/2)

>    n:=12055735790331359447442538766:print(n,sqrt(991*n*n+1));

>    n:=12055735790331359447442538767:print(n,sqrt(991*n*n+1));

>    n:=12055735790331359447442538768:print(n,sqrt(991*n*n+1));

12055735790331359447442538766, 144032698557259999607886110536860894636734721995142087531197^(1/2)

12055735790331359447442538767, 379516400906811930638014896080

12055735790331359447442538768, 144032698557259999607886110584649831309608230844804311203585^(1/2)

#Exemplo 4

>    n:=0:S:=0:

>    for n to 50 do

>    S:=S+2*n-1:print (S,n*n);

>    od:

1, 1

4, 4

9, 9

16, 16

25, 25

36, 36

49, 49

64, 64

81, 81

100, 100

121, 121

144, 144

169, 169

196, 196

225, 225

256, 256

289, 289

324, 324

361, 361

400, 400

441, 441

484, 484

529, 529

576, 576

625, 625

676, 676

729, 729

784, 784

841, 841

900, 900

961, 961

1024, 1024

1089, 1089

1156, 1156

1225, 1225

1296, 1296

1369, 1369

1444, 1444

1521, 1521

1600, 1600

1681, 1681

1764, 1764

1849, 1849

1936, 1936

2025, 2025

2116, 2116

2209, 2209

2304, 2304

2401, 2401

2500, 2500

#Exemplo 5

>    n:=2: while n < 50 do

>    n:=n+2: for k to n/2 do

>     if (isprime(k) and isprime(n-k)) then print (n,k,n-k) fi:

>    od: print("################"): od:

4, 2, 2

6, 3, 3

8, 3, 5

10, 3, 7

10, 5, 5

12, 5, 7

14, 3, 11

14, 7, 7

16, 3, 13

16, 5, 11

18, 5, 13

18, 7, 11

20, 3, 17

20, 7, 13

22, 3, 19

22, 5, 17

22, 11, 11

24, 5, 19

24, 7, 17

24, 11, 13

26, 3, 23

26, 7, 19

26, 13, 13

28, 5, 23

28, 11, 17

30, 7, 23

30, 11, 19

30, 13, 17

32, 3, 29

32, 13, 19

34, 3, 31

34, 5, 29

34, 11, 23

34, 17, 17

36, 5, 31

36, 7, 29

36, 13, 23

36, 17, 19

38, 7, 31

38, 19, 19

40, 3, 37

40, 11, 29

40, 17, 23

42, 5, 37

42, 11, 31

42, 13, 29

42, 19, 23

44, 3, 41

44, 7, 37

44, 13, 31

46, 3, 43

46, 5, 41

46, 17, 29

46, 23, 23

48, 5, 43

48, 7, 41

48, 11, 37

48, 17, 31

48, 19, 29

50, 3, 47

50, 7, 43

50, 13, 37

50, 19, 31

>