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 A248025 #19 Dec 23 2024 14:53:44 %S A248025 1,10,11,2,20,21,3,30,31,4,40,41,5,50,51,6,60,61,7,70,71,8,80,81,9,90, %T A248025 91,12,32,52,72,92,22,42,62,82,13,43,73,14,53,83,23,54,93,33,63,94,44, %U A248025 84,34,74,24,64,15,65,25,75,35,85,45,95,55,16,76,46,17,86,56,26,87,66,36,96 %N A248025 Lexicographically earliest permutation of the positive integers such that the first digit of a(n+1) is the digital root of a(n). %H A248025 Reinhard Zumkeller, <a href="/A248025/b248025.txt">Table of n, a(n) for n = 1..10000</a> %H A248025 E. Angelini, <a href="https://web.archive.org/web/*/http://list.seqfan.eu/oldermail/seqfan/2014-September/013711.html">Fun and quick permutation (with a digital root)</a>, SeqFan list, Sep 29 2014. %H A248025 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a> %t A248025 Nest[Append[#, Block[{k = 1, r = Mod[#[[-1]], 9] + 9 Boole[Mod[#[[-1]], 9] == 0]}, While[Nand[FreeQ[#, k], IntegerDigits[k][[1]] == r], k++]; k]] &, {1}, 73] (* _Michael De Vlieger_, Oct 15 2020 *) %o A248025 (PARI) a(n,S=1,u=2)={for(i=1,n,print1(S",");S=(S-1)%9+1;for(k=1,9e9,bittest(u,k)&&next;S==digits(k)[1]||next;u+=1<<S=k;break));S} %o A248025 (Haskell) %o A248025 import Data.List (delete) %o A248025 a248025 n = a248025_list !! (n-1) %o A248025 a248025_list = 1 : f 1 [2..] where %o A248025 f x zs = g zs where %o A248025 g (y:ys) = if a000030 y == a010888 x %o A248025 then y : f y (delete y zs) else g ys %o A248025 -- _Reinhard Zumkeller_, Sep 30 2014 %Y A248025 Cf. A010888 (digital root); similar sequences: A248024,... %Y A248025 Cf. A247879 (inverse), A000030. %K A248025 nonn,base %O A248025 1,2 %A A248025 _Eric Angelini_ and _M. F. Hasler_, Sep 29 2014