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.
%I A159698 #41 Sep 09 2016 12:08:30 %S A159698 4,5,7,8,11,12,13,14,15,16,17,18,19,20,21,22,23,24,29,30,32,33,37,38, %T A159698 39,40,42,44,47,48,53,54,55,56,57,58,59,60,62,63,67,68,71,72,74,75,79, %U A159698 80,81,82,84,85,89,90,91,92,93,94,97,98,101,102,104,105,106,108,109,110,111,112 %N A159698 Minimal increasing sequence beginning with 4 such that n and a(n) are either both prime or both nonprime. %C A159698 For n >= 11, a(n) = A159559(n), which means the two sequences merge. %C A159698 We may define other sequences a(p-1,n), p prime, which start a(p-1,1)=p-1 and with the same property of n and a(p-1,n) being jointly prime or nonprime. %C A159698 We find that for p=7, 11 and 13, the sequences a(6,n), a(10,n) and a(12,n) also merge with the current sequence for sufficiently large n. Does this also hold for primes >=17? %C A159698 It was verified for primes p with 7<=p<=223 that this sequence a(4,n) and a(p-1,n) eventually merge. The corresponding values of n are 47, 683, 1117, 6257, 390703. - _Alois P. Heinz_, Mar 09 2011 %H A159698 Alois P. Heinz, <a href="/A159698/b159698.txt">Table of n, a(n) for n = 1..20000</a> %H A159698 V. Shevelev, <a href="http://arxiv.org/abs/0904.2101">Several results on sequences which are similar to the positive integers</a>, arXiv:0904.2101 [math.NT], 2009. %F A159698 a(1) = 4; for n>1, a(n) = min { m > a(n-1) : m is prime iff n is prime }. %p A159698 a:= proc(n) option remember; local m; %p A159698 if n=1 then 4 %p A159698 else for m from a(n-1)+1 while isprime(m) xor isprime(n) %p A159698 do od; m %p A159698 fi %p A159698 end: %p A159698 seq(a(n), n=1..80); # _Alois P. Heinz_, Nov 21 2010 %t A159698 a[n_] := a[n] = If[n==1, 4, For[m = a[n-1]+1, Xor[PrimeQ[m], PrimeQ[n]], m++]; m]; Table[a[n], {n, 1, 80}] (* _Jean-François Alcover_, Jan 31 2016, after _Alois P. Heinz_ *) %Y A159698 Cf. A159559, A159560, A159615, A159619, A159629, A229019, A229132. %K A159698 nonn,easy %O A159698 1,1 %A A159698 _Vladimir Shevelev_, Apr 20 2009, May 04 2009 %E A159698 More terms from _Alois P. Heinz_, Nov 21 2010