This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A372559 #20 May 13 2024 09:15:04 %S A372559 0,1,3,9,21,51,111,321,741,2001,4311,8931,22791,52821,112881,293061, %T A372559 803571,1824591,4887651,14587341,33986721,92184861,208581141, %U A372559 431674011,877859751,2216416971,4893531411,11363224641,24302611101,63120770481,140757089241,341317579371,742438559631,1945801500411,4352527381971,11773265516781 %N A372559 a(n) is the index of the first occurrence of n in A371091. %C A372559 The pattern in the primorial base expansion (A049345) of the terms is constructed recursively, so that the digit-positions of the primorial base expansion are successively filled with the positive terms of this sequence (1, 3, 9, 21, ...), up to that term that still fits to the position, i.e., is less than prime(i), for the positions i >= 1 indexed from the least significant end of the expansion. The nonleading digits are "frozen", and only the most significant digit keeps on increasing from a(1) to the maximal allowed a(x) for its position, after which the next term's expansion is obtained by prepending 1 to the front. See the examples. %H A372559 Antti Karttunen, <a href="/A372559/b372559.txt">Table of n, a(n) for n = 0..1001</a> %H A372559 <a href="/index/Pri#primorialbase">Index entries for sequences related to primorial base</a> %F A372559 For n >= 0, A371091(a(n)) = n, and for all k < a(n), A371091(k) < n. %e A372559 n, a(n) in primorial base %e A372559 0, 0 = 0 %e A372559 1, 1 = 1 %e A372559 2, 3 = 11 %e A372559 3, 9 = 111 %e A372559 4, 21 = 311 (3 is less than prime(3)=5, so can be used now) %e A372559 5, 51 = 1311 (9 cannot yet be used, so append 1 to the front) %e A372559 6, 111 = 3311 (and then replace by next higher term that fits) %e A372559 7, 321 = 13311 %e A372559 8, 741 = 33311 %e A372559 9, 2001 = 93311 (9 is less than prime(5)=11, so can be used now) %e A372559 10, 4311 = 193311 %e A372559 11, 8931 = 393311 %e A372559 12, 22791 = 993311 %e A372559 13, 52821 = 1993311 %e A372559 14, 112881 = 3993311 %e A372559 15, 293061 = 9993311 %e A372559 16, 803571 = 19993311 %e A372559 17, 1824591 = 39993311 %e A372559 18, 4887651 = 99993311 %e A372559 19, 14587341 = 199993311 %e A372559 20, 33986721 = 399993311 %e A372559 21, 92184861 = 999993311 %e A372559 22, 208581141 = {21}99993311 (21 is less than prime(9)=23, so can be used now) %e A372559 23, 431674011 = 1{21}99993311 %e A372559 etc. %o A372559 (PARI) %o A372559 A002110(n) = prod(i=1,n,prime(i)); %o A372559 A235224(n) = { my(s=0, p=2); while(n, s++; n = n\p; p = nextprime(1+p)); (s); }; %o A372559 A276153(n) = { my(p=2,d=0); while(n, d = n%p; n = n\p; p = nextprime(1+p)); (d); }; %o A372559 memoA372559 = Map(); %o A372559 A372559(n) = if(n<=2, n+(n>1), my(v); if(mapisdefined(memoA372559,n,&v), v, my(prev=A372559(n-1), hi=A235224(prev), hd=A276153(prev),k=0,u); while(A372559(k)<hd, k++); u = A372559(1+k); v = if(u>=prime(hi), prev+A002110(hi), prev+((u-hd)*A002110(hi-1))); mapput(memoA372559,n,v); (v))); %Y A372559 Positions of records in A371091. %Y A372559 Cf. A002110, A235224, A276153. %K A372559 nonn,base %O A372559 0,3 %A A372559 _Antti Karttunen_, May 11 2024