New answers tagged

1 vote

Egyptian fraction representations of 1 without prime denominators

PARI/GP, 83 bytes A port of @Mukundan314's Python answer in PARI/GP . 83 bytes, It can be golfed more. Attempt This Online! ...
138 Aspen's user avatar
  • 5,401
1 vote

Egyptian fraction representations of 1 without prime denominators

05AB1E, 30 bytes •š~ üõ•25вI9-DdiFD¨sθ;2sªDO*«ï Try it online! Returns a negative number for inputs < 9 This is basically just a port of Jonathan Allan's ...
Matthew Welmers's user avatar
1 vote

Egyptian fraction representations of 1 without prime denominators

Python, 82 bytes f=lambda x:x<9or(x<10)*b" \n "or[*(a:=f(x-1))[:-1],b:=a[-1]+4,b//2*(b//2-2)] Attempt This Online! Works by ...
Mukundan314's user avatar
  • 8,484
2 votes

Egyptian fraction representations of 1 without prime denominators

Husk, 17 bytes ?øḟo=1ṁ\Ṗ¹fohpN<9 Try it online! (applied to all numbers up to 12, too slow for 13) Not happy about how long the filter conditions ended up being,...
Leo's user avatar
  • 12.6k
5 votes

Egyptian fraction representations of 1 without prime denominators

JCram, 27 bytes (SBCS), 91 bytes JS -5 thanks to Arnauld. JavaScript solution: ...
Kamila Szewczyk's user avatar
5 votes

Egyptian fraction representations of 1 without prime denominators

Charcoal, 56 bytes Nθ¿›θ⁸«”)‴7⊘J‹ê%υZX”≔E⁻θ⁹×⁺⁸׳ι⁺¹¹×³ιζ⊞ζ⁻×⁹θ⁵⁷W⁻ζυ⊞υ⌊ιIυ Try it online! Link is to verbose version of code. Explanation: ...
Neil's user avatar
  • 169k
6 votes

Egyptian fraction representations of 1 without prime denominators

Jelly, 25 bytes ḊẒÐḟœc³P-ƤS⁼PƲƇ 0Ç1#<?9ḢÇ A full program that accepts an integer, \$n\$, and prints the Jelly representation of a list of at least one valid ...
Jonathan Allan's user avatar

Top 50 recent answers are included