%I
%S 1,2,3,4,7,6,5,8,9,10,12,14,18,20,11,15,13,19,21,16,22,25,24,17,23,26,
%T 29,30,28,27,32,36,34,40,33,31,37,43,46,49,48,35,39,41,38,42,47,50,54,
%U 44,45,52,60,53,51,55,57,59,65,56,62,63,58,66,61,64,69,68,75,67,70,72,74,78,82,73,79,81,80,71,89,84,77
%N a(n+1) = the least positive integer not occurring earlier which yields a prime when added to the sum of digits of a(n), starting with a(1) = 1.
%C A variant of A267299, in contrast to which this appears to be a permutation of the positive integers.
%C The numbers that remain for a long time the least unused numbers are those which are close to the beginning of a large prime gap. For example, the number 1326 remains the smallest unused number because it is followed by a prime, 1327 (but until 10^4 there is no number whose digital sum would yield 1) and then a large gap to the next prime, 1361: This gap of 6126 = 35 must equal to the digital sum of the preceding term, but the least such number is 8999 which occurs only as a(8891). The subsequenct "late bird" is 4826, which is again too close to the next prime, 4831 (the number 5000 occurred earlier so the digital sums are >= 6 until 10^4), and again at distance 35 from the subsequent prime, 4861, so the next possible predecessor is 9899 = a(9779). Similarly, the primes following 6912 are at distance 5 and 35, whence this remains the smallest unused number beyond n = 10^4.
%H M. F. Hasler, <a href="/A267308/b267308.txt">Table of n, a(n) for n = 1..10000</a>
%H J. Mason, M. F. Hasler, in reply to E. Angelini, <a href="http://list.seqfan.eu/pipermail/seqfan/2016January/015971.html">A light variation</a>, SeqFan list, Jan. 20, 2016
%o (PARI) A267308(n,show=0,a=1,u=0,L=1)={for(n=2,n,show&&print1(a",");bittest(u+=1<<(aL),0)&&u>>=L+L+=valuation(u+1,2);a=sumdigits(a);for(k=L,9e9,!bittest(u,kL)&&isprime(k+a)&&(a=k)&&break));if(type(show)=="t_VEC",[a,L,u],a)}
%Y Cf. A267299.
%K nonn,base
%O 1,2
%A _John Mason_ and _M. F. Hasler_, Jan 20 2016
