New answers tagged

0 votes

Count up forever

Octave, 29 bytes j=0;while 1 j=vpa(j,39)+1 end Try it online! This makes use of the vpa function for variable precision numbers. I set the precision at 39 based on ...
cnln's user avatar
  • 41
1 vote

Count up forever

Acc!!, 91 83 bytes -8 bytes thanks to @DLosc Count i while 1 { _+i/10^_ Count j while _-j { Write i/10^(_-j-1)%10+48 } Write 9 } Try it online! Note this outputs a ...
Mukundan314's user avatar
  • 10.5k
0 votes

Swap the parity

Uiua 0.11.0, 5 bytes SBCS -ⁿ,¯1 Try on Uiua Pad! Explanation ,¯1 # n, -1, n ⁿ # (-1)^n, n - # n - (-1)^n
Tbw's user avatar
  • 1,745
0 votes

Swap the parity

Vyxal, 2 bytes Ǎ- Try it Online! - # n - Ǎ # -1 ^ n
emanresu A's user avatar
  • 37.8k
0 votes

Sum every second digit in a number

Uiua 0.11.0, 12 bytes SBCS /+≡⋕▽◿2⇡⧻.°⋕ Try on Uiua Pad! Takes \$n\$ and returns the sum of every other digit of \$n\$. Explanation ...
Tbw's user avatar
  • 1,745
1 vote

Swap the parity

Alice, 17 bytes /O\.2%2v @M/+t* < Try it online! ...
Julian's user avatar
  • 3,028
0 votes

Sum every second digit in a number

sed -r, 31 bytes s/.(.)?/\1+/g s/.*/bc<<<$[&0]/e Try it online! or equivalantly, sed ...
guest4308's user avatar
  • 477
1 vote

Swap the parity

sed, 33 32 bytes s/^/%/ #insert % at begining s/../&%/g #put % after char pairs s/.%.$// #if odd, delete 2 chars s/%//g #remove the percents Try it ...
guest4308's user avatar
  • 477
1 vote

Golf a number bigger than TREE(3)

(0,0,0)(1,1,1)(2,2,1)(3,0,0)[1000] (SDO \$\psi(C(1\{\omega\}0))\$), 622 bytes This is my first time on Stack Exchange, but I saw this post some time ago and I finally managed to make this. It ...
Polymations's user avatar
0 votes

Output "Fit" numbers

JavaScript (Node.js), 28 bytes f=n=>n&&n%2|f(n>>1)<<!!(n%4) Try it online!
l4m2's user avatar
  • 23.9k
0 votes

Output "Fit" numbers

Vyxal 3, 6 bytes bġ“⌊“B Try it Online!
pacman256's user avatar
  • 3,760
1 vote

As Easy as One-Two-Three

Pip, 8 bytes ^a=@a+,3 Attempt This Online! Explanation ...
DLosc's user avatar
  • 39.3k
1 vote

As Easy as One-Two-Three

JavaScript (Node.js), 17 bytes n=>n==n[0]*111+12 Try it online!
l4m2's user avatar
  • 23.9k
1 vote

As Easy as One-Two-Three

Scratch, 70 69 bytes A simple question - a simple answer. 1 byte has been golfed away following the kind suggestion of Dlosc. Pseudocode: ...
Patric's user avatar
  • 130
0 votes

1, 2, 4, 8, 16, ... 33?

YASEPL, 77 73* 72 bytes outputs each number (seperated by new line), asks for how many numbers with a prompt ...
madeforlosers's user avatar
1 vote

1, 2, 4, 8, 16, ... 33?

Pip, 23 bytes Y1RL5LayPB$+:y*RyH-3y@a Uses 1-indexing. Attempt This Online! Explanation The program uses 1-indexing because it actually computes the following 0-...
DLosc's user avatar
  • 39.3k
1 vote

Ginormous number

Vyxal, 37 bytes »°øḊ⟩√ɾ§»₄τ₀ʀ13+₁*+₀*∆ṖΠf›¦‹ǎΠf:ẏǎ$eΠ Try it Online! Directly implements the algorithm. ...
emanresu A's user avatar
  • 37.8k
1 vote

Decipher a squashed sequence

Swift 5.9, 143 134 bytes ...
macOSisthebestOS's user avatar
4 votes

X Steps Forward, 1 Step Back

Vyxal, 6 bytes ½ɾ∑:∷+ Try it Online! Now flagless, thanks to emanresu A's suggestion. This ties with their solution, though this is less clever. I just like the <...
noodle man's user avatar
  • 6,893
4 votes

X Steps Forward, 1 Step Back

PowerShell Core, 26 bytes 0 for(){($c+=++$i) (--$c)} Try it online! Output the sequence indefinitely
Julian's user avatar
  • 3,028
4 votes

X Steps Forward, 1 Step Back

Vyxal, 6 bytes Þnuv∴¦ Try it Online! Outputs an infinite list. ...
emanresu A's user avatar
  • 37.8k
4 votes

X Steps Forward, 1 Step Back

Uiua, 10 bytes +◿2./+⇡⌊÷2 Try it Based on Shaggy's Japt. Explanation: ⌊÷2 Floor divide by 2 ...
noodle man's user avatar
  • 6,893
1 vote

Fibonacci function or sequence

Uiua, 9 bytes ◌⍥⊃+∘⊙.:1 Try it Explanation: ...
noodle man's user avatar
  • 6,893
1 vote

Decipher a squashed sequence

Haskell + hgl, 22 bytes glk$my ν@~(mF eq1<δ) Attempt This Online! Explanation glk get the last complete parse (the first ...
Wheat Wizard's user avatar
  • 98.5k
0 votes

Print numbers from 1 to 10

Alice, 18 bytes a!ar/ Q \;?&/ O @ Try it online! I'll try to reorganize the code to make it denser and lower the byte count, so far no luck. ...
Julian's user avatar
  • 3,028
1 vote

Print numbers from 1 to 10

TECO, 9 bytes ` is interpreted as ASCII 27, ESC. Assume current buffer is empty. 10<I1`Z=> Which outputs ...
LdBeth's user avatar
  • 328
1 vote

Print numbers from 1 to 10

awk - doing it the grade school arithmetic approach the OP only said "arbitrary separators" - so empty string ("") in between the numbers ...
RARE Kpop Manifesto's user avatar
0 votes

Print numbers from 1 to 10

APL language ⍳10 1 2 3 4 5 6 7 8 9
Hapisnake's user avatar
3 votes

Borders of a Rectangular Matrix

JavaScript (Node.js), 47 bytes m=>m.slice(1,-1).map(x=>x.splice(1,x.length-2)) Try it online! Modify the input
l4m2's user avatar
  • 23.9k
1 vote

Natural construction

BrainPipe, 185 161 bytes ...
jan's user avatar
  • 311
1 vote

Borders of a Rectangular Matrix

Uiua SBCS, 13 bytes ⊡⊚↥⇌≡⇌.≡∊0⇡△. Try it! Port of Adám's APL answer. ...
chunes's user avatar
  • 24k
1 vote

Is this number triangular?

Uiua, 6 bytes ∊:\+⇡. Try it Is the input a member of taking the cumulative sums of the range of 0 to the input?
noodle man's user avatar
  • 6,893
0 votes

Calculate all the squares up to x using only addition and subtraction

Pascal, 182 B This is your standard odd number theorem. $$ n^2 = \sum_{i=1}^{n}\left(2i - 1\right) = \sum_{i=1}^{n}\left(i + i - 1\right) = \sum_{i=1}^{n}\left(i\right) + \sum_{i=1}^{n}\left(i\...
Kai Burghardt's user avatar
0 votes

Doors and guards

Python3, 311 bytes ...
Ajax1234's user avatar
  • 7,131
0 votes

Is this number a prime?

Easyfuck, 35 31 bytes D‘ň␗Č_-ZňÚG‰VŕPůňµ2’>Bům×É␗ţV­SHY8 due to lack of unicode representations for c1 control characters, they have been replaced by their superscripted abbreviations Decompressed: <...
Quadruplay's user avatar
1 vote

How far from binary?

Pip, 17 bytes W1<Ma-ii:i<0-:Uii Attempt This Online! Explanation I went through quite a few different approaches before settling on this one. Interesting ...
DLosc's user avatar
  • 39.3k
0 votes

Basic ASCII Tallies

JavaScript (Node.js), 99 bytes f=n=>n>50?f(50)+f(n-50):(g=j=>j-204?[(x=++j%51)?x%5&&x<=n?j%5-4|j%50>n?'|':'/':' ':` `]+g(j):` `)`` Try it ...
l4m2's user avatar
  • 23.9k
1 vote

Natural construction

JavaScript (Node.js), 26 bytes f=n=>n?[...f(--n),f(n)]:[] Try it online! Why not
l4m2's user avatar
  • 23.9k
1 vote

Natural construction

Uiua, 33 characters m←|1⟨""|$"_{_}".m-1⟩↧1. f←$"{_}"m Try it here!
jan's user avatar
  • 311
0 votes

count ones in range

Swift 5.9, 54 bytes let f={($0+0...$1+0).reduce(0){$0+$1.nonzeroBitCount}} f(_:_:) takes a lower bound and an upper bound. ...
macOSisthebestOS's user avatar
1 vote

Reversed Squares

PowerShell, 84 bytes $m=[math];if($m::sqrt($_)%1-eq0){return $m::sqrt($_[-1..-$_.length]-join'')%1-eq0}!1 Try it online!
James Flores's user avatar
0 votes

Stay away from zero

Easyfuck, 5 bytes Solution: +$":' Explanation: ...
Quadruplay's user avatar
1 vote

Is this number evil?

Easyfuck, 23 19 17 bytes Ì£î␅␏MW¼R¥␕¼×_f|µ8 due to lack of unicode representations for c1 control characters, they have been replaced by their superscripted abbreviations Decompressed: ...
Quadruplay's user avatar
0 votes

How high can you count?

Vyxal 3 1-9 Just 1, 2, ... 10 Builtin for 10. 11 <...
Larry Bagel's user avatar
  • 4,173
0 votes

Reversed Squares

Vyxal 3, 4 bytes Ṛ√ᵞ⌊ Try it Online! is the square root of the reverse equal to its integer part?
pacman256's user avatar
  • 3,760
1 vote

count ones in range

J-uby, 26 bytes :!~|:sum+(~:digits&2|:sum) Attempt This Online!
Jordan's user avatar
  • 10.1k
0 votes

What is the smallest positive base 10 integer that can be printed by a program shorter (in characters) than itself?

HP‑41C series, 1 This submissions presumes there are no other programs in program memory. We merely need to increase the number of displayed digits before placing the number on top of the stack. The ...
Kai Burghardt's user avatar
1 vote

Pretty Palintiples

05AB1E, 9 bytes µNѨíNåD– Try it online. Explanation: ...
Kevin Cruijssen's user avatar

Top 50 recent answers are included