Definition and more for this sequence?

10 views
Skip to first unread message

Ali Sada

unread,
Feb 6, 2025, 1:49:40 AM2/6/25
to seq...@googlegroups.com

Hi everyone,

 

Hope all is well.  

 

a(1) = 1, a(2) = 4.  For n > 2, a(n) is the least positive integer, not already in the sequence, that shares a common factor with n-1, but this common factor should not be equal to n-1.

a(3) = 6 (which shares a common factor with 2)

a(4) = 9 (which shares a common factor with 3)

a(5) = 2 (which shares a common factor with 4)

and so on.

We get

1, 4, 6, 9, 2, 10, 3, 14, 12, 15, 5, 22, 8, 26, 7, 18, 20, 34, 16, 38, 24, 27, 11, 46, 28, 30, 13, 33

 

Questions:

1.      There are some terms where n shares common factors with a(n), a(n-1), and (n+1) like 2,6,10,18, 20, 26. Will all these terms be even numbers?

2.      For prime numbers, a(2p+1) = p. Is this a correct statement?

3.      For p > 3, a(p+1)= 2p. Is this a correct statement?

 

Best,

 

Ali

Allan Wechsler

unread,
Feb 6, 2025, 12:05:51 PM2/6/25
to seq...@googlegroups.com
Ali, I am a little confused. You say that a(n) should have a common factor with n-1, but this common factor should not be exactly n-1. Then you say that (for n = 3) a(3) = 6. 6 does share a common factor with n-1 = 2. But this common factor is 2, which is exactly n-1, and therefore appears to violate your conditions.

Did you mean that a(n) should share a common factor with a(n-1) (in contrast with n-1 itself)? But in that case, I don't understand the n = 5 case, in which 2 shares a common factor with n-1, but not with a(n-1). So this interpretation can't be right.

I'm sure I have just misunderstood your conditions somehow.

-- Allan

--
You received this message because you are subscribed to the Google Groups "SeqFan" group.
To unsubscribe from this group and stop receiving emails from it, send an email to seqfan+un...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/seqfan/CACOfRNqrmKkjK4WT2rPt0%3DXOJ9b%2BwXyzfGN5C3Z90cuv-9wBHg%40mail.gmail.com.

Ali Sada

unread,
Feb 6, 2025, 12:45:52 PM2/6/25
to seq...@googlegroups.com
Hi Allan,

Thank you for your email and sorry for the mistake. I meant a(n), a(n-1), a(n+1) should not equal a(n).

Best,

Ali

Allan Wechsler

unread,
Feb 6, 2025, 1:04:50 PM2/6/25
to seq...@googlegroups.com
I am still confused, unfortunately. Why does a(5) = 2? 2 does not share a common factor with a(4) = 9.

Ali Sada

unread,
Feb 6, 2025, 1:26:53 PM2/6/25
to seq...@googlegroups.com
Thank you, Allan. a(5) should share a common factor with 4, which is n-1.

Best,

Ali

Allan Wechsler

unread,
Feb 6, 2025, 1:46:30 PM2/6/25
to seq...@googlegroups.com
Okay, I'm slowly starting to understand. So a(3) = 6, which shares a common factor with 2, which is n-1. But then, why do you say, "this common factor should not equal n-1"? In the case of a(3), the common factor is in fact 2, which does equal n-1, appearing to violate this stated constraint.

Ali Sada

unread,
Feb 6, 2025, 2:01:22 PM2/6/25
to seq...@googlegroups.com
That was the mistake I made. It should be reworded to reflect that a(n) is not equal to n, n-1, nor n+1.

Best,

Ali

D. S. McNeil

unread,
Feb 6, 2025, 2:17:20 PM2/6/25
to seq...@googlegroups.com

FWIW if for n > 2, a(n) = least unused y such that gcd(y,n-1) != 1 and y != n, n-1, n+1, then I can match all of Ali's values except for a(25), where I get 21 instead of 28 (21 is unused, and gcd(21, 24) = 3 != 1, and 21 != 24, 25, 26).


Doug


Allan Wechsler

unread,
Feb 6, 2025, 2:27:58 PM2/6/25
to seq...@googlegroups.com
D. S. McNeil's restatement of Ali Sada's intended rules have removed my last confusion, which was that I thought it was the common factor which was not to crowd the current index too closely, where the intended meaning was that it was the entry itself which was not to do so.

Ali Sada

unread,
Feb 6, 2025, 3:25:45 PM2/6/25
to seq...@googlegroups.com
Thank you Doug for the excellent definition. I made the calculations by hand, so most likely I made a mistake.
And now, since you and Allan clarified everything, can you please help me with the terms of the sequence? I need as many as possible.
Also, do you think the three conjectures I mentioned  are correct?

Best,

Ali

M F Hasler

unread,
Feb 6, 2025, 6:26:44 PM2/6/25
to seq...@googlegroups.com
On Thu, Feb 6, 2025 at 4:25 PM Ali Sada <ali....@gmail.com> wrote:
Thank you Doug for the excellent definition. I made the calculations by hand, so most likely I made a mistake.
And now, since you and Allan clarified everything, can you please help me with the terms of the sequence? 
I need as many as possible.

The following PARI program (run it in the browser here) allows you to get as many as you want:
(Use A(10^3) to get 10^3 terms, etc.) 
 
A(N,S=[0])=vector(N,n, if(n>2, for(k=S[1]+1,oo,setsearch(S,k)|| gcd(n-1,k)==1|| abs(k-n)<2|| [N=k,break]), N=n^2); S=setunion(S,[N]); while(#S>1&& S[2]==S[1]+1, S=S[^1]); N)

A(99)
[1, 4, 6, 9, 2, 10, 3, 14, 12, 15, 5, 22, 8, 26, 7, 18, 20, 34, 16, 38, 24, 27, 11, 46, 21, 30, 13, 33, 32, 58, 25, 62, 28, 36, 17, 40, 39, 74, 19, 42, 35, 82, 45, 86, 48, 50, 23, 94, 44, 56, 54, 57, 60, 106, 51, 65, 49, 63, 29, 118, 52, 122, 31, 66, 68, 55, 64, 134, 72, 75, 76, 142, 69, 146, 37, 70, 80, 84, 81, 158, 78, 87, 41, 166, 77, 90, 43, 93, 92, 178, 85, 98, 88, 96, 47, 100, 99, 194, 91]

Also, do you think the three conjectures I mentioned  are correct?

The first isn't, but the others, yes, I think so:


Questions:
1.      There are some terms where n shares common factors with a(n), a(n-1), and (n+1) like 2,6,10,18, 20, 26. Will all these terms be even numbers?


I guess you mean a(n+1) because gcd(n, n+1) = 1, always.


Also, I first thought that you wanted gcd(n, a(n-1), a(n), a(n+1)) > 1, but that gives only results >= 18:


select(n->gcd([n,AA[n],AA[n-1],AA[n+1]])>1,[2..399])

% = [18, 20, 50, 68, 110, 138, 172, 174, 176, 189, 240, 242, 246, 248, 258, 286, 288, 318, 320, 321, 374]


(Note that we have odd 189 and 321 in the above.)


So, instead, looking for gcd(n, a(k)) > 1 for k = n-1, n, n+1 (which is less restrictive):


select(n-> gcd(n,AA[n])>1 && gcd(n,AA[n-1])>1 && gcd(n,AA[n+1])>1,[2..199])

% = [6, 10, 14, 18, 20, 30, 34, 42, 46, 50, 54, 62, 66, 68, 70, 72, 78, 90, 94, 106, 110, 114, 126, 130, 138, 140, 150, 154, 156, 172, 174, 176, 182, 186, 189, 190]


Obviously, this is a subsequence, so there are the same odd 189, 321, but also others (e.g. 345, 357 which are not in the other sequence).


2.      For prime numbers, a(2p+1) = p. Is this a correct statement?


3.      For p > 3, a(p+1)= 2p. Is this a correct statement?

 

Yes, I'm confident that's right, but I don't have time to think about a proof. 

(I've checked it up to A(9999)=4999, which is a (very) "late bird", the 10 preceding terms are all of order 10^4 ; only every 12th term in this region is half that size, e.g., A(9987) = 4993, A(9975) = 4987 are the preceding two smaller terms.)


- Maximilian 

Ali Sada

unread,
Feb 6, 2025, 10:30:50 PM2/6/25
to seq...@googlegroups.com
Thank you very much, Maximilian. I really appreciate it. I proposed the sequence (A380876). I would really appreciate it if you could help me with the definition and terms of the subsequence
18, 20, 50, 68, 110, 138, 172, 174, 176, 189, 240, 242, 246, 248, 258, 286, 288, 318, 320, 321, 374
Can you please also help with another sequence which is the first appearances of the gcd's in this subsequence? Here, 2 first appears as a gcd at n = 18, (20,34,16). 3 appears as gcd for the first time at n = 189, (198, 186, 192). I think this will be a 'slow' sequence. Will the gcd's appear in order?

Best,

Ali

Reply all
Reply to author
Forward
0 new messages