pdi {FunWithNumbers}R Documentation

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)

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.

Details

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

Value

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

Author(s)

Carl Witthoft, carl@witthoft.com


[Package FunWithNumbers version 1.2 Index]