Skip to main content
Commonmark migration
Source Link

Haskell, 61 60 50 48 46 bytes

-2 bytes thanks to xnor

f n=maximum[a|k<-[2..n],a<-[1..n],n`mod`k^a<1] 

Try it online!

###45 bytes with an import:

45 bytes with an import:

import NumberTheory maximum.map snd.factorize 

Try it Online!

Haskell, 61 60 50 48 46 bytes

-2 bytes thanks to xnor

f n=maximum[a|k<-[2..n],a<-[1..n],n`mod`k^a<1] 

Try it online!

###45 bytes with an import:

import NumberTheory maximum.map snd.factorize 

Try it Online!

Haskell, 61 60 50 48 46 bytes

-2 bytes thanks to xnor

f n=maximum[a|k<-[2..n],a<-[1..n],n`mod`k^a<1] 

Try it online!

45 bytes with an import:

import NumberTheory maximum.map snd.factorize 

Try it Online!

Removed unexpected '*'
Source Link
ბიმო
  • 17k
  • 3
  • 43
  • 106

Haskell, 61 60 50 48 46 bytes

-2 bytes thanks to xnor

f n=maximum[a*|k<n=maximum[a|k<-[2..n],a<-[1..n],n`mod`k^a<1] 

Try it online!

###45 bytes with an import:

import NumberTheory maximum.map snd.factorize 

Try it Online!

Haskell, 61 60 50 48 46 bytes

-2 bytes thanks to xnor

f n=maximum[a*|k<-[2..n],a<-[1..n],n`mod`k^a<1] 

Try it online!

###45 bytes with an import:

import NumberTheory maximum.map snd.factorize 

Try it Online!

Haskell, 61 60 50 48 46 bytes

-2 bytes thanks to xnor

f n=maximum[a|k<-[2..n],a<-[1..n],n`mod`k^a<1] 

Try it online!

###45 bytes with an import:

import NumberTheory maximum.map snd.factorize 

Try it Online!

added 88 characters in body
Source Link
H.PWiz
  • 11.7k
  • 2
  • 23
  • 57

Haskell, 61 60 50 4848 46 bytes

-2 bytes thanks to xnor

f n=maximum[a*0^(n`mod`k^a)|k<n=maximum[a*|k<-[2..n],a<-[1..n]]n],n`mod`k^a<1] 

Try it online!Try it online!

###45 bytes with an import:

import NumberTheory maximum.map snd.factorize 

Try it Online!

Haskell, 61 60 50 48 bytes

f n=maximum[a*0^(n`mod`k^a)|k<-[2..n],a<-[1..n]] 

Try it online!

###45 bytes with an import:

import NumberTheory maximum.map snd.factorize 

Try it Online!

Haskell, 61 60 50 48 46 bytes

-2 bytes thanks to xnor

f n=maximum[a*|k<-[2..n],a<-[1..n],n`mod`k^a<1] 

Try it online!

###45 bytes with an import:

import NumberTheory maximum.map snd.factorize 

Try it Online!

deleted 3 characters in body
Source Link
H.PWiz
  • 11.7k
  • 2
  • 23
  • 57
Loading
added 7 characters in body
Source Link
H.PWiz
  • 11.7k
  • 2
  • 23
  • 57
Loading
deleted 14 characters in body
Source Link
H.PWiz
  • 11.7k
  • 2
  • 23
  • 57
Loading
added 8 characters in body
Source Link
H.PWiz
  • 11.7k
  • 2
  • 23
  • 57
Loading
Source Link
H.PWiz
  • 11.7k
  • 2
  • 23
  • 57
Loading