0% found this document useful (0 votes)
12 views

Algoritmos

Uploaded by

jumbologox
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views

Algoritmos

Uploaded by

jumbologox
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Given a non-negative integer N:

Make a variable called x, and set it to -N*N.

Count from 1 to 3N + 1 (exclusive), and

for each number that you count (call it 'i'):

Write down the value of x.

Update x to be (x + 2i - 1).

Given a non-negative integer N:

Make a variable called x, and set it to -N*N.

Count from 0 to 3N + 1 (exclusive), and

for each number that you count (call it 'i'):

Write down the value of x.

Update x to be (x + 2i - 1).

Given a non-negative integer N:

Make a variable called x, and set it to -N*N.

Count from 1 to 3N + 1 (exclusive), and

for each number that you count (call it 'i'):

Write down the value of x.

Update x to be (x + 2i).

Given a non-negative integer N:

Make a variable called x, and set it to -N*N.

Count from 0 to 3N + 1 (exclusive), and

for each number that you count (call it 'i'):

Write down the value of x.

Update x to be (x + 2i).
Para las siguientes preguntas, tendrás que utilizar la siguiente
tabla:

Los números de la siguiente tabla son el resultado de ejecutar un


algoritmo que tiene un parámetro N, un número entero no negativo, y
produce secuencias de números enteros como salidas. Para valores de N
de 0 a 5, el algoritmo produce las siguientes secuencias de números
como salidas:

N Salida

1 -1 0 3

2 -4 -3 0 5 12 21

3 -9 -8 -5 0 7 16 27 40 55

4 -16 -15 -12 -7 0 9 20 33 48 65 84 105

5 -25 -24 -21 -16 -9 0 11 24 39 56 75 96 119 144 171

You might also like