cp's OEIS Frontend

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.

A138470 Number of numbers less than n having a smaller sum of digits.

This page as a plain text file.
%I A138470 #11 Feb 01 2019 20:35:43
%S A138470 0,1,2,3,4,5,6,7,8,9,1,3,5,7,9,11,13,15,17,19,3,6,9,12,15,18,21,24,27,
%T A138470 29,6,10,14,18,22,26,30,34,37,39,10,15,20,25,30,35,40,44,47,49,15,21,
%U A138470 27,33,39,45,50,54,57,59,21,28,35,42,49,55,60,64,67,69,28,36,44,52,59,65
%N A138470 Number of numbers less than n having a smaller sum of digits.
%C A138470 a(n) + A138471(n) + A138472(n) = n.
%H A138470 R. Zumkeller, <a href="/A138470/b138470.txt">Table of n, a(n) for n = 0..1500</a>
%H A138470 <a href="/index/Coi#Colombian">Index entries for Colombian or self numbers and related sequences</a>
%e A138470 a(42)=#{0,1,2,3,4,5,10,11,12,13,14,20,21,22,23,30,31,32,40,41}=20.
%p A138470 digitsum:=proc(n) options operator, arrow: add(convert(n, base, 10)[j],j=1.. nops(convert(n,base,10))) end proc: a:=proc (n) local ct, j: ct:=0: for j from 0 to n-1 do if digitsum(j) < digitsum(n) then ct:=ct+1 else end if end do: ct end proc: seq(a(n),n=0..75); # _Emeric Deutsch_, Mar 31 2008
%Y A138470 Cf. A007953.
%K A138470 nonn,base,look
%O A138470 0,3
%A A138470 _Reinhard Zumkeller_, Mar 19 2008