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 A037884 #11 Dec 30 2023 16:50:37 %S A037884 0,0,0,0,0,0,0,0,1,2,3,4,5,0,0,0,1,2,3,4,0,0,0,0,1,2,3,0,0,0,0,0,1,2, %T A037884 0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,2,3,4,5,6,0,0,1,2,3,4,5,1,1,1,2,3,4, %U A037884 5,2,2,2,2,3,4,5,3,3,3,3,3,4,5,4,4,4,4,4,4,5 %N A037884 a(n)=(1/2)*Sum{|d(i)-e(i)|} where Sum{d(i)*7^i} is the base 7 representation of n and e(i) are the digits d(i) in nondecreasing order. %p A037884 A037884 := proc(n) %p A037884 local a,dgs,dgsE ; %p A037884 a := 0 ; %p A037884 dgs := convert(n,base,7); %p A037884 dgsE := sort(dgs) ; %p A037884 for i from 1 to nops(dgs) do %p A037884 a := a+ abs(op(i,dgs)-op(i,dgsE)) ; %p A037884 end do: %p A037884 a/2 ; %p A037884 end proc: # _R. J. Mathar_, Oct 19 2015 %K A037884 nonn,base %O A037884 1,10 %A A037884 _Clark Kimberling_ %E A037884 Definition swapped with A037875. - _R. J. Mathar_, Oct 19 2015