%I #24 Sep 17 2016 10:12:00
%S 2,11,47,47,47,683,683,683,683,683,683,683,683,683,683,683,683,1117,
%T 1117,1117,1117,1117,1117,1117,1117,1117,1117,1117,6257,6257,6257,
%U 6257,6257,6257,6257,6257,390703,390703,390703,390703,390703,390703,390703,390703
%N Minimal position at which the sequence defined in the same way as A159559 but with initial term prime(n) merges with A159559; a(n)=0 if there is no such position.
%C All positive terms of the sequence are prime.
%C Conjecture: all terms are positive.
%H 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.
%e For n>=2, denote by A_n the sequence defined in the same way as A159559 but with initial term A_n(2)=prime(n). In case n=2 A_2(2)=3, hence A_2 = A159559, and so a(2)=2. Suppose n=3. Then A_3(2)=5 and by the definition of A159559 we have A_3(3)=7, A_3(4)=8, A_3(5)=11, A_3(6)=12, A_3(7)=13, A_3(8)=14, A_3(9)=15, A_3(10)=16, A_3(11)=17. Since A159559(11) is also 17, then, beginning with 11, A_3 merges with A159559 and a(3)=11. - _Vladimir Shevelev_, Sep 11 2016.
%p b:= proc(n, p) option remember; local m;
%p if n=2 then p
%p else for m from b(n-1,p)+1 while isprime(m) xor isprime(n)
%p do od; m
%p fi
%p end:
%p a:= proc(n) option remember; local k;
%p for k from 2 while b(k, 3)<>b(k, ithprime(n)) do od; k
%p end:
%p seq(a(n), n=2..20); # _Alois P. Heinz_, Sep 15 2013
%t f[n_, r_] := Block[{a}, a[2] = n; a[x_] := a[x] = If[PrimeQ@ x, NextPrime@ a[x - 1], NestWhile[# + 1 &, a[x - 1] + 1, PrimeQ@ # &]]; Map[a, Range[2, r]]]; nn = 10^4; t = f[3, nn]; Table[1 + First@ Flatten@ Position[BitXor[t, f[Prime@ n, nn]], 0], {n, 2, 37}] (* _Michael De Vlieger_, Sep 13 2016, after _Peter J. C. Moses_ at A159559 *)
%Y Cf. A159559, A159698.
%K nonn
%O 2,1
%A _Vladimir Shevelev_, Sep 11 2013
%E More terms from _Alois P. Heinz_, Sep 15 2013
|