Discussion about math, puzzles, games and fun. Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫ π -¹ ² ³ °

You are not logged in.

- Topics: Active | Unanswered

Pages: **1**

**shahinpr****Member**- Registered: 2013-07-23
- Posts: 1

Hi,

Today my friend asked me a question.I couldn't find answer and i am not sure that there is a correct one. But he says there is.

Question:

Find a number that if you swap first and last digit you will get two times bigger number (example: 2*abcdef=fbcdea)

Do you have any idea?

Hints:

-number is 18 digit

-first digit is even number

-last digit is odd number

-only one of digits is zero

Offline

**bobbym****Administrator**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 107,190

Hi;

Welcome to the forum. The number is 105263157894736842.

See this link here from post #4 onward:

**In mathematics, you don't understand things. You just get used to them.****If it ain't broke, fix it until it is.**** Always satisfy the Prime Directive of getting the right answer above all else.**

Offline

**Trenin****Member**- Registered: 2013-09-06
- Posts: 3

Doesn't this violate the rules:

-first digit is even number

-last digit is odd number

Your number has 1 as the first digit (odd) and 2 as the last digit (even)

*Last edited by Trenin (2013-09-06 06:37:44)*

Offline

**bobbym****Administrator**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 107,190

Hi;

I had to make the assumption that the problem was incorrectly worded. What he really meant was the anna_g problem in this link:

http://www.mathisfunforum.com/viewtopic.php?id=18524

Because the problem as is worded does not have a solution that I can find.

I can find no solution to problem as worded for 2 digits to 30 digits. There probably is no solution.

**In mathematics, you don't understand things. You just get used to them.****If it ain't broke, fix it until it is.**** Always satisfy the Prime Directive of getting the right answer above all else.**

Offline

**anonimnystefy****Real Member**- From: Harlan's World
- Registered: 2011-05-23
- Posts: 16,018

Hi bobbym

Have any idea how I could switch a number's first and last digit in M?

Here lies the reader who will never open this book. He is forever dead.

Taking a new step, uttering a new word, is what people fear most. ― Fyodor Dostoyevsky, Crime and Punishment

The knowledge of some things as a function of age is a delta function.

Offline

**bobbym****Administrator**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 107,190

Yes, I do. I just wrote the subroutine for the 30th time. This time I will keep it.

Do you want the code to solve the above problem or do you just want to switch first and last of any number?

**In mathematics, you don't understand things. You just get used to them.****If it ain't broke, fix it until it is.**** Always satisfy the Prime Directive of getting the right answer above all else.**

Offline

**anonimnystefy****Real Member**- From: Harlan's World
- Registered: 2011-05-23
- Posts: 16,018

Just the switching code.

Here lies the reader who will never open this book. He is forever dead.

Taking a new step, uttering a new word, is what people fear most. ― Fyodor Dostoyevsky, Crime and Punishment

The knowledge of some things as a function of age is a delta function.

Offline

**bobbym****Administrator**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 107,190

```
Use 12345 as an example.
h = t = IntegerDigits[12345]
h[[1]] = t[[Length[t]]];
h[[Length[t]]] = t[[1]];
```

If you enter h you will output {5,2,3,4,1}

**In mathematics, you don't understand things. You just get used to them.****If it ain't broke, fix it until it is.**** Always satisfy the Prime Directive of getting the right answer above all else.**

Offline

Pages: **1**