NHyDBrun4
R
u
v
Version of 1
lane
NLOverview

The address space

In NHyDB every cell has a fixed place before anything is stored there. This place is described by four details, and they yield a single natural number, the address N. This page shows how the two are connected.

Four details for a cell

A cell is written as (R, u, v, lane):

  • R – the realm, an area of the address space (see Realms),
  • u – the first coordinate, often the record,
  • v – the second coordinate, often the field or position,
  • lane – one of two sides, NL or NR.

These four details are the identity of the cell. The number N is computed from them.

From the cell to the number N

First, u and v are added up to a group:

G = u + v

Since u and v are at least 1, G is at least 2. Group 5, for example, contains the pairs (1, 4), (2, 3), (3, 2) and (4, 1) – four pairs, in general G − 1.

In realm 1:

N = G² − u    on NL
N = G² + v    on NR

The square number G² is the centre of the group. On NL you go u steps to the left, on NR v steps to the right.

A small example: the cell (1, 1, 1) has G = 2, so N = 4 − 1 = 3 on NL and N = 4 + 1 = 5 on NR.

The staircase of numbers

If you write the numbers group by group, one below the other, a staircase appears. Each row is a group G, and from row to row one number is added on the left and one on the right.

1234568791011121514131617181920242322212526272829303534333231363738394041424847464544434950515253545556636261605958576465666768697071728079787776757473818283848586878889

Point at a cell or tap it: its address and the calculation appear here.

N = 1 = 1² · square centre G² – not a storage cell

N = 2 = 2·1 · group boundary G(G−1) – not a storage cell

N = 3 = 2² − 1  ·  (R, u, v, lane) = (1, 1, 1, NL)  ·  G = 1 + 1 = 2  ·  partner cell: 5

N = 4 = 2² · square centre G² – not a storage cell

N = 5 = 2² + 1  ·  (R, u, v, lane) = (1, 1, 1, NR)  ·  G = 1 + 1 = 2  ·  partner cell: 3

N = 6 = 3·2 · group boundary G(G−1) – not a storage cell

N = 8 = 3² − 1  ·  (R, u, v, lane) = (1, 1, 2, NL)  ·  G = 1 + 2 = 3  ·  partner cell: 11

N = 7 = 3² − 2  ·  (R, u, v, lane) = (1, 2, 1, NL)  ·  G = 2 + 1 = 3  ·  partner cell: 10

N = 9 = 3² · square centre G² – not a storage cell

N = 10 = 3² + 1  ·  (R, u, v, lane) = (1, 2, 1, NR)  ·  G = 2 + 1 = 3  ·  partner cell: 7

N = 11 = 3² + 2  ·  (R, u, v, lane) = (1, 1, 2, NR)  ·  G = 1 + 2 = 3  ·  partner cell: 8

N = 12 = 4·3 · group boundary G(G−1) – not a storage cell

N = 15 = 4² − 1  ·  (R, u, v, lane) = (1, 1, 3, NL)  ·  G = 1 + 3 = 4  ·  partner cell: 19

N = 14 = 4² − 2  ·  (R, u, v, lane) = (1, 2, 2, NL)  ·  G = 2 + 2 = 4  ·  partner cell: 18

N = 13 = 4² − 3  ·  (R, u, v, lane) = (1, 3, 1, NL)  ·  G = 3 + 1 = 4  ·  partner cell: 17

N = 16 = 4² · square centre G² – not a storage cell

N = 17 = 4² + 1  ·  (R, u, v, lane) = (1, 3, 1, NR)  ·  G = 3 + 1 = 4  ·  partner cell: 13

N = 18 = 4² + 2  ·  (R, u, v, lane) = (1, 2, 2, NR)  ·  G = 2 + 2 = 4  ·  partner cell: 14

N = 19 = 4² + 3  ·  (R, u, v, lane) = (1, 1, 3, NR)  ·  G = 1 + 3 = 4  ·  partner cell: 15

N = 20 = 5·4 · group boundary G(G−1) – not a storage cell

N = 24 = 5² − 1  ·  (R, u, v, lane) = (1, 1, 4, NL)  ·  G = 1 + 4 = 5  ·  partner cell: 29

N = 23 = 5² − 2  ·  (R, u, v, lane) = (1, 2, 3, NL)  ·  G = 2 + 3 = 5  ·  partner cell: 28

N = 22 = 5² − 3  ·  (R, u, v, lane) = (1, 3, 2, NL)  ·  G = 3 + 2 = 5  ·  partner cell: 27

N = 21 = 5² − 4  ·  (R, u, v, lane) = (1, 4, 1, NL)  ·  G = 4 + 1 = 5  ·  partner cell: 26

N = 25 = 5² · square centre G² – not a storage cell

N = 26 = 5² + 1  ·  (R, u, v, lane) = (1, 4, 1, NR)  ·  G = 4 + 1 = 5  ·  partner cell: 21

N = 27 = 5² + 2  ·  (R, u, v, lane) = (1, 3, 2, NR)  ·  G = 3 + 2 = 5  ·  partner cell: 22

N = 28 = 5² + 3  ·  (R, u, v, lane) = (1, 2, 3, NR)  ·  G = 2 + 3 = 5  ·  partner cell: 23

N = 29 = 5² + 4  ·  (R, u, v, lane) = (1, 1, 4, NR)  ·  G = 1 + 4 = 5  ·  partner cell: 24

N = 30 = 6·5 · group boundary G(G−1) – not a storage cell

N = 35 = 6² − 1  ·  (R, u, v, lane) = (1, 1, 5, NL)  ·  G = 1 + 5 = 6  ·  partner cell: 41

N = 34 = 6² − 2  ·  (R, u, v, lane) = (1, 2, 4, NL)  ·  G = 2 + 4 = 6  ·  partner cell: 40

N = 33 = 6² − 3  ·  (R, u, v, lane) = (1, 3, 3, NL)  ·  G = 3 + 3 = 6  ·  partner cell: 39

N = 32 = 6² − 4  ·  (R, u, v, lane) = (1, 4, 2, NL)  ·  G = 4 + 2 = 6  ·  partner cell: 38

N = 31 = 6² − 5  ·  (R, u, v, lane) = (1, 5, 1, NL)  ·  G = 5 + 1 = 6  ·  partner cell: 37

N = 36 = 6² · square centre G² – not a storage cell

N = 37 = 6² + 1  ·  (R, u, v, lane) = (1, 5, 1, NR)  ·  G = 5 + 1 = 6  ·  partner cell: 31

N = 38 = 6² + 2  ·  (R, u, v, lane) = (1, 4, 2, NR)  ·  G = 4 + 2 = 6  ·  partner cell: 32

N = 39 = 6² + 3  ·  (R, u, v, lane) = (1, 3, 3, NR)  ·  G = 3 + 3 = 6  ·  partner cell: 33

N = 40 = 6² + 4  ·  (R, u, v, lane) = (1, 2, 4, NR)  ·  G = 2 + 4 = 6  ·  partner cell: 34

N = 41 = 6² + 5  ·  (R, u, v, lane) = (1, 1, 5, NR)  ·  G = 1 + 5 = 6  ·  partner cell: 35

N = 42 = 7·6 · group boundary G(G−1) – not a storage cell

N = 48 = 7² − 1  ·  (R, u, v, lane) = (1, 1, 6, NL)  ·  G = 1 + 6 = 7  ·  partner cell: 55

N = 47 = 7² − 2  ·  (R, u, v, lane) = (1, 2, 5, NL)  ·  G = 2 + 5 = 7  ·  partner cell: 54

N = 46 = 7² − 3  ·  (R, u, v, lane) = (1, 3, 4, NL)  ·  G = 3 + 4 = 7  ·  partner cell: 53

N = 45 = 7² − 4  ·  (R, u, v, lane) = (1, 4, 3, NL)  ·  G = 4 + 3 = 7  ·  partner cell: 52

N = 44 = 7² − 5  ·  (R, u, v, lane) = (1, 5, 2, NL)  ·  G = 5 + 2 = 7  ·  partner cell: 51

N = 43 = 7² − 6  ·  (R, u, v, lane) = (1, 6, 1, NL)  ·  G = 6 + 1 = 7  ·  partner cell: 50

N = 49 = 7² · square centre G² – not a storage cell

N = 50 = 7² + 1  ·  (R, u, v, lane) = (1, 6, 1, NR)  ·  G = 6 + 1 = 7  ·  partner cell: 43

N = 51 = 7² + 2  ·  (R, u, v, lane) = (1, 5, 2, NR)  ·  G = 5 + 2 = 7  ·  partner cell: 44

N = 52 = 7² + 3  ·  (R, u, v, lane) = (1, 4, 3, NR)  ·  G = 4 + 3 = 7  ·  partner cell: 45

N = 53 = 7² + 4  ·  (R, u, v, lane) = (1, 3, 4, NR)  ·  G = 3 + 4 = 7  ·  partner cell: 46

N = 54 = 7² + 5  ·  (R, u, v, lane) = (1, 2, 5, NR)  ·  G = 2 + 5 = 7  ·  partner cell: 47

N = 55 = 7² + 6  ·  (R, u, v, lane) = (1, 1, 6, NR)  ·  G = 1 + 6 = 7  ·  partner cell: 48

N = 56 = 8·7 · group boundary G(G−1) – not a storage cell

N = 63 = 8² − 1  ·  (R, u, v, lane) = (1, 1, 7, NL)  ·  G = 1 + 7 = 8  ·  partner cell: 71

N = 62 = 8² − 2  ·  (R, u, v, lane) = (1, 2, 6, NL)  ·  G = 2 + 6 = 8  ·  partner cell: 70

N = 61 = 8² − 3  ·  (R, u, v, lane) = (1, 3, 5, NL)  ·  G = 3 + 5 = 8  ·  partner cell: 69

N = 60 = 8² − 4  ·  (R, u, v, lane) = (1, 4, 4, NL)  ·  G = 4 + 4 = 8  ·  partner cell: 68

N = 59 = 8² − 5  ·  (R, u, v, lane) = (1, 5, 3, NL)  ·  G = 5 + 3 = 8  ·  partner cell: 67

N = 58 = 8² − 6  ·  (R, u, v, lane) = (1, 6, 2, NL)  ·  G = 6 + 2 = 8  ·  partner cell: 66

N = 57 = 8² − 7  ·  (R, u, v, lane) = (1, 7, 1, NL)  ·  G = 7 + 1 = 8  ·  partner cell: 65

N = 64 = 8² · square centre G² – not a storage cell

N = 65 = 8² + 1  ·  (R, u, v, lane) = (1, 7, 1, NR)  ·  G = 7 + 1 = 8  ·  partner cell: 57

N = 66 = 8² + 2  ·  (R, u, v, lane) = (1, 6, 2, NR)  ·  G = 6 + 2 = 8  ·  partner cell: 58

N = 67 = 8² + 3  ·  (R, u, v, lane) = (1, 5, 3, NR)  ·  G = 5 + 3 = 8  ·  partner cell: 59

N = 68 = 8² + 4  ·  (R, u, v, lane) = (1, 4, 4, NR)  ·  G = 4 + 4 = 8  ·  partner cell: 60

N = 69 = 8² + 5  ·  (R, u, v, lane) = (1, 3, 5, NR)  ·  G = 3 + 5 = 8  ·  partner cell: 61

N = 70 = 8² + 6  ·  (R, u, v, lane) = (1, 2, 6, NR)  ·  G = 2 + 6 = 8  ·  partner cell: 62

N = 71 = 8² + 7  ·  (R, u, v, lane) = (1, 1, 7, NR)  ·  G = 1 + 7 = 8  ·  partner cell: 63

N = 72 = 9·8 · group boundary G(G−1) – not a storage cell

N = 80 = 9² − 1  ·  (R, u, v, lane) = (1, 1, 8, NL)  ·  G = 1 + 8 = 9  ·  partner cell: 89

N = 79 = 9² − 2  ·  (R, u, v, lane) = (1, 2, 7, NL)  ·  G = 2 + 7 = 9  ·  partner cell: 88

N = 78 = 9² − 3  ·  (R, u, v, lane) = (1, 3, 6, NL)  ·  G = 3 + 6 = 9  ·  partner cell: 87

N = 77 = 9² − 4  ·  (R, u, v, lane) = (1, 4, 5, NL)  ·  G = 4 + 5 = 9  ·  partner cell: 86

N = 76 = 9² − 5  ·  (R, u, v, lane) = (1, 5, 4, NL)  ·  G = 5 + 4 = 9  ·  partner cell: 85

N = 75 = 9² − 6  ·  (R, u, v, lane) = (1, 6, 3, NL)  ·  G = 6 + 3 = 9  ·  partner cell: 84

N = 74 = 9² − 7  ·  (R, u, v, lane) = (1, 7, 2, NL)  ·  G = 7 + 2 = 9  ·  partner cell: 83

N = 73 = 9² − 8  ·  (R, u, v, lane) = (1, 8, 1, NL)  ·  G = 8 + 1 = 9  ·  partner cell: 82

N = 81 = 9² · square centre G² – not a storage cell

N = 82 = 9² + 1  ·  (R, u, v, lane) = (1, 8, 1, NR)  ·  G = 8 + 1 = 9  ·  partner cell: 73

N = 83 = 9² + 2  ·  (R, u, v, lane) = (1, 7, 2, NR)  ·  G = 7 + 2 = 9  ·  partner cell: 74

N = 84 = 9² + 3  ·  (R, u, v, lane) = (1, 6, 3, NR)  ·  G = 6 + 3 = 9  ·  partner cell: 75

N = 85 = 9² + 4  ·  (R, u, v, lane) = (1, 5, 4, NR)  ·  G = 5 + 4 = 9  ·  partner cell: 76

N = 86 = 9² + 5  ·  (R, u, v, lane) = (1, 4, 5, NR)  ·  G = 4 + 5 = 9  ·  partner cell: 77

N = 87 = 9² + 6  ·  (R, u, v, lane) = (1, 3, 6, NR)  ·  G = 3 + 6 = 9  ·  partner cell: 78

N = 88 = 9² + 7  ·  (R, u, v, lane) = (1, 2, 7, NR)  ·  G = 2 + 7 = 9  ·  partner cell: 79

N = 89 = 9² + 8  ·  (R, u, v, lane) = (1, 1, 8, NR)  ·  G = 1 + 8 = 9  ·  partner cell: 80

  • NL: N = G² − u
  • G² · G = u + v
  • NR: N = G² + v
  • N0 = G(G−1)

The graphic shows the groups G = 1 to 9 with all numbers N. In the middle of each row is the square number G², to its left the NL cells (N = G² − u), to its right the NR cells (N = G² + v). On the far left is the boundary G(G − 1), which separates a group from the previous one. If you point at a cell or tap it, its address, the calculation and the partner cell with the same coordinates on the other side appear.

Two rows to follow along:

G = 3:   6 |  7   8 |  9 | 10  11
G = 4:  12 | 13  14  15 | 16 | 17  18  19

In group 3, 7 and 8 are the NL cells, 9 is the square number, 10 and 11 are the NR cells. Then comes the boundary 12, with which group 4 begins.

Rule of thumb: NL lies to the left of the square, NR to the right of it – and the distance to the square is u or v respectively.

An example: (1, 11, 13)

The cell with u = 11 and v = 13 in realm 1:

G  = 11 + 13 = 24
G² = 576
NL:  N = 576 − 11 = 565
NR:  N = 576 + 13 = 589

The same coordinates thus give two different cells: 565 on NL and 589 on NR. Each can be written independently of the other.

Every number exactly once

Every natural number appears exactly once in the staircase. Most of them are cells. Two kinds of numbers are not storage cells but fixed markers:

  • the square numbers G² (in group 24 the 576),
  • the boundaries G(G − 1) (before group 24 the 552, after it the 600).

Group 24 therefore comprises the NL cells 553 to 575 and the NR cells 577 to 599 – 23 cells each.

No key, no directory

Because N can be computed from (R, u, v, lane) and vice versa, NHyDB needs no primary keys, no sequential numbers and no directory that maps addresses to storage locations. If you know the coordinates, you know the address – even for cells that are still empty. How to compute back from N is shown in From N back to the address.

# The address space In NHyDB every cell has a fixed place before anything is stored there. This place is described by four details, and they yield a single natural number, the address N. This page shows how the two are connected. ## Four details for a cell A cell is written as **(R, u, v, lane)**: - **R** – the realm, an area of the address space (see [Realms](/en/realms/)),- **u** – the first coordinate, often the record,- **v** – the second coordinate, often the field or position,- **lane** – one of two sides, **NL** or **NR**. These four details are the identity of the cell. The number N is computed from them. ## From the cell to the number N First, u and v are added up to a **group**: ```G = u + v``` Since u and v are at least 1, G is at least 2. Group 5, for example, contains the pairs (1, 4), (2, 3), (3, 2) and (4, 1) – four pairs, in general G − 1. In realm 1: ```N = G² − u on NLN = G² + v on NR``` The square number G² is the centre of the group. On NL you go u steps to the left, on NR v steps to the right. A small example: the cell (1, 1, 1) has G = 2, so N = 4 − 1 = 3 on NL and N = 4 + 1 = 5 on NR. ## The staircase of numbers If you write the numbers group by group, one below the other, a staircase appears. Each row is a group G, and from row to row one number is added on the left and one on the right. {{treppe}} The graphic shows the groups G = 1 to 9 with all numbers N. In the middle of each row is the square number G², to its left the NL cells (N = G² − u), to its right the NR cells (N = G² + v). On the far left is the boundary G(G − 1), which separates a group from the previous one. If you point at a cell or tap it, its address, the calculation and the partner cell with the same coordinates on the other side appear. Two rows to follow along: ```G = 3: 6 | 7 8 | 9 | 10 11G = 4: 12 | 13 14 15 | 16 | 17 18 19``` In group 3, 7 and 8 are the NL cells, 9 is the square number, 10 and 11 are the NR cells. Then comes the boundary 12, with which group 4 begins. > Rule of thumb: NL lies to the left of the square, NR to the right of it – and the distance to the square is u or v respectively. ## An example: (1, 11, 13) The cell with u = 11 and v = 13 in realm 1: ```G = 11 + 13 = 24G² = 576NL: N = 576 − 11 = 565NR: N = 576 + 13 = 589``` The same coordinates thus give two different cells: 565 on NL and 589 on NR. Each can be written independently of the other. ## Every number exactly once Every natural number appears exactly once in the staircase. Most of them are cells. Two kinds of numbers are not storage cells but fixed markers: - the **square numbers** G² (in group 24 the 576),- the **boundaries** G(G − 1) (before group 24 the 552, after it the 600). Group 24 therefore comprises the NL cells 553 to 575 and the NR cells 577 to 599 – 23 cells each. ## No key, no directory Because N can be computed from (R, u, v, lane) and vice versa, NHyDB needs no primary keys, no sequential numbers and no directory that maps addresses to storage locations. If you know the coordinates, you know the address – even for cells that are still empty. How to compute back from N is shown in [From N back to the address](/en/inverse/).