Skip to main content
Post Undeleted by user41805
deleted 109 characters in body
Source Link
user41805
  • 13.2k
  • 6
  • 42
  • 88

APL (Dyalog), 3 bytes

9|⍴2|⍴

Try it online!Try it online! (the test suite generates a range of numbers from 1 to 10000, converts them to a string, and then applies the train 9|⍴2|⍴ on them).

Takes the input number as a string and returns its length mod 92. So 123 => 3 mod 92 => 31.

The sequence starts off like so:

1  1  1  1  1  1  1  1  1  20  20  20  20  20  20  ...

until it reaches 100000000, at which point the resulting output is 0 because the length of that string isso this can be generalised like so: 9 1s 90 0s 900 1s .... And this non-repeating cycle will continue until eternity. Hence, this number is irrational.

And the reason for theMultiplying this number by 9 gives us a mod 9Liouville number, which is so that numbers greater than 1e9 will still give single digit outputsproven to be transcendental.

APL (Dyalog), 3 bytes

9|⍴

Try it online! (the test suite generates a range of numbers from 1 to 10000, converts them to a string, and then applies the train 9|⍴ on them).

Takes the input number as a string and returns its length mod 9. So 123 => 3 mod 9 => 3.

The sequence starts off like so:

1  1  1  1  1  1  1  1  1  2  2  2  2  2  2  ...

until it reaches 100000000, at which point the resulting output is 0 because the length of that string is 9. And this non-repeating cycle will continue until eternity. Hence, this number is irrational.

And the reason for the mod 9 is so that numbers greater than 1e9 will still give single digit outputs.

APL (Dyalog), 3 bytes

2|⍴

Try it online! (the test suite generates a range of numbers from 1 to 10000, converts them to a string, and then applies the train 2|⍴ on them).

Takes the input number as a string and returns its length mod 2. So 123 => 3 mod 2 => 1.

The sequence starts off like so:

1  1  1  1  1  1  1  1  1  0  0  0  0  0  0  ...

so this can be generalised like so: 9 1s 90 0s 900 1s ...

Multiplying this number by 9 gives us a Liouville number, which is proven to be transcendental.

Post Deleted by user41805
added 2 characters in body
Source Link
user41805
  • 13.2k
  • 6
  • 42
  • 88

APL (Dyalog), 3 bytes

9|⍴

Try it online! (the test suite generates a range of numbers from 1 to 10000, converts them to a string, and then applies the train 9|⍴ on them).

Takes the input number as a string and returns its length mod 9. So 123 => 3 mod 9 => 3.

The sequence starts off like so:

1  1  1  1  1  1  1  1  1  2  2  2  2  2  2  ...

until it reaches until it reaches 100000000, at which point the resulting output is 0 because the length of that string is 9. And this non-repeating cycle is repeatedwill continue until eternity. Hence, this number is irrational.

And the reason for the mod 9 is so that numbers greater than 1e9 will still give single digit outputs.

APL (Dyalog), 3 bytes

9|⍴

Try it online! (the test suite generates a range of numbers from 1 to 10000, converts them to a string, and then applies the train 9|⍴ on them).

Takes the input number as a string and returns its length mod 9. So 123 => 3 mod 9 => 3.

The sequence starts off like so:

1  1  1  1  1  1  1  1  1  2  2  2  2  2  2  ...

until it reaches until it reaches 100000000, at which point the resulting output is 0 because the length of that string is 9. And this non-repeating cycle is repeated until eternity. Hence, this number is irrational.

And the reason for the mod 9 is so that numbers greater than 1e9 will still give single digit outputs.

APL (Dyalog), 3 bytes

9|⍴

Try it online! (the test suite generates a range of numbers from 1 to 10000, converts them to a string, and then applies the train 9|⍴ on them).

Takes the input number as a string and returns its length mod 9. So 123 => 3 mod 9 => 3.

The sequence starts off like so:

1  1  1  1  1  1  1  1  1  2  2  2  2  2  2  ...

until it reaches 100000000, at which point the resulting output is 0 because the length of that string is 9. And this non-repeating cycle will continue until eternity. Hence, this number is irrational.

And the reason for the mod 9 is so that numbers greater than 1e9 will still give single digit outputs.

Source Link
user41805
  • 13.2k
  • 6
  • 42
  • 88

APL (Dyalog), 3 bytes

9|⍴

Try it online! (the test suite generates a range of numbers from 1 to 10000, converts them to a string, and then applies the train 9|⍴ on them).

Takes the input number as a string and returns its length mod 9. So 123 => 3 mod 9 => 3.

The sequence starts off like so:

1  1  1  1  1  1  1  1  1  2  2  2  2  2  2  ...

until it reaches until it reaches 100000000, at which point the resulting output is 0 because the length of that string is 9. And this non-repeating cycle is repeated until eternity. Hence, this number is irrational.

And the reason for the mod 9 is so that numbers greater than 1e9 will still give single digit outputs.