login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A333111 a(n) is the least positive integer not used earlier such that n+1 and the sum of terms up to a(n) are coprime. 0

%I #10 Mar 12 2020 03:11:37

%S 1,3,5,2,6,7,9,4,10,11,13,8,14,16,12,17,19,15,21,18,22,23,25,20,26,28,

%T 24,29,31,27,33,30,34,35,37,32,38,40,36,41,43,39,45,42,46,47,49,44,50,

%U 52,48,53,55,51,57,54,58,59,63,56,60,61,65,62,66,67

%N a(n) is the least positive integer not used earlier such that n+1 and the sum of terms up to a(n) are coprime.

%C Conjectured to be a permutation of the positive integers.

%e We start with a(1) = 1. To find a(2), we need the earliest positive integer such that a(1) + a(2) is coprime to 3. So, a(2) = 3. To find a(3), we can use neither 2 nor 4, because 6 and 8 have a common factor with 4, so we use a(3) = 5.

%o (PARI) A333111_vec(N,a=Vec(1,N),s=1,u=1)={ for(n=2,N, u+=1<<a[n-1]; for(k=valuation(u+1,2),oo, bittest(u,k) || gcd(s+k,n+1)>1 || [s+=a[n]=k,break]));a}

%K nonn

%O 1,2

%A _Ali Sada_ and _M. F. Hasler_, Mar 07 2020

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 24 15:57 EDT 2024. Contains 371961 sequences. (Running on oeis4.)