[seqfan] Re: Will these patterns continue for larger numbers?

Matthijs Coster seqfan at matcos.nl
Sun Oct 6 08:21:07 CEST 2019


Hello Ali,

Here some more data:

The first 250 entries of your sequence:

[8, 1, 6, 2, 7, 7, 5, 3, 27, 8, 17, 8, 21, 6, 21, 4, 15, 28, 17, 9, 13, 17, 11, 9, 26, 22, 17, 7, 20, 22, 20, 5, 25, 16, 17, 29, 16, 17, 19, 10, 16, 14, 14, 17, 14, 12, 12, 10, 31, 27, 48, 23, 29, 18, 27, 8, 44, 21, 44, 23, 25, 21, 17, 6, 19, 26, 19, 17, 24, 17, 17, 30, 17, 17, 22, 17, 15, 20, 13, 11, 58, 17, 35, 15, 27, 15, 67, 18, 44, 15, 40, 13, 31, 13, 57, 11, 55, 32, 34, 28, 26, 49, 11, 24, 32, 30, 47, 19, 49, 28, 24, 9, 30, 45, 47, 22, 28, 45, 26, 24, 43, 26, 43, 22, 24, 18, 17, 7, 41, 20, 41, 27, 41, 20, 22, 18, 39, 25, 39, 17, 37, 18, 35, 31, 42, 18, 16, 18, 22, 23, 14, 17, 24, 16, 61, 21, 40, 14, 20, 12, 22, 59, 38, 18, 20, 36, 18, 16, 66, 28, 39, 16, 40, 68, 51, 19, 41, 45, 34, 16, 57, 41, 34, 14, 26, 32, 66, 14, 43, 58, 39, 12, 30, 56, 56, 33, 54, 35, 33, 29, 31, 27, 50, 50, 33, 12, 22, 25, 18, 33, 52, 31, 29, 48, 31, 20, 16, 50, 27, 29, 14, 25, 12, 10, 29, 31, 54, 46, 48, 48, 22, 23, 50, 29, 29, 46, 27, 27, 12, 25, 40, 44, 46, 27, 48, 44, 46, 23, 36]

I run my program till 100000.

Here the records:

1 8
9 27
18 28
36 29
49 31
51 48
81 58
87 67
174 68
289 83
313 85
529 108
973 112
1033 113
1873 123
1897 125
2115 136
4230 137
7245 139
7249 149
8309 150
9029 253
17789 262
35435 265
70269 292

I checked whether there was a cycle or a finish at 1.
Here are the numbers which end in a cycle:

Cycles: [9, 11, 18, 19, 22, 25, 27, 33, 35, 36, 38, 39, 44, 50, 51, 54, 57, 59, 61, 63, 66, 69, 70, 71, 72, 75, 76, 78, 87, 88, 93, 95, 97, 100, 102, 107, 108, 109, 114, 115, 118, 121, 122, 123, 125, 126, 127, 129, 131, 132, 133, 135, 137, 138, 139, 140, 141, 142, 143, 144, 150, 152, 156, 169, 171, 174, 176, 186, 187, 190, 193, 194, 195, 197, 200, 203, 204, 207, 211, 214, 216, 218, 225, 227, 228, 229, 230, 231, 233, 236, 241, 242, 243, 244, 245, 246, 247, 249, 250]

Again as a sequence: [8, 27, 28, 29, 31, 48, 58, 67, 68, 83, 85, 108, 112, 113, 123, 125, 136, 137, 139, 149, 150, 253, 262, 265, 292]

*Remark*:You add a square /larger/ than the number itself. If you choose 
for equal or larger, then odd squares will be part of small cycles of 
length 2: (n^2, 2*n^2)

Your second result, I couldn't reproduce.

I calculated the results upto 100:

First entries: [1, 1, 3, 2, 7, 4, 8, 3, 7, 7, 7, 5, 7, 9, 7, 4, 15, 8, 11, 7, 25, 7, 27, 6, 21, 8, 10, 10, 12, 8, 12, 5, 14, 16, 10, 9, 24, 12, 26, 8, 20, 26, 20, 8, 65, 28, 24, 7, 26, 22, 24, 9, 26, 11, 11, 11, 28, 13, 13, 9, 13, 13, 13, 6, 21, 15, 17, 17, 19, 11, 10, 10, 23, 25, 25, 13, 19, 27, 19, 9, 64, 21, 23, 27, 25, 21, 29, 9, 27, 66, 23, 29, 31, 25, 11, 8, 29, 27, 68, 23]

Records:
1 1
3 3
5 7
7 8
14 9
17 15
21 25
23 27
45 65
90 66
99 68
Records: [1, 3, 7, 8, 9, 15, 25, 27, 65, 66, 68]

Cycles: [5, 7, 9, 10, 11, 13, 14, 17, 18, 20, 21, 22, 23, 25, 26, 27, 28, 29, 31, 33, 34, 36, 37, 39, 40, 41, 42, 43, 44, 45, 46, 47, 49, 50,
51, 52, 53, 54, 55, 56, 57, 58, 59, 61, 62, 63, 65, 66, 67, 68, 69, 72, 73, 74, 75, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 97, 98, 99, 100]

The program in order to get these results was written in *Sage*.
*Here is the code:*

def sqrdiv(n):
   if n % 2 == 0:
     return n/2
   else:
     m = ceil(sqrt(n+1))
     return n + m**2

S = []
R = []
Q = []
BOUND1 = 250
BOUND2 = 100000
max = 0
for n in (1..BOUND2):
   T = [n]
   t = sqrdiv(n)
   while (t > 1) & (t not in T):
     T.append(t)
     t = sqrdiv(t)
     if t > 1:
       Q.append(n)
   lt = len(T)
   if n < BOUND1:
     S.append(lt)
   if max < lt:
     print n, lt
     R.append(lt)
     max = lt
print "First entries:", S
print "Records:", R
print "Cycles:", Q
print "Ready"

Only the function differs in *the second calculation*:

def sqrdiv(n):
   if n % 2 == 0:
     return n/2
   else:
     m = floor(sqrt(n-1))
     return n + m**2


--Matthijs


On 06-10-19 06:52, Ali Sada via SeqFan wrote:
> Hi everyone,
>
>   
>
> If we add a positiveinteger n to and we apply the following algorithm:
>
> “If n iseven, we divide it by two;
>
> If n is odd,we add it to m; where m is the smallest square > n.”
>
> When Icontinued with this algorithm it reached either 1, or 11 as its lowest point.
>
> For example:
>
> 13+16=29
>
> 29+36=65
>
> 65+81=146
>
> 146/2=73
>
> 73+81=154
>
> 154/2=77
>
> 77+81=158
>
> 158/2=79
>
> 79+81=160
>
> 160/32=5
>
> 5+9=14
>
> 14/2=7
>
> 7+9=16
>
> And 16 willgo to 1
>
> The numberof steps before reaching 1 or 11 is:
>
> 8 ,1 ,6 ,2 ,7,7 ,5 ,3 ,17 ,8 ,17 ,8 ,21 ,6 ,21 ,4 ,15 ,18 ,3 ,9 ,13 ,1 ,11 ,9 ,16 ,22 ,16 ,7,20 ,22 ,20 ,5 ,10 ,16 ,8 ,19 ,16 ,4 ,4 ,10 ,16 ,14 ,14 ,2 ,14 ,12 ,12 ,10 ,31,17 ,38 ,23 ,29 ,17 ,27 ,8 ,34 ,21 ,34 ,23 ,15 ,21 ,15 ,6 ,19 ,11 ,19 ,17 ,9 ,9,7 ,20 ,17 ,17 ,7 ,5 ,15 ,5 ,13 ,11 ,58 ,17 ,35 ,15 ,27 ,15 ,57 ,3 ,44 ,15 ,40,13 ,30 ,13 ,47 ,11 ,45 ,32 ,34 ,18,..
>
>   
>
> I wasn’table to check more than 580 numbers because I am using an obsolete software.I checked some big numbers (in the range of 10^6) manually, and couldn’t find differentresults.
>
>   
>
> I alsochecked when I changed the algorithm slightly (m is the largest square smallerthan n.) The 500 numbers I was able to check always went back to 1 or 5. Starting from n=2, thenumber of steps is:
>
>   
>
> 1 ,3 ,2 ,7,4 ,4 ,3 ,6 ,1 ,3 ,5 ,5 ,5 ,7 ,4 ,13 ,7 ,11 ,2 ,23 ,4 ,25 ,6 ,17 ,6 ,8 ,6 ,10 ,8,8 ,5 ,12 ,14 ,10 ,8 ,22 ,12 ,24 ,3 ,16 ,24 ,18 ,5 ,63 ,26 ,20 ,7 ,22 ,18 ,20 ,7,22 ,9 ,9 ,7 ,24 ,11 ,11 ,9 ,11 ,9 ,9 ,6 ,19 ,13 ,13 ,15 ,15 ,11 ,10 ,9 ,21 ,23,23 ,13 ,15 ,25 ,17 ,4 ,62 ,17 ,19 ,25 ,21 ,19 ,27 ,6 ,23 ,64 ,21 ,27 ,29 ,21 ,8,8 ,25 ,23 ,66 ,....
>
>   
>
>   
>
> I gotsimilar results when m was the largest cube, power of 4, etc., but I am less confidentin those results because the software I am using didn’t work well.
>
>   
>
> I wouldreally appreciate it if you could tell me why this is happening.
>
>   
>
> Best,
>
>   
>
> Ali
>
>   
>
>   
>
>
> --
> Seqfan Mailing list - http://list.seqfan.eu/



More information about the SeqFan mailing list