OFFSET
1,1
COMMENTS
Permutation of the non-binary powers, cf. A057716. - Reinhard Zumkeller, Aug 15 2010
LINKS
R. Zumkeller, Table of n, a(n) for n = 1..1000
Rémy Sigrist, PARI program for A140977
EXAMPLE
4 in binary is 100, which has 2 zeros. Checking the binary representations of the integers > 4: 5 = 101 in binary, which has one 0. 6 = 110 in binary, which has one 0. 7 = 111 in binary, which has zero 0's. 8 = 1000 in binary, which has three 0's. But 9 = 1001 in binary, which has two 0's, the same number of zeros that 4 (= 100 in binary) has. So a(4) = 9.
MATHEMATICA
a = {}; For[n = 1, n < 100, n++, i = n + 1; While[ ! DigitCount[i, 2, 0] == DigitCount[n, 2, 0], i++ ]; AppendTo[a, i]]; a (* Stefan Steinerberger, Aug 25 2008 *)
snz[n_]:=Module[{dn=DigitCount[n, 2, 0], k=n+1}, While[DigitCount[k, 2, 0] != dn, k++]; k]; Array[snz, 100] (* Harvey P. Dale, May 15 2015 *)
PROG
(PARI) See Links section.
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Leroy Quet, Aug 17 2008
EXTENSIONS
More terms from Stefan Steinerberger, Aug 25 2008
STATUS
approved