Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- List of usual functions that can be used for counting:
- Got any ideas that aren't listed here? PM me on Reddit (/u/pie3636) and I'll gladly add them!
- ⇒ Template for symbol copy-pasting :
- − × ÷ √ ∛
- ⌊⌋ ⌈⌉ ||
- σ π φ ω Γ Ω µ ζ
- 𝜎 𝜋 𝜑 𝜔 𝛤 𝛺 𝜇 𝜁
- ⁰¹²³⁴⁵⁶⁷⁸⁹⁺⁻⁽⁾
- () [] {} <>
- Last edited 2017/05/07 - Added bitwise AND, OR and XOR.
- ⇒ Function/Operator Name Link
- ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
- Operators
- → + Addition https://en.wikipedia.org/wiki/Addition
- a + b = a + 1 + 1 + 1 + ... (add 1 "b times" to a, or add 1 "a times" to b). For example, 5 + 2 = 5 + 1 + 1 (adding 2 ones to 5), or 5 + 2 = 2 + 1 + 1 + 1 + 1 + 1 (adding 5 ones to 2)
- → - − Substraction https://en.wikipedia.org/wiki/Subtraction
- a - b = a - 1 - 1 - 1 + ... (take 1 "b times" from a). For example, 5 - 2 = 5 - 1 - 1 (taking 2 ones from 5). Unlike for the addition, a - b is generally different from b - a.
- → * × x ⋅ Multiplication https://en.wikipedia.org/wiki/Multiplication
- a × b = a + a + a + a + ... (add a "b times", or add b "a times"). For example, 5 × 2 = 5 + 5 (adding 2 fives), or 5 × 2 = 2 + 2 + 2 + 2 + 2 (adding 5 twos).
- → / ÷ : Division https://en.wikipedia.org/wiki/Division
- a ÷ b is the number of times you can take b from a until it reaches 0. For example, 12 ÷ 3 = 4 because 12 - 3 - 3 - 3 - 3 = 0 (four times). This is generally different from b ÷ a.
- → % mod Modulo https://en.wikipedia.org/wiki/Modulo_operation
- a % b is the remainder in the integer division of a by b. For example, 17 % 3 = 2 because 17 = 5 * 3 + 2 (17 divided by 3 gives a quotient of 5 and a remainder of 2)
- → ^ Exponentiation https://en.wikipedia.org/wiki/Exponentiation
- a ^ b = a × a × a × a × ... (multiply a "b times"). For example, 2 ^ 3 = 2 × 2 × 2 (multiplying 2 three times), also noted 2³. This is generally different from b ^ a. The convention is that n⁰ is 1. The value of 0⁰ is subject to controversy.
- → .n Decimal point https://en.wikipedia.org/wiki/Decimal_mark
- .2 means 0.2, .5 means 0.5, etc.
- → n' Repeating decimal https://en.wikipedia.org/wiki/Repeating_decimal
- For example, .2' (check the definition of the dot above) is 0.2222..., where the twos are repeated infinitely. This value is also equal to the fraction 2/9. Similarly, .3' = 1/3, etc.
- → n% Percentage https://en.wikipedia.org/wiki/Percentage
- n% is a way to write n / 100. For example, 2% = 2/100 = 0.02.
- → xy x@y Concatenation https://en.wikipedia.org/wiki/Concatenation
- xy means that we append the digits of y to those of x. For example, 7 and 8 can be concatenated into 78, or 52 and 17 into 5217. While it can be noted in several ways, it is advised to just write xy (or x@y for more complex expressions), since the other notations aren't always clear.
- → ↑^n Knuth's up-arrow https://en.wikipedia.org/wiki/Knuth%27s_up-arrow_notation
- a↑b means a ^ b. a↑↑b (also noted a↑²b) means a ^ a ^ a ^ a ^ ... (repeated b times). a↑↑↑b (noted a↑³b) means a ↑↑ a ↑↑ a ↑↑ a ↑↑ ... (b times), etc. a↑⁰b is equal to a × b (convention).
- → pt(n) Power tower
- pt(n) means n^n. For example, pt(3) means 3^3 = 27.
- → invert(n), i(n) Multiplicative inverse https://en.wikipedia.org/wiki/Multiplicative_inverse
- invert(n) means 1/n. For example, invert(2) is 1/2 = 0.5
- → AeB, AEB Scientific notation https://en.wikipedia.org/wiki/Scientific_notation
- AeB means A × 10^B. For example, 1e3 means 1 × 10³ = 1,000.
- → <<, >> Bitwise shift https://en.wikipedia.org/wiki/Arithmetic_shift
- A << B means A * 2^B. A >> B means floor(A / 2^B). Special cases may arise with large numbers; check the article for more information.
- → &, &&, AND, ∧ Bitwise AND https://en.wikipedia.org/wiki/Bitwise_operation#AND
- A & B is the intersection of the binary representations of A and B. For example, 19 is 10110 and 22 is 10011 in binary, and 10110 & 10011 is 10011 (each digit of the result is 1 if and only if both corresponding digits of A and B were 1s), which is binary for 18. Therefore 19 & 22 = 18. Check http://www.convertforfree.com/bitwise-calculator/ if you don't want to have to make those calculations on your own.
- → |, ||, OR, ∨ Bitwise OR https://en.wikipedia.org/wiki/Bitwise_operation#OR
- A | B is the union of the binary representations of A and B. For example, 9 is 1001 and 10 is 1010 in binary, and 1001 & 1010 is 1011 (each digit of the result is 1 if and only if at least one of the corresponding digits of A and B was a 1), which is binary for 11. Therefore 9 | 10 = 11. Check http://www.convertforfree.com/bitwise-calculator/ if you don't want to have to make those calculations on your own.
- → ¬, ~, NOT, N Bitwise NOT https://en.wikipedia.org/wiki/Bitwise_operation#NOT
- ¬A is the negation of the binary representation of A. For example, 9 is 1001, and the negation (binary complement) of 1001 is 0110, or 110 (each digit of the result is 1 if and only if the corresponding digit of A was a 0), which is binary for 6. Therefore ¬9 = 6. Check http://www.convertforfree.com/bitwise-calculator/ if you don't want to have to make those calculations on your own.
- → ⊕, XOR, ⊻, ↮, ≢ Bitwise XOR https://en.wikipedia.org/wiki/Bitwise_operation#XOR
- A | B is the difference of the binary representations of A and B. For example, 9 is 1001 and 10 is 1010 in binary, and 1001 & 1010 is 110 (each digit of the result is 1 if and only if exactly one of the corresponding digits of A and B was a 1), which is binary for 6. Therefore 9 | 10 = 6. Check http://www.convertforfree.com/bitwise-calculator/ if you don't want to have to make those calculations on your own.
- → () [] {} <> Parenthesing https://en.wikipedia.org/wiki/Order_of_operations
- Parenthesing is used to describe the order of operations. For example, if you want to calculate 2 × (3 + 4), you need to calculate the value between parenthesis first : 3 + 4 = 7, then do the remaining multiplication. When in presence of several layers of parenthesis, always begin with the innermost ones.
- Factorials
- → n! Factorial https://en.wikipedia.org/wiki/Factorial
- n! = 1 × 2 × 3 × ... × n. For example, 6! = 1 × 2 × 3 × 4 × 5 × 6 = 720. The convention is that 0! = 1.
- → n!! Double factorial n × (n - 2) × (n - 4) × ... × (either 2 or 1) https://en.wikipedia.org/wiki/Double_factorial
- n!! = n × (n - 2) × (n - 4) × ... × (either 2 or 1). For example, 5!! = 5 × 3 × 1 = 15, but 6!! = 6 × 4 × 2 = 48. The multiplication stops when you reach 2 (if n is even) or 1 (if n is odd). This is not to be confused with (n!)!, which is the factorial of n!, that is, the factorial of the factorial of n.
- → sf(n) n? Superfactorial https://en.wikipedia.org/wiki/Factorial#Superfactorial
- sf(n) = 1! × 2! × 3! × 4! × ... × n!. For example, sf(4) = 1! × 2! × 3! × 4! = 288.
- → H(n) Hyperfactorial https://en.wikipedia.org/wiki/Factorial#Hyperfactorial
- H(n) = 1¹ × 2² × 3³ × ... × n^n. For example, H(3) = 1¹ × 2² × 3³ = 108
- → Γ(n) gamma(n) Gamma function https://en.wikipedia.org/wiki/Gamma_function
- Γ(n) is basically (n - 1)! if n is an integer (see: factorial)
- Trigonometric functions
- → sin(n) Sine https://en.wikipedia.org/wiki/Sine
- sin(n) can best be described as the y coordinate of the point of the unit circle such as the angle between the x axis, the center of the circle and this point is n. Check the wikipedia article for a better explanation.
- → cos(n) Cosine https://en.wikipedia.org/wiki/Cosine
- cos(n) is the x coordinate of the point of the unit circle defined right above.
- → tan(n), sec(n), csc(n) and cot(n) or ctg(n) are other functions that can be defined using sin(n) and cos(n). Please check Wikipedia for more information.
- → arcsin(n) asin(n) asn(n) sin^-1(n) Arcsine https://en.wikipedia.org/wiki/Inverse_trigonometric_functions
- arcsin is the inverse function of sin, meaning that arcsin(n) is the number x such as sin(x) = n and x belongs to a specific interval.
- → arccos(n) acos(n) acs(n) cos^-1(n) Arccosine https://en.wikipedia.org/wiki/Inverse_trigonometric_functions
- arccos is the inverse function of cos (check arcsin for a definition).
- → arctan(n) atan(n) atn(n) tan^-1(n) Arctangent https://en.wikipedia.org/wiki/Inverse_trigonometric_functions
- arctan is the inverse function of tan (check arcsin for a definition).
- → arcsec(n) asec(n) sec^-1(n) Arcsecant https://en.wikipedia.org/wiki/Inverse_trigonometric_functions
- arcsec is the inverse function of sec (check arcsin for a definition).
- → arccsc(n) acsc(n) csc^-1(n) Arccosecant https://en.wikipedia.org/wiki/Inverse_trigonometric_functions
- arccsc is the inverse function of csc (check arcsin for a definition).
- → arccot(n) acot(n) cot^-1(n) ctg^-1(n) Arccotangent https://en.wikipedia.org/wiki/Inverse_trigonometric_functions
- arccot is the inverse function of cot (check arcsin for a definition).
- General functions
- → exp(n) Exponential function https://en.wikipedia.org/wiki/Exponential_function
- exp(n) = e^n, where e ~ 2.718281828. exp(a + b) = exp(a) × exp(b), and exp(ab) = exp(a) ^ b. a ^ b can also be noted exp(b × ln(a)).
- → ln(n) Logarithm https://en.wikipedia.org/wiki/Logarithm
- ln is the inverse function of exp (check arcsin for a definition). ln(a × b) = ln(a) + ln(b), and ln(a ^ b) = b × ln(a).
- → log(n) log10(n) lg(x) Common logarithm https://en.wikipedia.org/wiki/Common_logarithm
- log(n) is ln(n)/ln(10). For example, log(10) = 1, log(100) = 2 and log(1000) = 3.
- → √n sqrt(n) Square root https://en.wikipedia.org/wiki/Square_root
- √n is the only positive number so that √n × √n = n. For example, √9 = 3 because 3 × 3 = 9.
- → ∛n cbrt(n) Cube root https://en.wikipedia.org/wiki/Cube_root
- ∛n is the only positive number so that ∛n × ∛n × ∛n = n. For example, ∛8 = 2 because 2 × 2 × 2 = 8.
- → |n| abs(n) Absolute value https://en.wikipedia.org/wiki/Absolute_value
- |n| is the only positive value of n and -n. If n > 0, then |n| = n, otherwise |n| = -n. Another way to put it is that |n| is n after you 'drop' the sign (+ or ─) before it.
- → floor(n) ⌊n⌋ Floor function https://en.wikipedia.org/wiki/Floor_and_ceiling_functions
- ⌊n⌋ is the integer right before n (included). For example, ⌊5⌋ = 5, and ⌊4.5⌋ = 4. Another way to put is is that ⌊n⌋ is n after you dropped the part after the decimal point.
- → ceil(n) ⌈n⌉ Ceiling function https://en.wikipedia.org/wiki/Floor_and_ceiling_functions
- ⌈n⌉ is the integer right after n (included). For example, ⌈5⌉ = 5, and ⌈4.5⌉ = 5. Another way to put is is that ⌈n⌉ is n if n is an integer, otherwise it's n + 1.
- → A(n) Ackermann function https://en.wikipedia.org/wiki/Ackermann_function
- A complicated function (check the Wikipedia article if you want to know the definition). There are only a couple interesting values of this function, see below.
- → R(n) Backwards function
- R(n) is n written backwards. For example, R(123456) = 654321, R(598) = 895, etc.
- → p(n) Partition function https://en.wikipedia.org/wiki/Partition_(number_theory)
- p(n) is the number of partitions of n, meaning the number of ways to decompose n into a sum of integers. For example, 4 can be written as (1 + 1 + 1 + 1), (1 + 1 + 2), (1 + 3), (2 + 2), and (4). There are 5 partitions of 4, therefore p(4) = 5.
- → µ(n) mu(n) Möbius function https://en.wikipedia.org/wiki/M%C3%B6bius_function
- Another complicated function, check the link to know more.
- → sgn(n) Sign function https://en.wikipedia.org/wiki/Sign_function
- sgn(n) is 0 if n = 0, 1 if n is positive, and -1 if n is negative. For example, sgn(5) = sgn(8) = 1, but sgn(-3) = sgn(-7) = -1.
- → F(n) Fibonacci sequence https://en.wikipedia.org/wiki/Fibonacci_number
- F(0) = 0, F(1) = 1. The other values are constructed by adding the two previous ones. For example, F(2) = F(1) + F(0) = 1, F(3) = F(2) + F(1) = 2, etc.
- → T(n) Tribonacci sequence https://en.wikipedia.org/wiki/Generalizations_of_Fibonacci_numbers#Tribonacci_numbers
- T(0) = 0, T(1) = 0, and T(2) = 1. The other values are constructed by adding the three previous ones. For example, T(3) = T(2) + T(1) + T(0) = 1, T(4) = T(3) + T(2) = T(1) = 2, etc.
- → C(n) Catalan numbers https://en.wikipedia.org/wiki/Catalan_number
- C(n) = (2n)!/((n+1)n!)
- → B(n, k) Binomial coefficient https://en.wikipedia.org/wiki/Binomial_coefficient
- B(n, k) = n!/(k!(n-k)!)
- → binarybeanstalk(n) OEIS Sequence A179016 http://oeis.org/A179016
- This is an obscure sequence so that s(0) = 0, and the other values are computer so that s(n) = s(n-1) + [the number of ones in the binary representation of s(n)].
- Primes
- → σ(n) sigma(n) Divisor function https://en.wikipedia.org/wiki/Divisor_function
- σ(n) is the sum of all the divisors of n. For example, the divisors of 6 are 1, 2, 3 and 6 (because 6 = 1 × 6 = 2 × 3), therefore σ(6) = 1 + 2 + 3 + 6 = 12.
- → σ_x(n) sigma_x(n) Divisor function https://en.wikipedia.org/wiki/Divisor_function
- σ_x(n) is just like σ(n), except that each divisor is taken to the power of x before being added. For example, σ_3(6) = 1³ + 2³ + 3³ + 6³ = 252.
- → s(n) Divisor function https://en.wikipedia.org/wiki/Divisor_function
- s(n) is the sum of all the divisors of n but n, meaning that s(n) = σ(n) - n. For example, s(6) = 1 + 2 + 3 = 6.
- → d(n) Divisor function https://en.wikipedia.org/wiki/Divisor_function
- d(n) is the number of divisors of n. For example, 6 is divisible by 1, 2, 3 and 6, therefore d(6) = 4 (there are 4 divisors).
- → π(n) pi(n) https://en.wikipedia.org/wiki/Prime-counting_function
- π(n) is how many numbers are lesser than n and are primes. For example, 2, 3, 5, 7 and 11 are the only primes that are lesser than 12, therefore π(12) = 5. The page https://en.wikipedia.org/wiki/List_of_prime_numbers might help compute those values.
- → P(n) https://en.wikipedia.org/wiki/Formula_for_primes
- P(n) is the nth prime number, starting with P(1) = 2. For example, P(5) = 11. A prime is a number which has exactly 2 divisors, 1 and itself. 1 isn't considered a prime, but 2 is (2 = 1 × 2), and 4 isn't (4 is divisible by 1, 2 and 4). The page https://en.wikipedia.org/wiki/List_of_prime_numbers gives a list of the first values of P(n).
- → nonprime(n) composite(n) Nonprime function https://en.wikipedia.org/wiki/Composite_number
- nonprime(n) is the nth nonprime number. For example, n(4) = 9 because 4, 6, 8 and 9 are the first nonprimes (1 is not considered a composite number, despite not being a prime either).
- → φ(n) phi(n) Totient function https://en.wikipedia.org/wiki/Euler's_totient_function
- φ(n) is how many numbers lesser than n are relatively prime to n, meaning that they share no common divisor with n aside from 1. For example, 2 is relatively prime to 7 but no to 8 (2 and 8 are both divisible by 2). For example, φ(4) = 2 because 1 and 3 are relatively prime to 4, but 2 isn't.
- → sumtotient(n) http://oeis.org/A002088
- sumtotient(n) is the sum of the n first value of φ(n). For example, sumtotient(4) = φ(1) + φ(2) + φ(3) + φ(4) = 6.
- → ω(n) omega(n) Distinct prime factors https://en.wikipedia.org/wiki/Prime_factor#Omega_function
- ω(n) is the number of distinct prime factors of n. For example, 12 can be decomposed (like any composite number) into the product of primes 2 × 2 × 3, and there are two different primes, therefore ω(12) = 2.
- → Ω(n) Omega(n) Prime factors https://en.wikipedia.org/wiki/Prime_factor#Omega_function
- Ω(n) is the number of total prime factors of n. For example, 12 can be decomposed into the product of primes 2 × 2 × 3, and there are three terms, therefore Ω(12) = 3.
- → ζ(n) zeta(n) Riemann zeta function https://en.wikipedia.org/wiki/Riemann_zeta_function
- zeta(n) is defined as the sum of (the inverse of all natural numbers raised to the nth power). For example, zeta(2) = 1 + 1/2² + 1/3² + ... = π²/12. This is an important and famous function.
- → p_n# Primorial https://en.wikipedia.org/wiki/Primorial
- p_n# is the product of the n first primes. For example, p_4# = P(1) × P(2) × P(3) × P(4) = 2 × 3 × 5 × 7 = 210.
- ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
- Functionality :
- Here are a list of useful values for the functions above. If you don't know how to find the solution to a number, try looking at these. Another common approach is to find the prime factors of the number you're trying to reach, and to then obtain those numbers, which is often easier.
- arcsin(1) = 90
- arcsin(1/2) = 30
- arccos(0) = 90
- arccos(1/2) = 60
- arctan(1) = 45
- http://functions.wolfram.com/ElementaryFunctions/ArcSec/03/01/
- http://functions.wolfram.com/ElementaryFunctions/ArcCsc/03/01/
- http://functions.wolfram.com/ElementaryFunctions/ArcCot/03/01/
- sgn(n > 0) = 1
- 2↑↑3 = 16
- 3↑↑2 = 27
- A (n, m) → n │ 0 1 2 3 4 5 6 7 8 9
- ↓ m ──────────┼──────────────────────────────────────────────────────────────────────────────
- 1 │ 2 3 4 5 6 7 8 9 10 11
- 2 │ 3 5 7 9 11 13 15 17 18 19
- 3 │ 5 13 29 61 125 253 509 1019 2045 4093
- 4 │ 13
- n 1 2 3
- A(n) 3 7 61
- ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
- n 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
- F(n) 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 2584 4181
- ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
- n 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
- T(n) 1 1 2 4 7 13 24 44 81 149 274 504 927 1705 3136 5768
- ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
- n 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
- p(n) 2 3 5 7 11 15 22 30 42 56 77 101 135 176 231 297 385 490 627
- n 21 22 23 24 25 26 27 28 29
- p(n) 792 1002 1255 1575 1958 2436 3010 3718 4565
- ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
- n 3 4 5 6 7 8 9
- C(n) 5 14 42 132 429 1430 4862
- ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
- n 1 2 3 4 5
- p#n 2 6 30 210 2310
- ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
- n 3 4 5 6 7
- n! = Γ(n+1) 6 24 120 720 5040
- ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
- n 4 5 6 7 8 9 10
- n!! 8 15 48 105 384 945 3840
- ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
- n 3 4
- sf(n) 12 288
- ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
- n 2 3
- H(n) 3 108
Add Comment
Please, Sign In to add comment