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

You are not logged in. #76 20051229 23:15:39
Re: Very interesting problems..Growing... IPBLE: Increasing Performance By Lowering Expectations. #78 20051230 02:10:44
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 20051230 02:17:01
Re: Very interesting problems..here's my algoritm: Last edited by krassi_holmz (20051230 02:21:20) IPBLE: Increasing Performance By Lowering Expectations. #80 20051230 02:19:11
Re: Very interesting problems..I wrote my program on Mathematica language and it has some extra properties: Last edited by krassi_holmz (20051230 02:53:28) IPBLE: Increasing Performance By Lowering Expectations. #81 20051230 02:24:50
Re: Very interesting problems..
Oh Mathematica! I thought something like C/C++. Coz I dunno how to check if the sum of 2 consecutive numbers is perfect square??! #82 20051230 03:12:01
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 IPBLE: Increasing Performance By Lowering Expectations. #83 20051230 03:14:33
Re: Very interesting problems..The third function is correct. IPBLE: Increasing Performance By Lowering Expectations. #84 20051230 03:17:20
Re: Very interesting problems..I know C very little. IPBLE: Increasing Performance By Lowering Expectations. #85 20051230 04:51:08
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. 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 20051230 06:36:25
Re: Very interesting problems..I just have found something very interesting: Last edited by krassi_holmz (20051230 06:40:52) IPBLE: Increasing Performance By Lowering Expectations. #87 20051230 06:39:24
Re: Very interesting problems..Oh. I forgot! Last edited by krassi_holmz (20051230 06:41:53) IPBLE: Increasing Performance By Lowering Expectations. #88 20051230 06:47:16
Re: Very interesting problems..Conjection: IPBLE: Increasing Performance By Lowering Expectations. #89 20051230 08:39:45
Re: Very interesting problems..1 3 6 10 15 21 4 12 24 25 Last edited by John E. Franklin (20051230 08:48:08) igloo myrtilles fourmis #90 20051230 08:52:39
Re: Very interesting problems..Length=25, #'s < 50 Last edited by John E. Franklin (20051230 08:54:32) igloo myrtilles fourmis #91 20051230 08:53:06
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} Last edited by krassi_holmz (20051230 08:59:15) IPBLE: Increasing Performance By Lowering Expectations. #92 20051230 08:57:55
Re: Very interesting problems..Does "correspond" mean they came out the same as yours? igloo myrtilles fourmis #93 20051230 09:02:25
Re: Very interesting problems..Another Length 25, all #'s < 50 Last edited by John E. Franklin (20051230 09:03:51) igloo myrtilles fourmis #94 20051230 09:02:35
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 20051230 09:06:06
Re: Very interesting problems..Awesome! My algorithm uses random #'s, kind of cheating. Last edited by John E. Franklin (20051230 09:07:19) igloo myrtilles fourmis #96 20051230 09:07:57
Re: Very interesting problems..Then you have got much luck! IPBLE: Increasing Performance By Lowering Expectations. #97 20051230 09:09:59
Re: Very interesting problems..Well, I pick a random square and subtract last number from it Last edited by John E. Franklin (20051230 09:13:53) igloo myrtilles fourmis #98 20051230 09:18:33
Re: Very interesting problems..My longest under 50. igloo myrtilles fourmis #99 20051230 09:20:12
Re: Very interesting problems..A 28 long, MaxNumber=52(too close ): IPBLE: Increasing Performance By Lowering Expectations. #100 20051230 09:22:16
Re: Very interesting problems..a 9 long, max=24 Last edited by John E. Franklin (20051230 09:33:36) igloo myrtilles fourmis 