login
Lexicographically earliest sequence of distinct nonnegative integers such that the sequence A051699(a(n)) (distance from the nearest prime) has the same sequence of digits.
2

%I #17 Feb 04 2023 16:33:31

%S 1,10,2,0,3,26,9,119,532,4,6,896,118,34,15,93,121,531,898,205,8,12,

%T 533,50,117,14,122,1078,56,16,21,18,144,64,20,895,1138,899,25,5,186,

%U 1077,22,27,204,76,86,206,7,24,28,120,30,123,32,33,35,36,11,300

%N Lexicographically earliest sequence of distinct nonnegative integers such that the sequence A051699(a(n)) (distance from the nearest prime) has the same sequence of digits.

%C In the definition, "has the same digits" means that the concatenation of the terms yields the same string of digits, for the sequence a(.) and the sequence A051699(a(.)).

%C Conjectured to be a permutation of the nonnegative integers. The inverse permutation would start (3, 0, 2, 4, 9, 39, 10, 48, 20, 6, 1, 58, 21, 75, 25, 14, ...).

%H Eric Angelini, <a href="https://cinquantesignes.blogspot.com/2023/01/digit-spines.html">Digit-spines</a>, personal blog "Cinquante signes" on blogspot.com, Jan. 11, 2023.

%e Below, row "p" lists the closest prime to a(n) and row "d" the absolute difference |a(n)-p|. We have the same sequence of digits in rows a (this sequence) and d:

%e n : 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 ...

%e a : 1 10 2 0 3 26 9 119 532 4 6 896 118 34 15 ...

%e p : 2 11 2 2 3 23 7 113 523 3 5 887 113 31 13 ...

%e d : 1 1 0 2 0 3 2 6 9 1 1 9 5 3 2 ...

%o (PARI) spine(f, N=20, S=[], d=[], md = n -> if(n, digits(n), [0])) = { vector(N, n, my(m, j=1); for(k=0, oo, setsearch(S, k) && next; while( f(j) < k, j++); m = md(min(m = f(j) - k, iferr(k - f(j-1), E, m))); if(m == concat(d, md(k))[1..#m], d = concat(d, md(k))[#m+1 .. -1]; m=k; break)); S = setunion(S, [m]); m)}

%o spine(prime, 200) \\ 200 terms of this sequence

%Y Cf. A051699 (distance from the nearest prime), A000040 (the primes).

%Y Cf. A359736, A359737 (similar for squares and Fibonacci numbers).

%K nonn,base

%O 0,2

%A _M. F. Hasler_ and _Eric Angelini_, Jan 12 2023