Math Is Fun Forum

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

You are not logged in.

#1 2011-06-20 04:14:06

wetsun
Member
Registered: 2011-06-20
Posts: 7

Powers of 3 and integers

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 smile

math is fun!

Offline

#2 2011-06-20 04:53:54

gAr
Member
Registered: 2011-01-09
Posts: 3,482

Re: Powers of 3 and integers

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

#3 2011-06-20 05:04:18

Bob
Administrator
Registered: 2010-06-20
Posts: 10,626

Re: Powers of 3 and integers

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 smile

Offline

#4 2011-06-20 05:09:16

wetsun
Member
Registered: 2011-06-20
Posts: 7

Re: Powers of 3 and integers

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 big_smile
thx

Offline

#5 2011-06-20 05:16:23

Bob
Administrator
Registered: 2010-06-20
Posts: 10,626

Re: Powers of 3 and integers

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 smile

Offline

#6 2011-06-20 05:20:33

gAr
Member
Registered: 2011-01-09
Posts: 3,482

Re: Powers of 3 and integers

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

#7 2011-06-20 05:23:22

Bob
Administrator
Registered: 2010-06-20
Posts: 10,626

Re: Powers of 3 and integers

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 smile

Offline

#8 2011-06-20 05:31:01

gAr
Member
Registered: 2011-01-09
Posts: 3,482

Re: Powers of 3 and integers

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

#9 2011-06-20 05:41:14

Bob
Administrator
Registered: 2010-06-20
Posts: 10,626

Re: Powers of 3 and integers

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 smile

Offline

#10 2011-06-20 05:44:51

MathPro101
Member
Registered: 2011-06-08
Posts: 18

Re: Powers of 3 and integers

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

#11 2011-06-20 05:50:43

wetsun
Member
Registered: 2011-06-20
Posts: 7

Re: Powers of 3 and integers

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

#12 2011-06-20 06:02:51

Bob
Administrator
Registered: 2010-06-20
Posts: 10,626

Re: Powers of 3 and integers

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 smile

Offline

#13 2011-06-20 06:28:55

wetsun
Member
Registered: 2011-06-20
Posts: 7

Re: Powers of 3 and integers

here is the table i made
Dark X = -
X         = +
blank   = 0

Offline

#14 2011-06-20 06:32:33

Bob
Administrator
Registered: 2010-06-20
Posts: 10,626

Re: Powers of 3 and integers

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 smile

Offline

#15 2011-06-20 06:42:47

Bob
Administrator
Registered: 2010-06-20
Posts: 10,626

Re: Powers of 3 and integers

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 smile

Offline

#16 2011-06-20 15:12:34

Dragonshade
Member
Registered: 2008-01-16
Posts: 147

Re: Powers of 3 and integers

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

#17 2011-06-20 16:13:58

soroban
Member
Registered: 2007-03-09
Posts: 452

Re: Powers of 3 and integers


. .


. .

. .

. .

. .

. .

. .


. . .

. . .


. . .

. . .




. .




.

Offline

#18 2011-06-20 16:51:39

gAr
Member
Registered: 2011-01-09
Posts: 3,482

Re: Powers of 3 and integers

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

#19 2011-06-20 19:15:52

Bob
Administrator
Registered: 2010-06-20
Posts: 10,626

Re: Powers of 3 and integers

Dragonshade and soroban

Very brilliant methods!

Thanks.  smile

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 smile

Offline

#20 2011-06-20 19:25:24

gAr
Member
Registered: 2011-01-09
Posts: 3,482

Re: Powers of 3 and integers

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

#21 2011-06-20 21:56:02

wetsun
Member
Registered: 2011-06-20
Posts: 7

Re: Powers of 3 and integers

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! smile and don't stop here, there's always more to discover!,

Offline

#22 2011-06-20 23:10:09

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Powers of 3 and integers

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

#23 2011-06-21 01:11:32

wetsun
Member
Registered: 2011-06-20
Posts: 7

Re: Powers of 3 and integers

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

#24 2011-06-21 02:47:01

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Powers of 3 and integers

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

#25 2011-06-21 23:33:34

wetsun
Member
Registered: 2011-06-20
Posts: 7

Re: Powers of 3 and integers

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

Board footer

Powered by FluxBB