You are not logged in.
Im trying to find out the formula for the following..
i want to express every integer in powers of 3 with a formula and i only have college science math so i need help from you guys who went further than me
so its like 1 = 3^0
2 = 3^1 - 3^0
3 = 3^1
4 = 3^1 + 3^0
5 = 3^2 - 3^1 - 3^0
6 = 3^2 - 3^1
7 = 3^2 - 3^1 + 3^0
annnnnnnnnddd so forth
so i can see the pattern, i just think i dont know enouph math stuff to solve this... so if someone knows the function that will give you the powers of 3 needed for each integer.. tell me!!
THX for the help
math is fun!
Offline
Hi wetsun,
You want all the powers to be distinct?
E.g.,
5 = 3^2 - 3^1 - 3^0
and not 3^1+3^1-3^0
like that?
Hmmm, interesting! Isn't as easy as I expected.
Last edited by gAr (2011-06-20 05:01:19)
"Believe nothing, no matter where you read it, or who said it, no matter if I have said it, unless it agrees with your own reason and your own common sense" - Buddha?
"Data! Data! Data!" he cried impatiently. "I can't make bricks without clay."
Offline
hi gAr
Yes he does.
Every integer can be written as sumsub of powers of three, where sumsub means 'add or subtract'.
But a formula for this looks a bit hairy to me. It'll have to be recursive I think.
Bob
Children are not defined by school ...........The Fonz
You cannot teach a man anything; you can only help him find it within himself..........Galileo Galilei
Sometimes I deliberately make mistakes, just to test you! …………….Bob
Offline
exactly, i guess i should have mentioned it
i made a little table up to like 42 and the pattern is easy to see, just hard to tranform into math terms
i also notices that for the 3^0, its goes [+,-,0] periodical
3^1 [0,+,+,+,-,-,-,0,0] periodical
and so forth
the so basically for the 3^0 its 2*Sqrt[3]*Cos[(2*\[Pi]*x/3 + (\[Pi])/6)]/3
or
Sum[((-1)^(n - k)) ((n - k)!/(k! ((n - k) - k)!)), {k, 0, n, 1}]
got that from oeis.org/search?q=1%2C-1%2C0%2C1%2C-1%2C0%2C1%2C-1%2C0&language=english&go=Search
i hope it helps...
i get the feeling this is unsolvable but i know nothing! thats why im here
thx
Offline
hi wetsun and gAr
I've made a picture! All right ... it's not much ... but it means I'm on the case.
Bob
Children are not defined by school ...........The Fonz
You cannot teach a man anything; you can only help him find it within himself..........Galileo Galilei
Sometimes I deliberately make mistakes, just to test you! …………….Bob
Offline
Hi Bob,
Okay.
Yes, I too think it'll be a recursive formula.
Thanks for the picture!
Hi wetsun,
You have done a good job experimenting with it, so the statement "i know nothing!" is a contradiction.
"Believe nothing, no matter where you read it, or who said it, no matter if I have said it, unless it agrees with your own reason and your own common sense" - Buddha?
"Data! Data! Data!" he cried impatiently. "I can't make bricks without clay."
Offline
hi wetsun,
Will you accept a computer program?
Bob
Children are not defined by school ...........The Fonz
You cannot teach a man anything; you can only help him find it within himself..........Galileo Galilei
Sometimes I deliberately make mistakes, just to test you! …………….Bob
Offline
I guess he does...
so if someone knows the function that will give you the powers of 3 needed for each integer.. tell me!!
or is it a mathematical function?
"Believe nothing, no matter where you read it, or who said it, no matter if I have said it, unless it agrees with your own reason and your own common sense" - Buddha?
"Data! Data! Data!" he cried impatiently. "I can't make bricks without clay."
Offline
hi
I've modified the picture.
You may think it is trivial but (please note) I have colour coded the powers of three * and extended the integers by copying the earlier integers until I reached the maximum possible with just these powers.
Bob
* 3^0 in red
3^1 in blue
3^2 in green
Last edited by Bob (2011-06-20 05:44:40)
Children are not defined by school ...........The Fonz
You cannot teach a man anything; you can only help him find it within himself..........Galileo Galilei
Sometimes I deliberately make mistakes, just to test you! …………….Bob
Offline
If this helps, I noticed that the red line, 3^0, appears in the first two, then not in the third, then the next two, but not the sixth...and so on..
Offline
im sure the formula exists somewhere, i can't be the first person who asks himself this question...
its just a matter of knowing what it's called, so someone with a doctors or something would probably be able to name it... i think
that's why im here, im using mathematica if anyone wants to know... or paste me something they came up with.
Offline
If this helps, I noticed that the red line, 3^0, appears in the first two, then not in the third, then the next two, but not the sixth...and so on..
and is +, then - then 0 repeatedly. I think wetsun said this earlier.
and the blue line goes +++, ---, 000,+++ etc
and the green line goes +++++++++, - - - - - - - - -, 0 0 0 0 0 0 0 0 0 I think .... haven't tested this case yet.
Bob
Last edited by Bob (2011-06-20 06:04:46)
Children are not defined by school ...........The Fonz
You cannot teach a man anything; you can only help him find it within himself..........Galileo Galilei
Sometimes I deliberately make mistakes, just to test you! …………….Bob
Offline
here is the table i made
Dark X = -
X = +
blank = 0
Offline
hi wetsun
Just did a similar thing with Excel. see picture 2.
Bob
Last edited by Bob (2011-06-20 06:38:03)
Children are not defined by school ...........The Fonz
You cannot teach a man anything; you can only help him find it within himself..........Galileo Galilei
Sometimes I deliberately make mistakes, just to test you! …………….Bob
Offline
hi computer programmers
Here's the algorithm:
0, 1, 4, 13 are the key values.
4 = 1+3
13=1+3+9
See picture 3
The highlighted numbers show when the cycles kick in
So the 1,-1,0 cycle starts at 0+1
The 333,-3-3-3,000 cycle starts at 1 + 1
The 999999999,-9-9-9-9-9-9-9-9-9,000000000 cycle starts at 4+1.
The 27 cycle starts at 13+1
I've got to log out now; got chores to do. Back later.
Bob
Last edited by Bob (2011-06-20 06:44:28)
Children are not defined by school ...........The Fonz
You cannot teach a man anything; you can only help him find it within himself..........Galileo Galilei
Sometimes I deliberately make mistakes, just to test you! …………….Bob
Offline
Here is another algorithm I work out
1.Write the number in base 3
2.Replace the 2 , if theres any, before each term with (3-1)
3.simplify
4.if there are still 2 within the terms, repeat the process
for example
I think this process would make all the 2s vanish eventually.
Offline
. .
. .
. .
. .
. .
. .
. .
. .
Offline
Hi soroban,
Awesome!
I tried for 10111:
"Believe nothing, no matter where you read it, or who said it, no matter if I have said it, unless it agrees with your own reason and your own common sense" - Buddha?
"Data! Data! Data!" he cried impatiently. "I can't make bricks without clay."
Offline
Dragonshade and soroban
Very brilliant methods!
Thanks.
Bob
Children are not defined by school ...........The Fonz
You cannot teach a man anything; you can only help him find it within himself..........Galileo Galilei
Sometimes I deliberately make mistakes, just to test you! …………….Bob
Offline
I missed Dragonshade's post.
Good one Dragonshade!
Last edited by gAr (2011-06-20 19:26:08)
"Believe nothing, no matter where you read it, or who said it, no matter if I have said it, unless it agrees with your own reason and your own common sense" - Buddha?
"Data! Data! Data!" he cried impatiently. "I can't make bricks without clay."
Offline
Thank you for your reply soroban and dragonshade, although these methods don't seem to be what i'm looking for, they provide some clues.
It seems more of an iterative process using base 3 (with 'if' twice), sort of more like an algoritm/program than a function(perhaps im wrong, algorithms and functions can be very similar, if so plz explain to me so ill learn stuff ).
So to me a function would clearly be a more 'elegant' solution. Though your method will allow me to experiment as though i already had the function and for that i appreciate!
By the way, if you generate a base 3 array plot of integers in mathematica, you will see the similarity to my table immediately with slight deviation. Thank you for making that connection clearer.
I consider every post as clues! (and maybe one will have the answer!)
Thank you again! and don't stop here, there's always more to discover!,
Offline
Hi wetsun;
Just a question.
In the p adic representations of numbers which Maple has and Mathematica does not the sum would have all positive terms. Why do you need both positive and negative terms?
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
well i don't really know what you mean with the p-adic representation but the reason why i need both negative and positive
is because if you use powers only once, you have only one solution for each integer and it includes negative and positive terms, or just positive, or just negative. it's all in the table
Offline
Hi;
Unfortunately, there does not look like there is any formula. You will have to settle on the algorithmic approach. There is a nice formula to determine how many terms there will be.
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
Just one last thing, has anyone converted soroban's algorithm to Mathematica language.
I'm not very good in programming, I'm trying to find a way but without success.
So please share if you have it. Or if you have it in another program, I will download it
and use it.
Paste the lines here thank you.
Offline