factordb
Sign in

Expression syntax

The search box takes far more than a plain number. You can type an arithmetic expression and the server evaluates it to a single integer, then looks that number up (or, with Create, adds it). Whitespace is ignored, and multiplication may be left implicit: 2(3+4) means 2*(3+4). Reading never stores anything.

Every result is capped at about 10 000 000 digits, and each function below has a fixed input ceiling chosen so a single evaluation stays near 3 seconds. Over the ceiling the request is declined rather than run.

Operators

OperatorMeaningExample
+   -Addition, subtraction2^100-2^50+1
*   /Multiplication, exact division (the result must be a whole number)(2^101+1)/3
^Power (right-associative: 2^3^2 = 2^(3^2))2^127-1
%Modulo (remainder)2^100%1000000007
\Integer division: a\b = ⌊a/b⌋, the quotient rounded down (same precedence as * / %)2^100\7+1
|Numerator: a|b = a/gcd(a,b), the numerator of the fraction a/b in lowest terms (10|4 = 5, as 10/4 = 5/2; same precedence as * / %)100!|10^50
( )Grouping(10^500-1)/9

Intermediate values may be negative, but the final result may not - 3-5 is rejected. There is no unary minus, with one exception: a function argument may start with a minus sign, as in U(20,1,-1) (read as 0-1).

Shortcuts

FormMeaningExample
Mn   FnShort for M(n) and F(n), the Mersenne and Fermat numbers (see Named functions)M127
n!Factorial1000!
n#Primorial - product of all primes ≤ n100#
n##   n~Product of the first n primes10##
odd(n)Odd part of n - n with all its factors 2 removed (A000265)odd(100!)
n?Least common multiple of 1, 2, …, n - every prime ≤ n to its highest power ≤ n (A003418)1000?
gcd(a,b,…)   lcm(a,b,…)Greatest common divisor and least common multiple of 2 to 16 arguments; the arguments of one expression may have at most 1,000,000 digits togethergcd(2^600-1,2^900-1)
I(n)   fib(n)Fibonacci numberI(5000)
Ln   lucas(n)Lucas numberlucas(5000)
b,n+   b,n-Shorthand for bn±12,127-
#idThe stored number with that database id (used inside a larger expression)#1100000000000000001/31

Named functions

Each is written NAME(argument, …). Every argument may itself be an expression, so Q(5+5) and 2^Q(50)-1 are fine, and functions nest: Q(Z(10)). The right-hand column is the largest input accepted (matched to the ~3 second budget); for the families marked † a very large parameter is also declined early when the result would exceed the digit limit.

FunctionMeaningOEISExampleMax input
A(n)Alternating factorial, n!-(n-1)!+…A005165A(100)n ≤ 2 M
B(n)Bell numbers ‡A000110B(100)n ≤ 100 k
C(m,n)Cyclotomic polynomial Φm evaluated at n  (C(12,10) = 9901; Φ0 = 1, as 0^0 and 0!)A019320 A253240C(1500,10)nm ≤ 107 digits
D(n)Partitions into distinct parts ‡A000009D(1000)n ≤ 6·107
E(n)Euler zigzag numbers ‡A000111E(100)n ≤ 100 k
F(n)Fermat number 22n+1A000215F(5)n ≤ 24
G(m,n)Numerator of 1/p1m + 1/p2m + … + 1/pnm over the first n primesA024451/A061015G(1,100)result ≤ 7·106 digits
H(m,n)Metallic m-Fibonacci: F=m·F-1+F-2  (m=1 Fibonacci, m=2 Pell)A000045/A000129H(2,100)† n ≤ 50 M
I(m,n)m-step Fibonacci (sum of the previous m terms, starting 0,…,0,1; m=2 Fibonacci, m=3 tribonacci)A000073…I(3,100)m3·n ≤ 5.4·108
J(n)Coefficient of qn of the modular invariant j = 1/q + 744 + 196884q + … ‡A000521J(100)n ≤ 107
K(n)Sum of factorials, 1!+2!+…+n!A007489K(100)n ≤ 2 M
L(m,n)Metallic m-Lucas: L=m·L-1+L-2, L0=2, L1=m  (m=1 Lucas, m=2 Pell-Lucas)A000032/A002203L(2,100)† n ≤ 50 M
M(n)Mersenne number 2n-1A000225M(127)n ≤ 33 M
N(m,n)Multifactorial n·(n-m)·(n-2m)·…  (m=1 is the factorial, m=2 the double factorial)-N(2,7)n ≤ 4 M
O(n)Ordered Bell (Fubini) numbers ‡A000670O(100)n ≤ 100 k
P(n)Partition numbers §A000041P(1000)n ≤ 1010
Q(n)Perrin numberA001608Q(1000)n ≤ 30 M
R(m,n)Repunit - n ones in base m, i.e. (mn-1)/(m-1)A002275R(10,5)† n ≤ 20 M
S(m,n)Smarandache - concatenate 1,2,…,n written in base mA007908S(10,6)n ≤ 2.5 M
U(n,p,q)Lucas sequence Un(p,q): U=p·U-1-q·U-2, U0=0, U1=1-U(20,1,-1)† n ≤ 50 M
V(n,p,q)Lucas sequence Vn(p,q): V=p·V-1-q·V-2, V0=2, V1=p-V(20,1,-1)† n ≤ 50 M
W(m,n)Numerator of 1 + 1/2m + … + 1/nm  (m=1 harmonic numbers, m=2 Wolstenholme numbers)A001008/A007406W(2,100)m·log10(n!) ≤ 5·106
X(m,n)Smarandache-Wellin - concatenate the first n primes written in base mA019518X(10,100)† n ≤ 2 M
Y(m,n)m-step Lucas (sum of the previous m terms)A001644…Y(3,100)m3·n ≤ 5.4·108
Z(n)Motzkin number ‡A001006Z(500)n < 20.8 M
@(n)The n-th prime (1-based: @(1) is 2) ‡A000040@(1000000)n ≤ 6.5·1012
$(n)Padovan numberA000931$(1000)n ≤ 40 M
&(n)Narayana's cowsA000930&(1000)n ≤ 30 M

The Lucas U/V parameters p and q may be negative - U(20,1,-1) is the Fibonacci numbers (p=1, q=-1) and V(20,1,-1) the Lucas numbers. With q = 1 or q = -1 the index may be negative too: U(-n,p,q) = -q-n·U(n,p,q) and V(-n,p,q) = q-n·V(n,p,q), e.g. U(-7,3,-1). Repunit and Smarandache bases must be at least 2, and the multifactorial step at least 1. I(n) and lucas(n) with one argument stay the Fibonacci and Lucas numbers; with two arguments they are the m-step Fibonacci and m-Lucas numbers.

‡ Read from precomputed tables - these values are not computed on request. A value the table does not hold yet is reported as such. @(n) starts from a table of every 10,000th prime and sieves only the short rest. Z(n) likewise continues from a table of every 10,000th Motzkin number (with the one before it), at most 9,999 steps.

§ Computed on request (FLINT's Hardy-Ramanujan-Rademacher formula: P(1010), 111,391 digits, takes about 0.4 s). One expression may use at most 4 different n above 109.

Arithmetic functions

These are computed from the complete factorization of their argument n ≥ 1. A number below 264 is factored on the spot; a larger one must be stored here and fully factored (every factor prime or probable prime) - otherwise the expression is not accepted. A number stored with such a term keeps it, and its value is read from that factorization.

FunctionMeaningOEISExample
rad(n)Radical - the product of the distinct prime factorsA007947rad(10!)
core(n)Squarefree part - n/core(n) is a squareA007913core(10!)
eulerphi(n)Euler's totient - the numbers up to n coprime to nA000010eulerphi(2^128+1)
dedekindpsi(n)Dedekind's psi - n times the product of (1+1/p) over its primesA001615dedekindpsi(2^128+1)
carmichaellambda(n)Carmichael's lambda - the least m with am = 1 (mod n) for every a coprime to nA002322carmichaellambda(2^256+1)
sigma(n,k)Sum of the k-th powers of the divisors; sigma(n) = sigma(n,1) is the sum of the divisors, sigma(n,0) their numberA000203/A000005sigma(2^256+1)
omega(n)Number of distinct prime factorsA0012212^omega(10!)+1
bigomega(n)Number of prime factors counted with multiplicityA0012222^bigomega(10!)-1