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

You are not logged in.

#76 2005-12-29 23:15:39

krassi_holmz
Real Member

Offline

Re: Very interesting problems..

Growing...
{1, 3, 6, 10, 15, 21, 4, 5, 11, 14, 2, 7, 9, 16, 20, 29, 35, 46, 18, 31, 33, 48, 52, 12, 13, 23, 26, 38, 43, 57, 24, 25, 39, 42, 22, 27, 37, 44, 56, 8, 17, 19, 30, 34, 47, 53, 28, 36, 45, 55, 66, 78, 91, 105, 64, 80, 41, 40, 60, 61, 83, 86, 58, 63, 81, 88, 108, 117, 79, 65, 104, 92, 77, 67, 54, 90, 106, 119, 50, 71, 73, 96, 100, 69, 75, 94, 102, 123, 133, 156, 168}
Length-91
MaxNumber-168

IPBLE:  Increasing Performance By Lowering Expectations.

#77 2005-12-30 01:48:16

seerj
Member

Offline

Re: Very interesting problems..

Ehy seems to be cool.
If u want can u send me the algorithm? [if u want for sure!]
on leopardus@inwind.it

However thank u...
We need to understand which is this minimum n....

#78 2005-12-30 02:10:44

krassi_holmz
Real Member

Offline

Re: Very interesting problems..

I generalized my algoritm and inproved my program. Now it the first member don't have to be 1.

IPBLE:  Increasing Performance By Lowering Expectations.

#79 2005-12-30 02:17:01

krassi_holmz
Real Member

Offline

Re: Very interesting problems..

here's my algoritm:
Let sqsei(x) give the smallest perfect square, greater than x.

a[1]=k-arbitary

How to find a[f]?
1.We calculate sqsei[a[f-1]]-a[f-1]. Let this be k.
2.If k is different with all numbers a[1],a[2],...,a[f-1] then a[f]=k.
3.If not, the new value of k must be sqsei[k+a[f-1]]-a[f-1] and we repeat step 3.

If a[f]+k=sqsei(a[f]) then the square chain is also circular.

Last edited by krassi_holmz (2005-12-30 02:21:20)

IPBLE:  Increasing Performance By Lowering Expectations.

#80 2005-12-30 02:19:11

krassi_holmz
Real Member

Offline

Re: Very interesting problems..

I wrote my program on Mathematica language and it has some extra properties:

Last edited by krassi_holmz (2005-12-30 02:53:28)

IPBLE:  Increasing Performance By Lowering Expectations.

#81 2005-12-30 02:24:50

seerj
Member

Offline

Re: Very interesting problems..

krassi_holmz wrote:

I wrote my program in Mathematica language and it has some extra properties:

Oh Mathematica! I thought something like C/C++. Coz I dunno how to check if the sum of 2 consecutive numbers is perfect square??!
When the sum of 2 numbers is a perfect square?

if (a+b) = ?!?!

#82 2005-12-30 03:12:01

krassi_holmz
Real Member

Offline

Re: Very interesting problems..

I'll tell you. I asked myself same thing when I started doing the program. But my mistake was that i started writting on Visual Basic. And I had to define some functions:

Code:

```------------------------------------------------------------------------------------------------------------------
Function IsPerfectSquare(x) 'it gives 1 if x is square and 0 if not.
If Sqr(x) = Math.Round(Sqr(x)) Then
IsPerfectSquare = 1
Else
IsPerfectSquare = 0
End If
End Function

Function Ceiling(x) 'gives the smallest integer, greater or equal to x
If x > Math.Round(x) Then
Ceiling = Math.Round(x) + 1
ElseIf x <= Math.Round(x) Then
Ceiling = Math.Round(x)
End Function

Function PerfectSquareCeiling(x) 'gives the smallest perfect square that is greater than x
PerfectSquareCeiling = Ceiling(Sqr(x + IsPerfectSquare(x))) ^ 2
End Function
------------------------------------------------------------------------------------------------------------------```

The sum of two numbers is perfect square if
IsPerfectSquare(a+b)==1.

IPBLE:  Increasing Performance By Lowering Expectations.

#83 2005-12-30 03:14:33

krassi_holmz
Real Member

Offline

Re: Very interesting problems..

The third function is correct.

IPBLE:  Increasing Performance By Lowering Expectations.

#84 2005-12-30 03:17:20

krassi_holmz
Real Member

Offline

Re: Very interesting problems..

I know C very little.
Sorry, but I'm young and the first language i've learned was VBS.
If someone can translate the functions to C I'll be grateful.

IPBLE:  Increasing Performance By Lowering Expectations.

#85 2005-12-30 04:51:08

krassi_holmz
Real Member

Offline

Re: Very interesting problems..

Here's the Mathematica code:

Code:

```(*  PROGRAM CALCULATING THE SQUARE SUM CHAINS AND TESTING THEIR CIRCULARITY
Based on Georgiev's square sum chain creating algoritm
By Krasimir Geogiev
December, 2005 *)

(*____________________________________________________________*)
(* data *)

n := 17
k := 2

(* /data *)
(*____________________________________________________________*)
(* function defining *)

sq[x_] := If[x^(1/2) == Floor[x^(1/2)], 1, 0]
(* this function gives 1 when x is perfect square and 0 when it isn't. *)

sqcei[x_] := Ceiling[(x+sq[x])^(1/2)]^2
(* this function gives the smallest perfect square which is greater than x. *)

(* /function defining *)
(*____________________________________________________________*)
(* calculations *)
a[1] := k
Do[b[i] = 0, {i, 1, n^3}]
b[k] := 1
Do[
p = sqcei[a[i - 1]] - a[i - 1];
j = 0;
While[j == 0,
If[b[p] == 0,
b[p] = 1;
a[i] = p;
j = 1,
p = sqcei[p + a[i - 1]] - a[i - 1]
]], {i, 2, n}]
(* /calculations *)
(*____________________________________________________________*)
(* output *)
t=Table[a[i],{i,1,n}]
max = Max[t]
iscir=If[sq[a[n] + k] == 1, 1, 0]
(* /output*)
(*____________________________________________________________*)```

here you choose n and k.
t is the chain
max is max number in the chain
iscir is 1 if the chain sequence is circular and 0 if not.
I've simplified the output. In my program actually it is:

Code:

```(* output *)
Print["The chain:"]
t = Table[a[i], {i, 1, n}]
Print["Length:"]
n
Print["Maximal number:"]
Max[t]
Print["Graphical plot:"]
ListPlot[t, PlotJoined -> True]
isO[x_] := If[sq[a[x] + k] == 1, 1, 0]
Print["if j <= n chain is circular:"]
tt = Table[isO[i], {i, 1, n}]
Print["Graphical plot of the circular test:"]
Plot[isO[Floor[x]], {x, 1, n + 1}]
(* /output*)```

IPBLE:  Increasing Performance By Lowering Expectations.

#86 2005-12-30 06:36:25

krassi_holmz
Real Member

Offline

Re: Very interesting problems..

I just have found something very interesting:
The biggest number in the square sum chain sq(2,17)={2, 7, 9, 16, 20, 5, 4, 12, 13, 3, 1, 8, 17, 19, 6, 10, 15} with length 17 is 20!
Unfortunately sq(2,17) is not circular.

Last edited by krassi_holmz (2005-12-30 06:40:52)

IPBLE:  Increasing Performance By Lowering Expectations.

#87 2005-12-30 06:39:24

krassi_holmz
Real Member

Offline

Re: Very interesting problems..

Oh. I forgot!
sq(x,y) - x means the first number in the chain, y-the length of the chain.

Last edited by krassi_holmz (2005-12-30 06:41:53)

IPBLE:  Increasing Performance By Lowering Expectations.

#88 2005-12-30 06:47:16

krassi_holmz
Real Member

Offline

Re: Very interesting problems..

Conjection:
The greatest number in the chain sq(1, n) is >n and ≈2n.

IPBLE:  Increasing Performance By Lowering Expectations.

#89 2005-12-30 08:39:45

John E. Franklin
Star Member

Offline

Re: Very interesting problems..

1 3 6 10 15 21 4 12 24 25
11 5 31 18 7 9 40 41 8
All less than fifty. Length=19

1 8 17 19 6 10 15 21 4 5
11 14 2 23 13 12 24
All less than 50, Length = 17

1 3 6 10 15 21 4 12 13 23
2 34 30 19 45 36 28 8
All less than 50, Length = 18

1 3 6 10 15 21 4 5 20 16
9 27 22 14 2 23 13 36 28 8
41 40 24
All less than 50, Length = 23

1 3 6 10 15 21 4 12 24 25
11 5 44 20 16 33 31 18 46 35
All less than 50, Length = 20

Last edited by John E. Franklin (2005-12-30 08:48:08)

Imagine for a moment that even an earthworm may possess a love of self and a love of others.

#90 2005-12-30 08:52:39

John E. Franklin
Star Member

Offline

Re: Very interesting problems..

Length=25, #'s < 50
1 8 17 19 6 3 22 14 11 5
31 18 7 2 23 26 10 39 25 24
40 9 16 33 48

Length=21, #'s < 50
1 8 17 19 6 10 15 21 4 5
11 14 2 7 9 16 20 29 35 46
3

Last edited by John E. Franklin (2005-12-30 08:54:32)

Imagine for a moment that even an earthworm may possess a love of self and a love of others.

#91 2005-12-30 08:53:06

krassi_holmz
Real Member

Offline

Re: Very interesting problems..

sq(3,24)={3, 1, 8, 17, 19, 6, 10, 15, 21, 4, 5, 11, 14, 2, 7, 9, 16, 20, 29, 35, 46, 18, 31, 33}
Length-24
#<50

Last edited by krassi_holmz (2005-12-30 08:59:15)

IPBLE:  Increasing Performance By Lowering Expectations.

#92 2005-12-30 08:57:55

John E. Franklin
Star Member

Offline

Re: Very interesting problems..

Does "correspond" mean they came out the same as yours?
Does sq(1,23) mean Length 23, starts on 1?

Imagine for a moment that even an earthworm may possess a love of self and a love of others.

#93 2005-12-30 09:02:25

John E. Franklin
Star Member

Offline

Re: Very interesting problems..

Another Length 25, all #'s < 50
1 3 6 10 15 21 4 32 17 19
30 34 2 7 42 22 14 35 29 20
44 5 11 25 24

A twenty long, below 50
1 3 6 10 15 21 4 32 17 8
28 36 13 23 41 40 9 16 33 48

Last edited by John E. Franklin (2005-12-30 09:03:51)

Imagine for a moment that even an earthworm may possess a love of self and a love of others.

#94 2005-12-30 09:02:35

krassi_holmz
Real Member

Offline

Re: Very interesting problems..

sq(1,23) means with length 23, tarting on 1 that is generated by my algoritm. My algoritm gives it too.

IPBLE:  Increasing Performance By Lowering Expectations.

#95 2005-12-30 09:06:06

John E. Franklin
Star Member

Offline

Re: Very interesting problems..

Awesome!   My algorithm uses random #'s, kind of cheating.
Everytime I run, I get a different answer, usually.

a twelve long, max #21
1 8 17 19 6 10 15 21 4 12
13 3

Last edited by John E. Franklin (2005-12-30 09:07:19)

Imagine for a moment that even an earthworm may possess a love of self and a love of others.

#96 2005-12-30 09:07:57

krassi_holmz
Real Member

Offline

Re: Very interesting problems..

Then you have got much luck!

IPBLE:  Increasing Performance By Lowering Expectations.

#97 2005-12-30 09:09:59

John E. Franklin
Star Member

Offline

Re: Very interesting problems..

Well, I pick a random square and subtract last number from it
and check if number is used yet.
Here's 22 long (my favorite #), Max#41
1 3 6 10 15 21 4 12 13 23
2 7 9 27 22 14 11 25 24 40
41 8

a 19 long, max 46
1 3 6 10 15 21 4 12 13 23
2 7 29 20 5 31 18 46 35

Last edited by John E. Franklin (2005-12-30 09:13:53)

Imagine for a moment that even an earthworm may possess a love of self and a love of others.

#98 2005-12-30 09:18:33

John E. Franklin
Star Member

Offline

Re: Very interesting problems..

My longest under 50.
Length=28, Max=41
1 3 6 10 15 21 4 12 13 23
2 14 22 27 9 16 20 29 7 18
31 5 11 25 24 40 41 8

Imagine for a moment that even an earthworm may possess a love of self and a love of others.

#99 2005-12-30 09:20:12

krassi_holmz
Real Member

Offline

Re: Very interesting problems..

A 28 long, MaxNumber=52(too close ):
sq(13,28)={13, 3, 1, 8, 17, 19, 6, 10, 15, 21, 4, 5, 11, 14, 2, 7, 9, 16, 20, 29, 35, 46, 18, 31, 33, 48, 52, 12}

IPBLE:  Increasing Performance By Lowering Expectations.

#100 2005-12-30 09:22:16

John E. Franklin
Star Member

Offline

Re: Very interesting problems..

a 9 long, max=24
1 3 6 10 15 21 4 12 24

an 11 long, max=34
1 8 17 19 6 10 26 23 2 34
15

a 14 long, max=40
1 3 6 10 15 21 4 5 31 18
7 9 40 24

a 15 long, max=36
1 3 6 10 15 21 4 32 17 8
28 36 13 12 24

Last edited by John E. Franklin (2005-12-30 09:33:36)

Imagine for a moment that even an earthworm may possess a love of self and a love of others.