22 votes

Find the sum of the divisors of N

05AB1E, 2 bytes ÑO Try it online! How? Ñ Divisors O Sum
H.PWiz's user avatar
  • 11.6k
17 votes

Am I not good enough for you?

Brachylog, 4 bytes fk+? Try it online! The predicate succeeds for perfect inputs and fails for imperfect inputs, printing ...
Unrelated String's user avatar
16 votes

Prime factors buddies

PowerShell v3+, 450 bytes ...
AdmBorkBork's user avatar
  • 43.4k
15 votes

Calculate the prime factors

Python 2, 55 bytes f=lambda n,k=2:n/k*[0]and(f(n,k+1),[k]+f(n/k,k))[n%k<1] Try it online!
Dennis's user avatar
  • 210k
15 votes

Calculate the prime factors

Pyth, 1 byte P I like Pyth's chances in this challenge.
isaacg's user avatar
  • 42k
14 votes
Accepted

Encode an integer

Husk, 35 31 30 29 26 25 24 22 20 19 15 bytes -7 bytes thanks to @Zgarb! Saved an extra 4 bytes, indirectly, thanks to Zgarb ḋhΣhgφṁȯ`Jḋ2⁰ṗp Try it online! ...
H.PWiz's user avatar
  • 11.6k
14 votes

Prime Factorization - but on the exponents too

Jelly, 15 bytes ¹ÆFṛÇṭ¥Ị?@/€$Ẓ? Try it online! A full program that takes the number and outputs the answer. This isn't a link because I am using "last link&...
hyper-neutrino's user avatar
  • 42.4k
12 votes
Accepted

Find the prime factors

SageMath, 31 Bytes N=input() print N,"=",factor(N) Test case: ...
12431234123412341234123's user avatar
11 votes

Calculate the prime factors

Python 2, 53 bytes f=lambda n,i=2:n/i*[f]and[f(n,i+1),[i]+f(n/i)][n%i<1] Tries each potential divisor i in turn. If ...
xnor's user avatar
  • 145k
11 votes

Find the Squarish Root

Python3, 49 47 bytes def f(x): l=x**.5//1 while x%l:l-=1 return l Explanation l=x**.5//1 → Assign ...
hunteke's user avatar
  • 211
11 votes

Am I not good enough for you?

Neim, 3 bytes 𝐕𝐬𝔼 Try it online! (I don't actually know how to run all of the test cases at once, since I started learning Neim about fifteen minutes ago, ...
Unrelated String's user avatar
10 votes
Accepted

Generate n-ary numbers

Jelly, 12 bytes Æf*³<‘Ạ 1Ç#Ṫ Takes n and k (one-indexed) as command-line arguments. Try it online! How it works ...
Dennis's user avatar
  • 210k
10 votes

Infinitely many primes

JavaScript (ES6),  45  44 bytes Takes input as (n)(p1), where \$n\$ is 0-indexed. ...
Arnauld's user avatar
  • 192k
10 votes

"Factorise" a quadratic

Scala 3, 49 44 bytes a=>b=>(-b*b to b*b)map(p=>a-p->p)find(_*_==b) Try it onlne! Takes (a)(b) and returns an ...
user's user avatar
  • 307
9 votes

Is my number Unique

Husk, 11 10 bytes Saved one byte thanks to Zgarb! Ωεo?oṗ←¬Ep Returns 1 for unique, 0 ...
H.PWiz's user avatar
  • 11.6k
9 votes

Am I not good enough for you?

R, 33 29 bytes !2*(n=scan())-(x=1:n)%*%!n%%x Try it online! Returns TRUE for perfect numbers and ...
Giuseppe's user avatar
  • 28.5k
9 votes

Infinitely many primes

05AB1E, 6 bytes This produces and infinite output stream. λλP>fW Try it online! (link includes a slightly modified version, ...
Mr. Xcoder's user avatar
  • 42.4k
9 votes

Looks prime to me!

Haskell, 53 bytes f b=[x|x<-[b..],k<-[2..x-1],mod x k+gcd(b^3-b)x<2]!!0 Try it online!
Lynn's user avatar
  • 68.7k
9 votes

"Factorise" a quadratic

JavaScript (ES7),  37 36 34  31 bytes Saved 3 bytes thanks to @tsh Expects (a)(b). a=>b=>[b=a/2+(a*a/4-b)**.5,a-b] Try ...
Arnauld's user avatar
  • 192k
9 votes

"Factorise" a quadratic

Wolfram Language (Mathematica), 23 21 18 bytes Solve[x x+#2==x#]& Try it online!
att's user avatar
  • 20.4k
8 votes

Prime factors buddies

CJam, 26 23 bytes {_mfs$:XW%i){mfs$X=},^} Try it online Explanation Concatenating two numbers always gives a bigger result than multiplying them. So the ...
Martin Ender's user avatar
8 votes

Calculate the prime factors

Mathematica, 38 30 bytes Thanks @MartinEnder for 8 bytes! Join@@Table@@@FactorInteger@#&
JungHwan Min's user avatar
  • 13.8k
8 votes

Encode an integer

Jelly,  22 20  19 bytes -1 thanks to Erik the Outgolfer (tail zeros from both sides, t, rather than from the right œr)...
Jonathan Allan's user avatar
8 votes

Largest Prime Exponents

05AB1E, 2 bytes ÓZ Try it online! How? Ó exponents of prime factors Z maximum
Uriel's user avatar
  • 13.2k
8 votes

Largest Prime Exponents

Python 2, 62 57 56 bytes lambda n:max(k%n-n%(k/n+2)**(k%n)*n for k in range(n*n)) Try it online!
Dennis's user avatar
  • 210k
8 votes

Prime Factor Encoding

05AB1E, 13 bytes Encoder, 8 bytes 0ì¥ĀηOØP Try it online! Explanation ...
Emigna's user avatar
  • 53k
8 votes

Find the Squarish Root

MATL, 7 bytes Z\tn2/) Try it online! For this explanation, we will use '12' as a sample input. Explanation: ...
DJMcMayhem's user avatar
  • 59.2k
8 votes

Am I not good enough for you?

Japt -!, 4 bytes ...
Luis felipe De jesus Munoz's user avatar
8 votes

Looks prime to me!

JavaScript (ES6),  91 83 79  76 bytes f=(b,n=b,k=n)=>(g=d=>k<2?d<n:k%d?g(d+1):b*~-b*~b%d&&g(d,k/=d))(2)?n:f(b,n+1) Try it online! How? Given ...
Arnauld's user avatar
  • 192k
7 votes

Find the sum of the divisors of N

x86-64 Machine Code, 23 bytes 89 F9 89 FE EB 0D 89 F8 99 F7 F1 85 D2 99 0F 44 D1 01 D6 E2 F1 96 C3 The above bytes of code define a function that accepts a single ...
Cody Gray - on strike's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible