login
a(n+1) contains as substring the sum of its first digit plus the last digit of a(n); lexicographic first permutation of the nonnegative integers with this property.
6

%I #18 Dec 23 2024 14:53:44

%S 0,1,12,13,14,15,16,17,18,19,10,2,24,26,28,109,100,3,25,27,29,101,23,

%T 36,39,102,35,38,119,103,47,108,129,104,37,118,139,105,49,106,107,128,

%U 149,110,4,48,159,211,34,59,312,46,117,138,169,413,58,179,514,115,116,127,148,189,615,126,137,158,190,5,136,147,168,191,45,146,157,178,192,57,180,6,167,181,56,170,7

%N a(n+1) contains as substring the sum of its first digit plus the last digit of a(n); lexicographic first permutation of the nonnegative integers with this property.

%C When a(n) is a multiple of 10, then a(n+1) is the least number not occurring earlier. Therefore all nonnegative integers occur.

%C Numbers starting with and/or having only large digits occur late, typically after numbers ending in zero. This is the case for 1, 2, 3, 4, 5, 6, 7, 8 = a(104), 9 = a(114), ..., 90 = a(647), ..., 98 = a(729), 99 = a(732), ..., respectively preceded by 0, 10, 100, 110, 190, 180, 170, ..., 510, ..., 1310, 1410, ...

%H M. F. Hasler, <a href="/A267760/b267760.txt">Table of n, a(n) for n = 0..999</a>

%H E. Angelini, <a href="https://web.archive.org/web/*/http://list.seqfan.eu/oldermail/seqfan/2016-February/016054.html">A sum visible in the 2d integer</a>, SeqFan list, Feb. 3, 2016.

%o (PARI) A267760(n, flag=0, a=List(0), u=[])={ for(n=1, n, u=setunion(u, [a[n]]); if(a[n]==u[#u], bittest(flag,1) && print1(a[n]","); bittest(flag,2) && print1(n-1",")); if(a[n]==u[1]+1, bittest(flag,3) && print1(a[n]","); bittest(flag,4) && print1(n-1,",")); while(#u>1&&u[2]==u[1]+1, u=u[^1]);for(k=u[1]+1, 9e9, setsearch(u, k) && next; d=digits(k); setsearch(Set(if(a[n]%10+d[1]<10, d, vector(#d-1, i, d[i+1]+d[i]*10))), a[n]%10+d[1]) && listput(a, k) && break)); if(bittest(flag,0),Vec(a),a[n])} \\ flag may be the sum of any of the following: 1: return [a(0)..a(n)], 2: print records, 4: print indices of records, 8: print "late birds" A267771, 16: print indices of late birds.

%K nonn,base,look

%O 0,3

%A _Eric Angelini_ and _M. F. Hasler_, Feb 05 2016