Skip to content

IsComposite ​

Generated from the engine's own definition: compute-engine's symbol, which we neither extend nor document by hand.

IsComposite(n) returns True if n is a composite number

✓ checked against that system · ! checked, with disagreements (hover a chip)Wolfram LanguageCompositeQ!
IsComposite(number) -> booleanas compute-engine declares it
Rustis_composite(number)
IsComposite(z)for a complex zz, whether it is composite in Z[i]\mathbb{Z}[i] (neither zero, a unit nor a Gaussian prime), so 3+i=(1+i)(2−i)3 + i = (1 + i)(2 - i) is.
Rustis_composite(z)
Typed signatures
TypePackageApplies
(number | quadratic_integer, any*) -> booleannumber-theoryreplaces compute-enginealways
(number) -> booleancompute-enginealways

Domain: Compute engine

Examples

2 more kept as data, checked against the oracles
Basic #

The smallest composite number

live ↗
InIsComposite(4)\mathrm{IsComposite}(4)OutTrue\mathrm{True}

A prime is not composite

live ↗
InIsComposite(13)\mathrm{IsComposite}(13)OutFalse\mathrm{False}
Scope #

A huge number decided without factoring it

live ↗
InIsComposite(1+103 000)\mathrm{IsComposite}(1+10^{3\,000})OutTrue\mathrm{True}

Threads over a list; 1 is neither prime nor composite

live ↗
InIsComposite([1,2,3,4,5,6])\mathrm{IsComposite}(\bigl\lbrack1, 2, 3, 4, 5, 6\bigr\rbrack)Out[False,False,False,True,False,True]\bigl\lbrack\mathrm{False}, \mathrm{False}, \mathrm{False}, \mathrm{True}, \mathrm{False}, \mathrm{True}\bigr\rbrack

Primes are never composite

live ↗
InIsComposite(5)\mathrm{IsComposite}(5)OutFalse\mathrm{False}
live ↗
InIsComposite(3+i)\mathrm{IsComposite}(3+i)OutTrue\mathrm{True}
Properties #

A power of two beyond 2 is composite

live ↗
InIsComposite(8)\mathrm{IsComposite}(8)OutTrue\mathrm{True}

Has the proper divisors 2, 3, 4, 6

live ↗
InIsComposite(12)\mathrm{IsComposite}(12)OutTrue\mathrm{True}

A prime just past 64, so not composite

live ↗
InIsComposite(67)\mathrm{IsComposite}(67)OutFalse\mathrm{False}

A perfect number, 28=22⋅728 = 2^2\cdot 7, is composite

live ↗
InIsComposite(28)\mathrm{IsComposite}(28)OutTrue\mathrm{True}

Highly divisible, with many proper divisors

live ↗
InIsComposite(60)\mathrm{IsComposite}(60)OutTrue\mathrm{True}

A large perfect power, 5115^{11}, caught as composite

live ↗
InIsComposite(48 828 125)\mathrm{IsComposite}(48\,828\,125)OutTrue\mathrm{True}
About
Examples14
Checked againstWolfram Language 12 agree2 differSymPy 13 agree1 errorJulia 11 agree2 differ1 errorRust 10 agree3 error
CrosswalkWolfram LanguageRust

Implementation

mappedjuliapackages/oracle/src/mappings.ts
mappedrustpackages/oracle/src/mappings.ts

Greater than 1 and not prime.

mappedsympypackages/oracle/src/mappings.ts

Greater than 1 and not prime; a negative integer is not composite here.