

A165617


The number of values of k such that k is equal to the number of 1's in the base n digits of all numbers <= k.


1




OFFSET

2,1


COMMENTS

The greatest number counted by a(n) is 1...10, where the number of 1's is n1. [From Martin J. Erickson (erickson(AT)truman.edu), Oct 08 2010]
These numbers, described in previous comment, 10(2), 110(3), 1110(4), ... expressed in base 10 are: 2, 12, 84, 780, 9330, 137256, 2396744, 48427560, 1111111110, ...  Michel Marcus, Aug 20 2013
The sequence described in the previous two comments is A226238.  Ralf Stephan, Aug 25 2013


LINKS

Table of n, a(n) for n=2..10.


EXAMPLE

a(3)=4 since there are four values of k such that k is equal to the number of 1's in the base 3 digits of all numbers <= k, namely, 1, 4, 5, 12.


PROG

(PARI) a(n) = {nmax = (n^n  1)/(n  1)  1; s = 0; nb = 0; for (i=0, nmax, digs = digits(i, n); s += sum (k=1, #digs, (digs[k] == 1)); if (s == i, nb++); ); nb; } \\ Michel Marcus, Aug 20 2013


CROSSREFS

Cf. A014778
Sequence in context: A294094 A290288 A126215 * A273170 A135447 A163339
Adjacent sequences: A165614 A165615 A165616 * A165618 A165619 A165620


KEYWORD

nonn,base


AUTHOR

Martin J. Erickson (erickson(AT)truman.edu), Sep 22 2009


EXTENSIONS

Example corrected Martin J. Erickson (erickson(AT)truman.edu), Sep 25 2009


STATUS

approved



