The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation. Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A267308 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. 1
 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, 29, 30, 28, 27, 32, 36, 34, 40, 33, 31, 37, 43, 46, 49, 48, 35, 39, 41, 38, 42, 47, 50, 54, 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 (list; graph; refs; listen; history; text; internal format)
 OFFSET 1,2 COMMENTS A variant of A267299, in contrast to which this appears to be a permutation of the positive integers. 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 61-26 = 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. LINKS M. F. Hasler, Table of n, a(n) for n = 1..10000 J. Mason, M. F. Hasler, in reply to E. Angelini, A light variation, SeqFan list, Jan. 20, 2016 PROG (PARI) A267308(n, show=0, a=1, u=0, L=1)={for(n=2, n, show&&print1(a", "); bittest(u+=1<<(a-L), 0)&&u>>=-L+L+=valuation(u+1, 2); a=sumdigits(a); for(k=L, 9e9, !bittest(u, k-L)&&isprime(k+a)&&(a=k)&&break)); if(type(show)=="t_VEC", [a, L, u], a)} CROSSREFS Cf. A267299. Sequence in context: A267299 A077223 A265369 * A264965 A266644 A329411 Adjacent sequences:  A267305 A267306 A267307 * A267309 A267310 A267311 KEYWORD nonn,base AUTHOR John Mason and M. F. Hasler, Jan 20 2016 STATUS approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

Last modified October 17 11:43 EDT 2021. Contains 348048 sequences. (Running on oeis4.)