Learn R Programming

FunWithNumbers (version 1.2)

pdi: Calculate Perfect Digital Invariant ~~

Description

This function calculates PDI, defined as the sum of a number's digits raised to a given power.

Usage

pdi(x, pwr = 2, base = 10)

Value

The PDI of the input value and base, as a bigz integer.

Arguments

x

The bigz integer to start with.

pwr

The power to which digits are raised. Default is 2.

base

The base of the source integer. Note that calculations within this function are performed in base 10. Default is 10.

Author

Carl Witthoft, carl@witthoft.com

Details

This is a helper function for dontWorry. Use at your own risk.