OFFSET
1,2
COMMENTS
From Reinhard Zumkeller, Aug 29 2009: (Start)
A023416(a(n)) = 1;
apart from the initial term the sequence can be seen as a triangle read by rows, see A164874;
Zero and numbers of form 2^m-2^k-1, 2 <= m, 0 <= k <= m-2. - Zak Seidov, Aug 06 2010
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 1..1000
FORMULA
a(n) = 2^(g(n))-1-2^(((2*g(n)-1)^2-1-8*n)/8) with g(n)=int((sqrt(8*n-7)+3)/2) for all n>0 and g(0)=1. - Ulrich Schimke (ulrschimke(AT)aol.com)
a(n+1) = A140977(a(n)) for any n > 1. - Rémy Sigrist, Feb 06 2020
Sum_{n>=2} 1/a(n) = A160502. - Amiram Eldar, Oct 06 2020
EXAMPLE
23 is OK because it is '10111' in base 2.
MATHEMATICA
Sort[Flatten[{{0}, Table[2^n - 2^m - 1, {n, 2, 50}, {m, 0, n - 2}]}]] (* Zak Seidov, Aug 06 2010 *)
Select[Range[0, 2100], DigitCount[#, 2, 0]==1&] (* Harvey P. Dale, Dec 19 2021 *)
PROG
(C) long int element (long int i) { return (pow(2, g(i))-1-pow(2, (pow(2*g(i)-1, 2)-1-8*i)/8)); } long int g(long int m) {if (m==0) return(1); return ((sqrt(8*m-7)+3)/2); }
(Haskell)
a030130 n = a030130_list !! (n-1)
a030130_list = filter ((== 1) . a023416) [0..]
-- Reinhard Zumkeller, Mar 31 2015, Dec 07 2012
(PARI) print1("0, "); for(k=1, 2039, my(v=digits(k, 2)); if(vecsum(v)==#v-1, print1(k, ", "))) \\ Hugo Pfoertner, Feb 06 2020
(Magma) [0] cat [k:k in [0..2050]| Multiplicity(Intseq(k, 2), 0) eq 1]; // Marius A. Burtea, Feb 06 2020
CROSSREFS
KEYWORD
AUTHOR
Toby Donaldson (tjdonald(AT)uwaterloo.ca)
EXTENSIONS
More terms from Erich Friedman
Offset fixed by Reinhard Zumkeller, Aug 24 2009
STATUS
approved