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.

A172999 a(1)=1, a(2)=4; for n>=3, a(n) is the smallest number larger than a(n-1) such that, for every k a(n) is relatively prime to a(k) iff n is relatively prime to k.

This page as a plain text file.
%I A172999 #17 Nov 02 2012 16:12:21
%S A172999 1,4,5,6,7,10,11,12,25,28,29,30,31,44,175,178,179,180,181,182,275,348,
%T A172999 349,360,371,372,395,396,397,420,421,422,725,1074,1309,1310,1319,1448,
%U A172999 2945,2954,2957,2970,2971,3016,3325,4188,4189,4190,4213,4214,4475,4526
%N A172999 a(1)=1, a(2)=4; for n>=3, a(n) is the smallest number larger than a(n-1) such that, for every k<n, a(n) is relatively prime to a(k) iff n is relatively prime to k.
%H A172999 Alois P. Heinz, <a href="/A172999/b172999.txt">Table of n, a(n) for n = 1..300</a>
%p A172999 a:= proc(n) option remember;
%p A172999      local ok, m, k;
%p A172999      if n<3 then 3*n-2
%p A172999    else for m from a(n-1)+1 do
%p A172999           ok:= true;
%p A172999           for k from 1 to n-1 do
%p A172999             if igcd(n, k)=1 xor igcd(m, a(k))=1
%p A172999                then ok:= false; break fi
%p A172999           od;
%p A172999           if ok then break fi
%p A172999         od; m
%p A172999      fi
%p A172999     end:
%p A172999 seq (a(n), n=1..50);  # _Alois P. Heinz_, Nov 21 2010
%t A172999 t={1,4}; Do[nxt=t[[-1]]+1; While[CoprimeQ[n,Range[n-1]] != CoprimeQ[nxt,t], nxt++]; AppendTo[t,nxt], {n,3,50}]; t
%Y A172999 Cf. A172980, A151976, A159559, A159560, A159615, A159619, A159629, A159698, A160217.
%K A172999 nonn
%O A172999 1,2
%A A172999 _Vladimir Shevelev_, Nov 21 2010
%E A172999 More terms from _Alois P. Heinz_, Nov 21 2010