An encoder comprising: an integer transformer that obtains a plurality of integer values, hereinafter referred to as "transformed integers", through bijective transformation for each of integer values included in an inputted sequence of integer values and obtains a transformed integer sequence by arranging the transformed integers in predetermined order; and an integer encoder that obtains codes by Golomb-Rice encoding the transformed integers included in the transformed integer sequence, characterized in that, assuming that MB is the number of the transformed integers obtained through the transformation from one inputted integer value and x is an integer value included in the sequence of integer values, the integer transformer obtains the transformed integers y 1, y 2,..., y MB by calculating the following formula: y 1, y 2,..., y MB = g MB x where the function g M' is a recursive function that calculates the following formula if λ M ′ ≥ C K − i 1 M ′ − m − 1 y m + 1 = ⌊ x M ′ ⌋ λ M ′ = λ M ′ − C K − i 1 M ′ − m − 1 i 1 = i 1 + 1 otherwise y m + 1 = y ̃ i 2 + 1 i 2 = i 2 + 1 wherein i 1 =0 and i 2 =0 are initial values with respect to m=0, 1,..., M'-1, g 0 is a function that outputs nothing, ⌊ x M ′ ⌋ is a maximum M'-th order square root that does not exceed x, a C b is the number of combinations for selecting "b" integer values from "a" integer values, K is a maximum value when x − ∑ m = 0 K − 1 C m M ′ ⌊ x M ′ ⌋ M ′ − m is not less than 0, ~ y 1, ~ y 2,..., ~ y M'-K is an integer sequence of (M'-K) variables obtained from: g M ′ − K ⌊ x − ∑ m = 0 K − 1 C m M ′ ⌊ x M ′ ⌋ M ′ − m / C K M ′ ⌋ and λ M' is a remainder of dividing: x − ∑ m = 0 K − 1 C m M ′ ⌊ x M ′ ⌋ M ′ − m by M' C K. an integer transformer that obtains a plurality of integer values, hereinafter referred to as "transformed integers", through bijective transformation for each of integer values included in an inputted sequence of integer values and obtains a transformed integer sequence by arranging the transformed integers in predetermined order; and an integer encoder that obtains codes by Golomb-Rice encoding the transformed integers included in the transformed integer sequence, assuming that MB is the number of the transformed integers obtained through the transformation from one inputted integer value and x is an integer value included in the sequence of integer values, the integer transformer obtains the transformed integers y 1, y 2,..., y MB by calculating the following formula: y 1, y 2,..., y MB = g MB x where the function g M' is a recursive function that calculates the following formula if λ M ′ ≥ C K − i 1 M ′ − m − 1 y m + 1 = ⌊ x M ′ ⌋ λ M ′ = λ M ′ − C K − i 1 M ′ − m − 1 i 1 = i 1 + 1 otherwise y m + 1 = y ̃ i 2 + 1 i 2 = i 2 + 1 wherein i 1 =0 and i 2 =0 are initial values with respect to m=0, 1,..., M'-1, g 0 is a function that outputs nothing, ⌊ x M ′ ⌋ is a maximum M'-th order square root that does not exceed x, a C b is the number of combinations for selecting "b" integer values from "a" integer values, K is a maximum value when x − ∑ m = 0 K − 1 C m M ′ ⌊ x M ′ ⌋ M ′ − m is not less than 0, ~ y 1, ~ y 2,..., ~ y M'-K is an integer sequence of (M'-K) variables obtained from: g M ′ − K ⌊ x − ∑ m = 0 K − 1 C m M ′ ⌊ x M ′ ⌋ M ′ − m / C K M ′ ⌋ and λ M' is a remainder of dividing: x − ∑ m = 0 K − 1 C m M ′ ⌊ x M ′ ⌋ M ′ − m by M' C K. if λ M ′ ≥ C K − i 1 M ′ − m − 1 y m + 1 = ⌊ x M ′ ⌋ λ M ′ = λ M ′ − C K − i 1 M ′ − m − 1 i 1 = i 1 + 1 otherwise y m + 1 = y ̃ i 2 + 1 i 2 = i 2 + 1 wherein i 1 =0 and i 2 =0 are initial values with respect to m=0, 1,..., M'-1, g 0 is a function that outputs nothing, ⌊ x M ′ ⌋ is a maximum M'-th order square root that does not exceed x, a C b is the number of combinations for selecting "b" integer values from "a" integer values, K is a maximum value when x − ∑ m = 0 K − 1 C m M ′ ⌊ x M ′ ⌋ M ′ − m is not less than 0, ~ y 1, ~ y 2,..., ~ y M'-K is an integer sequence of (M'-K) variables obtained from: g M ′ − K ⌊ x − ∑ m = 0 K − 1 C m M ′ ⌊ x M ′ ⌋ M ′ − m / C K M ′ ⌋ and λ M' is a remainder of dividing: x − ∑ m = 0 K − 1 C m M ′ ⌊ x M ′ ⌋ M ′ − m by M' C K.