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

You are not logged in.

#1 2013-02-03 23:50:09

Harold
Guest

Nth digit function

Is ther a function that finds nth digit of a natural number(like f_2(3250)= 5) if there is how is it defined?

#2 2013-02-04 00:04:51

bob bundy
Moderator
Registered: 2010-06-20
Posts: 6,308

Re: Nth digit function

hi Harold,

If you can describe what a function does then it exists.  I understand what your function does so you have answered your own question.

But I expect you mean can I press a button and get that result.  That depends on where the button is.

I don't think any calculators do this but you can certainly do it using MS Excel.  You'd have to convert the integer to a string, use MID$ to extract the digit you wanted and then convert the string back to a number.

Or you could divide by the power of ten that makes your digit in the tenths place.

Use <number> - INT<number> to remove the whole numbered part.

Times by ten and use INT to remove the decimal part and you are left with the required digit. 

If you are trying to do this as part of a computer program, then you'd better say what language you are using.

Bob


You cannot teach a man anything;  you can only help him find it within himself..........Galileo Galilei

Offline

#3 2013-02-04 00:19:55

Harold
Guest

Re: Nth digit function

No, i meant is there any way to get a relation for the function,like digital root is defined as sum of digits but it's simple relation is dr(x)= x mod 9.

#4 2013-02-04 00:49:59

bob bundy
Moderator
Registered: 2010-06-20
Posts: 6,308

Re: Nth digit function

hi Harold,

Not that I know of.  Others may know.

The INT approach could be written as a formula but it wouldn't be simple.

Bob


You cannot teach a man anything;  you can only help him find it within himself..........Galileo Galilei

Offline

#5 2013-02-04 04:42:43

Harold
Guest

Re: Nth digit function

Will f_n(x)= [10{x/10^n}] be a relation where [] is integer part and {} is fractional part?(i got the idea from your first post.)

#6 2013-02-04 04:51:12

bobbym
Administrator
From: Bumpkinland
Registered: 2009-04-12
Posts: 84,506

Re: Nth digit function

Hi;

If you just want to peel digits off use this function

where n is the number and p is the position.


In mathematics, you don't understand things. You just get used to them.
I have the result, but I do not yet know how to get it.
All physicists, and a good many quite respectable mathematicians are contemptuous about proof.

Offline

#7 2013-02-04 05:02:15

bob bundy
Moderator
Registered: 2010-06-20
Posts: 6,308

Re: Nth digit function

Yes, that looks good to me.  How about an extra bracket?

f_n(x)= [10{x/(10^n)}]

in case you get x/10 then raised to the power n.

Not sure if that's really needed.

Bob


You cannot teach a man anything;  you can only help him find it within himself..........Galileo Galilei

Offline

Board footer

Powered by FluxBB