cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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 is relatively prime to b_n(i) iff k is relatively prime to i.

This page as a plain text file.
%I A173381 #20 Nov 28 2020 09:09:38
%S A173381 3,11,31,163,661,929,2041,21341,15989,47387,125117,263411,123493,
%T A173381 10426601,3654221,4167127,86622397,4036267,3910993,541513877
%N 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.
%p A173381 b:= proc(n, k) option remember; local ok, m, i;
%p A173381       if k=1 then 1
%p A173381     elif k=2 then ithprime(n)
%p A173381     else for m from b(n, k-1)+1 do
%p A173381            ok:= true;
%p A173381            for i from 1 to k-1 do
%p A173381              if igcd(k, i)=1 xor igcd(m, b(n, i))=1
%p A173381                 then ok:= false; break fi
%p A173381            od;
%p A173381            if ok then break fi
%p A173381          od; m
%p A173381       fi
%p A173381     end:
%p A173381 a:= n-> b(n, ithprime(n+1));
%p A173381 seq(a(n), n=1..10);  # _Alois P. Heinz_, Nov 22 2010
%t A173381 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 A173381 a[n_] := b[n, Prime[n + 1]];
%t A173381 Array[a, 10] (* _Jean-François Alcover_, Nov 28 2020, after _Alois P. Heinz_ *)
%Y A173381 Cf. A000040, A172980, A172999.
%K A173381 nonn
%O A173381 1,1
%A A173381 _Vladimir Shevelev_, Nov 22 2010
%E A173381 More terms from _Alois P. Heinz_, Nov 22 2010