Previous Page Next Page Contents

numlib::sigma -- sum of divisors of an integer

Introduction

numlib::sigma(n) returns the sum of the positive divisors of n.

numlib::sigma(n, k) returns the sum of the k-th powers of the positive divisors of n.

Call(s)

numlib::sigma(n)
numlib::sigma(n, k)

Parameters

n - an integer
k - a nonnegative integer

Returns

numlib::sigma returns an integer.

Related Functions

numlib::divisors, numlib::numdivisors

Details

Example 1

The sum of the positive divisors of is 360:

>> numlib::sigma(120)
                                    360

Example 2

The sum of the fifth powers of the positive divisors of is 25799815800:

>> numlib::sigma(120,5)
                                25799815800

Background

Changes




Do you have questions or comments?


Copyright © SciFace Software GmbH & Co. KG 2000