6
votes
Print 100 digits of Champernowne's Constant
Jelly, 4 3 2 bytes
³Ṭ
A full program that accepts no arguments and prints a list of one hundred consecutive places starting at the 0-indexed index (you may need ...
4
votes
Print 100 digits of Champernowne's Constant
C, 41 bytes
main(i){for(i=9;i++<59;)printf("%d",i);}
Goes through numbers 10 to 59 (indexes 9 to 108), printing exactly 100 digits (without a newline)....
3
votes
Print 100 digits of Champernowne's Constant
Jelly, 6 bytes
2r55DF
Try it online!
Starts at index 1 (digit 2 in the number 2). Range from 2 to 55 and then the decimal ...
2
votes
Print 100 digits of Champernowne's Constant
APL (Dyalog Classic), 7 bytes
100⍴'1'
Try it online!
Prints 1, one hundred times. Similar approach to @Jonathan Allan and others.
First appears as
...
2
votes
Print 100 digits of Champernowne's Constant
brainfuck, 23 bytes
-[----->+>+<<]>-[->..<]
Try it online!
Outputs 100 3s, which appears at index ...
1
vote
Print 100 digits of Champernowne's Constant
GolfScript, 6 bytes
55,(;5
Try it online!
Prints the first 100 digits.
...
1
vote
Print 100 digits of Champernowne's Constant
///, 17 bytes
/10/00000001/1100
Try it online!
Outputs 98 0s followed by 2 1s, which ...
1
vote
Print 100 digits of Champernowne's Constant
Charcoal, 6 bytes
⭆⁵⁰⁺χι
Try it online! Link is to verbose version of code. Starts at index 9. Explanation: Loops over the ...
1
vote
Print 100 digits of Champernowne's Constant
APL+WIN, 11 bytes
A function taking no arguments with output from index 1 with index origin = 1
¯1↓⊃,/⍕¨⍳55
Try it online! Thanks to Dyalog Classic
1
vote
Shift right by half a bit
JavaScript (Node.js), 31 bytes
n=>(g=i=>i*i*2<n*n?g(++i):i)(0)
Try it online!
or BigInt version, anyway really large values impractical to run
Brute-...
1
vote
Shift right by half a bit
Python 3.8 (pre-release), 40 bytes
This one works with python integers, giving the correct result even for arbitrarily large integers. Always rounds down.
...
1
vote
Is this relationship creepy?
PowerShell, 42 bytes
$c={param($a,$b)$a/2+7-gt$b-or$b/2+7-gt$a}
Rather than using [math]::min and ...
1
vote
Even or odd: three player
Perl 5 -p, 49 bytes
$_=(0,C,B,A,A..C)[oct"0b".s/./$&%2/ger]||"no one"
Try it online!
Takes input as ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
number × 1301code-golf × 1210
math × 296
sequence × 241
arithmetic × 151
integer × 116
string × 104
number-theory × 98
decision-problem × 95
array × 87
primes × 66
base-conversion × 55
code-challenge × 46
binary × 41
ascii-art × 35
kolmogorov-complexity × 32
combinatorics × 28
random × 23
fibonacci × 22
matrix × 21
restricted-source × 19
rational-numbers × 19
sorting × 18
permutations × 18
fastest-code × 17