login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A357030 a(n) is the number of integers in 0..n having nonincreasing digits. 0
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 14, 15, 15, 15, 15, 15, 15, 15, 15, 16, 17, 18, 19, 19, 19, 19, 19, 19, 19, 20, 21, 22, 23, 24, 24, 24, 24, 24, 24, 25, 26, 27, 28, 29, 30, 30, 30, 30, 30, 31, 32, 33, 34, 35, 36, 37, 37, 37, 37, 38, 39, 40 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,2
LINKS
EXAMPLE
a(20) = 13 because there are 13 numbers in 0..20 whose digits are in nonincreasing order: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 20.
MAPLE
a:= proc(n) option remember; `if`(n<0, 0, a(n-1)+`if`(
(l-> is(l=sort(l)))(convert(n, base, 10)), 1, 0))
end:
seq(a(n), n=0..72); # Alois P. Heinz, Sep 12 2022
MATHEMATICA
Accumulate @ Table[If[GreaterEqual @@ IntegerDigits[n], 1, 0], {n, 0, 72}] (* Amiram Eldar, Sep 10 2022 *)
PROG
(PARI) a(n) = sum(k=0, n, my(d=digits(k)); d == vecsort(d, , 4)); \\ Michel Marcus, Sep 10 2022
CROSSREFS
Cf. A009996.
Sequence in context: A327886 A331166 A304232 * A303219 A071523 A297244
KEYWORD
nonn,base
AUTHOR
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 3 12:13 EDT 2024. Contains 372209 sequences. (Running on oeis4.)