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.

A299143 a(n) is the least k > n such that gcd(k,n) > 1 and gcd(k+1,n+1) > 1.

This page as a plain text file.
%I A299143 #16 Mar 08 2018 16:16:46
%S A299143 8,9,14,15,20,21,14,15,32,33,38,39,20,21,50,51,56,57,26,27,68,69,34,
%T A299143 35,32,33,86,87,92,93,38,39,44,45,110,111,44,45,122,123,128,129,50,51,
%U A299143 140,141,62,63,56,57,158,159,64,65,62,63,176,177,182,183,68,69
%N A299143 a(n) is the least k > n such that gcd(k,n) > 1 and gcd(k+1,n+1) > 1.
%H A299143 Robert Israel, <a href="/A299143/b299143.txt">Table of n, a(n) for n = 2..10000</a>
%F A299143 From _Rémy Sigrist_, Feb 04 2018: (Start)
%F A299143 a(p) = 3 * p for any odd prime p.
%F A299143 a(2*k + 1) = a(2*k) + 1 for any k > 0.
%F A299143 a(n) = n + 2*A172170(n + 1) for any n > 1.
%F A299143 (End)
%e A299143 8 is the least k>2 such that gcd(8,2)>1 and gcd(9,3)>1. So a(2)=8.
%e A299143 15 is the least k>9 such that gcd(15,9)>1 and gcd(16,10)>1. Therefore a(9)=15.
%p A299143 f:= proc(n) local k;
%p A299143       for k from n+1 do if igcd(k,n)>1 and igcd(k+1,n+1)>1 then return k fi od
%p A299143 end proc:
%p A299143 map(f, [$2..100]); # _Robert Israel_, Mar 08 2018
%t A299143 Array[Block[{k = # + 1}, While[Or[CoprimeQ[#, k], CoprimeQ[# + 1, k + 1]], k++]; k] &, 62, 2] (* _Michael De Vlieger_, Feb 03 2018 *)
%o A299143 (PARI) a(n) = for (k=n+1, oo, if (gcd(n,k)>1 && gcd(n+1, k+1)>1, return (k))) \\ _Rémy Sigrist_, Feb 04 2018
%Y A299143 Cf. A172170.
%Y A299143 Cf. A061228 or A159475 (when simply gcd(k,n) > 1).
%K A299143 nonn
%O A299143 2,1
%A A299143 _Alex Ratushnyak_, Feb 03 2018