A072823 Numbers that are not the sum of two powers of 2.
1, 7, 11, 13, 14, 15, 19, 21, 22, 23, 25, 26, 27, 28, 29, 30, 31, 35, 37, 38, 39, 41, 42, 43, 44, 45, 46, 47, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 67, 69, 70, 71, 73, 74, 75, 76, 77, 78, 79, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 97
Offset: 1
Keywords
Links
- Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
Programs
-
Haskell
a072823 n = a072823_list !! (n-1) a072823_list = tail $ elemIndices 0 a073267_list -- Reinhard Zumkeller, Mar 07 2012
-
Maple
f:= x -> convert(convert(x,base,2),`+`)>2: {1} union select(f, {$2..1000}); # Robert Israel, Jun 08 2014
-
Mathematica
Join[{1}, Select[Range[100], DigitCount[#, 2, 1] >= 3&]] (* Jean-François Alcover, Mar 08 2019 *)
-
Python
from math import comb from itertools import count, islice def A072823(n): def f(x): s = bin(x)[2:] c = n-1+(l:=len(s))+comb(l-1,2) try: c += l-1-s[1:].index('1') except: pass return c m, k = n-1, f(n-1) while m != k: m, k = k, f(k) return m def A072823_gen(): # generator of terms return filter(lambda n:n==1 or n.bit_count()>2,count(1)) A072823_list = list(islice(A072823_gen(),50)) # Chai Wah Wu, Oct 30 2024
Formula
A073267(a(n)) = 0. [Reinhard Zumkeller, Mar 07 2012]
Comments