Skip to main content
deleted 166 characters in body
Source Link
user92069
user92069

Shift the digits

Given a single positive integer (sayHere, x (supplied as input), find the smallest positive integer, after being multiplied by and xn, produces a result equivalent to shifting the positive integer(the result of your computation) are both positive integers. Under a formula, it basically means n * x = n shifted. Find n (n > 0). Find n.

Here's an example of shifting:

123456789 -> 912345678
abcdefghi -> iabcdefgh (letters = any 0~9 digit)
123       -> 312

Rules

  • Preceding zeros count after shifting. If the number is 10 and is multiplied by 0.1 (0.1 isn't a valid input), the result is 1, which isn't equal to 01 (10 after shifting).
  • Your code has to run on Try It Online without timing out.
  • If your number only has one digit, the shifted result is your number:
1 -> 1
4 -> 4
9 -> 9

Test cases

Just to show that it's possible ...

9 -> 10112359550561797752808988764044943820224719
(In this test case, x = 9 and n = 10112359550561797752808988764044943820224719.
n shifted =     n * x =              91011235955056179775280898876404494382022471)

Don't believe it? Try it online.

Shift the digits

Given a single positive integer (say x), find the smallest positive integer, after being multiplied by x, produces a result equivalent to shifting the positive integer. Under a formula, it basically means n * x = n shifted. Find n (n > 0).

Here's an example of shifting:

123456789 -> 912345678
abcdefghi -> iabcdefgh (letters = any 0~9 digit)
123       -> 312

Rules

  • Preceding zeros count after shifting. If the number is 10 and is multiplied by 0.1 (0.1 isn't a valid input), the result is 1, which isn't equal to 01 (10 after shifting).
  • Your code has to run on Try It Online without timing out.
  • If your number only has one digit, the shifted result is your number:
1 -> 1
4 -> 4
9 -> 9

Test cases

Just to show that it's possible ...

9 -> 10112359550561797752808988764044943820224719
(In this test case, x = 9 and n = 10112359550561797752808988764044943820224719.
n shifted =                      91011235955056179775280898876404494382022471)

Don't believe it? Try it online.

Shift the digits

Here, x (supplied as input) and n (the result of your computation) are both positive integers. n * x = n shifted. Find n.

Here's an example of shifting:

123456789 -> 912345678
abcdefghi -> iabcdefgh (letters = any 0~9 digit)
123       -> 312

Rules

  • Preceding zeros count after shifting. If the number is 10 and is multiplied by 0.1 (0.1 isn't a valid input), the result is 1, which isn't equal to 01 (10 after shifting).
  • Your code has to run on Try It Online without timing out.
  • If your number only has one digit, the shifted result is your number:
1 -> 1
4 -> 4
9 -> 9

Test cases

Just to show that it's possible ...

9 -> 10112359550561797752808988764044943820224719
(In this test case, x = 9 and n = 10112359550561797752808988764044943820224719.
n shifted = n * x =              91011235955056179775280898876404494382022471)

Don't believe it? Try it online.

added 161 characters in body
Source Link
user92069
user92069

Shift the digits

Given a single positive integer (say x), find the smallest positive integer, after being multiplied by x, produces a result equivalent to shifting the positive integer. Under a formula, it basically means n * x = n shifted. Find n (n > 0).

Here's an example of shifting:

123456789 -> 912345678
abcdefghi -> iabcdefgh (letters = any 0~9 digit)
123       -> 312

Rules

  • Preceding zeros count after shifting. If the number is 10 and is multiplied by 0.1 (0.1 isn't a valid input), the result is 1, which isn't equal to 01 (10 after shifting).
  • Your code has to run on Try It Online without timing out.
  • If your number only has one digit, the shifted result is your number:
1 -> 1
4 -> 4
9 -> 9

Test cases

Just to show that it's possible ...

9 -> 10112359550561797752808988764044943820224719
(In this test case, x = 9 and n = 10112359550561797752808988764044943820224719.
n shifted =                      91011235955056179775280898876404494382022471)

Don't believe it? Try it online.

Shift the digits

Given a single positive integer (say x), find the smallest positive integer, after being multiplied by x, produces a result equivalent to shifting the positive integer. Under a formula, it basically means n * x = n shifted. Find n (n > 0).

Here's an example of shifting:

123456789 -> 912345678
abcdefghi -> iabcdefgh (letters = any 0~9 digit)
123       -> 312

Rules

  • Preceding zeros count after shifting. If the number is 10 and is multiplied by 0.1 (0.1 isn't a valid input), the result is 1, which isn't equal to 01 (10 after shifting).
  • Your code has to run on Try It Online without timing out.
  • If your number only has one digit, the shifted result is your number:
1 -> 1
4 -> 4
9 -> 9

Test cases

Just to show that it's possible ...

9 -> 10112359550561797752808988764044943820224719

Don't believe it? Try it online.

Shift the digits

Given a single positive integer (say x), find the smallest positive integer, after being multiplied by x, produces a result equivalent to shifting the positive integer. Under a formula, it basically means n * x = n shifted. Find n (n > 0).

Here's an example of shifting:

123456789 -> 912345678
abcdefghi -> iabcdefgh (letters = any 0~9 digit)
123       -> 312

Rules

  • Preceding zeros count after shifting. If the number is 10 and is multiplied by 0.1 (0.1 isn't a valid input), the result is 1, which isn't equal to 01 (10 after shifting).
  • Your code has to run on Try It Online without timing out.
  • If your number only has one digit, the shifted result is your number:
1 -> 1
4 -> 4
9 -> 9

Test cases

Just to show that it's possible ...

9 -> 10112359550561797752808988764044943820224719
(In this test case, x = 9 and n = 10112359550561797752808988764044943820224719.
n shifted =                      91011235955056179775280898876404494382022471)

Don't believe it? Try it online.

added 136 characters in body
Source Link
user92069
user92069

Shift the digits

Given a single positive integer (say x), find the smallest positive integer, after being multiplied by x, produces a result equivalent to shifting the positive integer. Under a formula, it basically means n * x = n shifted. Find n (n > 0).

Here's an example of shifting:

123456789 -> 912345678
abcdefghi -> iabcdefgh (letters = any 0~9 digit)
123       -> 312

Rules

  • Preceding zeros count after shifting. If the number is 10 and is multiplied by 0.1 (0.1 isn't a valid input), the result is 1, which isn't equal to 01 (10 after shifting).
  • Your code has to run on Try It Online without timing out.
  • If your number only has one digit, the shifted result is your number:
1 -> 1
4 -> 4
9 -> 9

Test cases

Just to show that it's possible ...

9 -> 10112359550561797752808988764044943820224719

Don't believe it? Try it online.

Shift the digits

Given a single positive integer (say x), find the smallest positive integer, after being multiplied by x, produces a result equivalent to shifting the positive integer. Under a formula, it basically means n * x = n shifted. Find n (n > 0).

Here's an example of shifting:

123456789 -> 912345678
abcdefghi -> iabcdefgh (letters = any 0~9 digit)
123       -> 312

Rules

  • Preceding zeros count after shifting. If the number is 10 and is multiplied by 0.1 (0.1 isn't a valid input), the result is 1, which isn't equal to 01 (10 after shifting).
  • Your code has to run on Try It Online without timing out.
  • If your number only has one digit, the shifted result is your number:
1 -> 1
4 -> 4
9 -> 9

Test cases

Shift the digits

Given a single positive integer (say x), find the smallest positive integer, after being multiplied by x, produces a result equivalent to shifting the positive integer. Under a formula, it basically means n * x = n shifted. Find n (n > 0).

Here's an example of shifting:

123456789 -> 912345678
abcdefghi -> iabcdefgh (letters = any 0~9 digit)
123       -> 312

Rules

  • Preceding zeros count after shifting. If the number is 10 and is multiplied by 0.1 (0.1 isn't a valid input), the result is 1, which isn't equal to 01 (10 after shifting).
  • Your code has to run on Try It Online without timing out.
  • If your number only has one digit, the shifted result is your number:
1 -> 1
4 -> 4
9 -> 9

Test cases

Just to show that it's possible ...

9 -> 10112359550561797752808988764044943820224719

Don't believe it? Try it online.

added 15 characters in body
Source Link
user92069
user92069
Loading
Made a mistake...
Source Link
user92069
user92069
Loading
deleted 6 characters in body
Source Link
user92069
user92069
Loading
added 66 characters in body
Source Link
user92069
user92069
Loading
added 44 characters in body
Source Link
user92069
user92069
Loading
deleted 36 characters in body
Source Link
user92069
user92069
Loading
added 4 characters in body
Source Link
user92069
user92069
Loading
Golfed the challenge
Source Link
user92069
user92069
Loading
deleted 1 character in body
Source Link
user92069
user92069
Loading
Source Link
user92069
user92069
Loading