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.
%I A030130 #39 Dec 19 2024 21:17:18 %S A030130 0,2,5,6,11,13,14,23,27,29,30,47,55,59,61,62,95,111,119,123,125,126, %T A030130 191,223,239,247,251,253,254,383,447,479,495,503,507,509,510,767,895, %U A030130 959,991,1007,1015,1019,1021,1022,1535,1791,1919,1983,2015,2031,2039 %N A030130 Binary expansion contains a single 0. %C A030130 From _Reinhard Zumkeller_, Aug 29 2009: (Start) %C A030130 A023416(a(n)) = 1; %C A030130 apart from the initial term the sequence can be seen as a triangle read by rows, see A164874; %C A030130 A055010 and A086224 are subsequences, see also A000918 and A036563. (End) %C A030130 Zero and numbers of form 2^m-2^k-1, 2 <= m, 0 <= k <= m-2. - _Zak Seidov_, Aug 06 2010 %H A030130 Reinhard Zumkeller, <a href="/A030130/b030130.txt">Table of n, a(n) for n = 1..1000</a> %F A030130 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) %F A030130 a(n+1) = A140977(a(n)) for any n > 1. - _Rémy Sigrist_, Feb 06 2020 %F A030130 Sum_{n>=2} 1/a(n) = A160502. - _Amiram Eldar_, Oct 06 2020 %F A030130 a(n) = (A190620(n-1)-1)/2. - _Chai Wah Wu_, Dec 19 2024 %e A030130 23 is OK because it is '10111' in base 2. %t A030130 Sort[Flatten[{{0}, Table[2^n - 2^m - 1, {n, 2, 50}, {m, 0, n - 2}]}]] (* _Zak Seidov_, Aug 06 2010 *) %t A030130 Select[Range[0,2100],DigitCount[#,2,0]==1&] (* _Harvey P. Dale_, Dec 19 2021 *) %o A030130 (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);} %o A030130 (Haskell) %o A030130 a030130 n = a030130_list !! (n-1) %o A030130 a030130_list = filter ((== 1) . a023416) [0..] %o A030130 -- _Reinhard Zumkeller_, Mar 31 2015, Dec 07 2012 %o A030130 (PARI) print1("0, ");for(k=1,2039,my(v=digits(k,2));if(vecsum(v)==#v-1,print1(k,", "))) \\ _Hugo Pfoertner_, Feb 06 2020 %o A030130 (Magma) [0] cat [k:k in [0..2050]| Multiplicity(Intseq(k,2),0) eq 1]; // _Marius A. Burtea_, Feb 06 2020 %o A030130 (Python) %o A030130 from math import isqrt, comb %o A030130 def A030130(n): return (1<<(a:=(isqrt(n-1<<3)+1>>1)+1))-(1<<comb(a,2)-n+1)-1 # _Chai Wah Wu_, Dec 19 2024 %Y A030130 Cf. A000918, A023416, A036563, A055010, A086224, A140977, A160502, A164874, A190620. %K A030130 nonn,base,easy,look %O A030130 1,2 %A A030130 Toby Donaldson (tjdonald(AT)uwaterloo.ca) %E A030130 More terms from _Erich Friedman_ %E A030130 Offset fixed by _Reinhard Zumkeller_, Aug 24 2009