Function reference · Algebra

pfactor

Returns the repeated prime factors of a positive integer in ascending order.

pfactor(n) uses Nerdamer's exact integer factorization and returns a Vector containing each prime once for every occurrence.

Examples

These examples use Nerdamer Notation.

Return repeated prime factors in ascending order.

pfactor(100)
// → [2, 2, 5, 5]

Interfaces

The same operation is available through the interfaces below.

Nerdamer Notation · nerdamer API · Direct API

Nerdamer Notation

Use this form inside input passed to nerdamer(...).

pfactor(value)

Parameters

  • value — Positive integer to prime-factor.

nerdamer.pfactor

Call the operation through the default nerdamer import.

nerdamer.pfactor(x: ExpressionInput): Vector

Parameters

NameTypeDescription
xExpressionInput—

Returns

Vector

Browse the nerdamer API →

Direct JavaScript / TypeScript API

Import the operation directly from its package entry point.

import { pfactor } from 'nerdamer/algebra';
pfactor(x: ExpressionInput): Vector

Parameters

NameTypeDescription
xExpressionInput—

Returns

Vector

Browse nerdamer/algebra →

← Back to Function reference