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!)
A173381 a(n) = b_n(p_(n+1)) where p_n is the n-th prime, b_n(1)=1, b_n(2)=p_n, and for k>=3, b_n(k) is the smallest number larger than b_n(k-1) such that, for all i<k, b_n(k) is relatively prime to b_n(i) iff k is relatively prime to i. 0

%I #20 Nov 28 2020 09:09:38

%S 3,11,31,163,661,929,2041,21341,15989,47387,125117,263411,123493,

%T 10426601,3654221,4167127,86622397,4036267,3910993,541513877

%N a(n) = b_n(p_(n+1)) where p_n is the n-th prime, b_n(1)=1, b_n(2)=p_n, and for k>=3, b_n(k) is the smallest number larger than b_n(k-1) such that, for all i<k, b_n(k) is relatively prime to b_n(i) iff k is relatively prime to i.

%p b:= proc(n, k) option remember; local ok, m, i;

%p if k=1 then 1

%p elif k=2 then ithprime(n)

%p else for m from b(n, k-1)+1 do

%p ok:= true;

%p for i from 1 to k-1 do

%p if igcd(k, i)=1 xor igcd(m, b(n, i))=1

%p then ok:= false; break fi

%p od;

%p if ok then break fi

%p od; m

%p fi

%p end:

%p a:= n-> b(n, ithprime(n+1));

%p seq(a(n), n=1..10); # _Alois P. Heinz_, Nov 22 2010

%t b[n_, k_] := b[n, k] = Module[{ok, m, i}, Which[k==1, 1, k==2, Prime[n], True, For[m = b[n, k - 1] + 1, True, m++, ok = True; For[i = 1, i <= k - 1, i++, If[Xor[GCD[k, i]==1, GCD[m, b[n, i]]==1], ok = False; Break[]]]; If[ok, Break[]]]; m]];

%t a[n_] := b[n, Prime[n + 1]];

%t Array[a, 10] (* _Jean-François Alcover_, Nov 28 2020, after _Alois P. Heinz_ *)

%Y Cf. A000040, A172980, A172999.

%K nonn

%O 1,1

%A _Vladimir Shevelev_, Nov 22 2010

%E More terms from _Alois P. Heinz_, Nov 22 2010

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 22:17 EDT 2024. Contains 371964 sequences. (Running on oeis4.)