%I #38 Oct 30 2024 13:30:20
%S 1,7,11,13,14,15,19,21,22,23,25,26,27,28,29,30,31,35,37,38,39,41,42,
%T 43,44,45,46,47,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,67,69,70,
%U 71,73,74,75,76,77,78,79,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,97
%N Numbers that are not the sum of two powers of 2.
%C 1 and integers with three or more 1-bits in their binary expansion. - _Vladimir Baltic_, Jul 23 2002
%C Appears to be the numbers k >1 for which there exist an x and y (x>y) such that x OR y = k, x+y != k, and x<k. - _Gary Detlefs_, Jun 02 2014
%H Reinhard Zumkeller, <a href="/A072823/b072823.txt">Table of n, a(n) for n = 1..10000</a>
%F A073267(a(n)) = 0. [_Reinhard Zumkeller_, Mar 07 2012]
%p f:= x -> convert(convert(x,base,2),`+`)>2:
%p {1} union select(f, {$2..1000}); # _Robert Israel_, Jun 08 2014
%t Join[{1}, Select[Range[100], DigitCount[#, 2, 1] >= 3&]] (* _Jean-François Alcover_, Mar 08 2019 *)
%o (Haskell)
%o a072823 n = a072823_list !! (n-1)
%o a072823_list = tail $ elemIndices 0 a073267_list
%o -- _Reinhard Zumkeller_, Mar 07 2012
%o (Python)
%o from math import comb
%o from itertools import count, islice
%o def A072823(n):
%o def f(x):
%o s = bin(x)[2:]
%o c = n-1+(l:=len(s))+comb(l-1,2)
%o try:
%o c += l-1-s[1:].index('1')
%o except:
%o pass
%o return c
%o m, k = n-1, f(n-1)
%o while m != k: m, k = k, f(k)
%o return m
%o def A072823_gen(): # generator of terms
%o return filter(lambda n:n==1 or n.bit_count()>2,count(1))
%o A072823_list = list(islice(A072823_gen(),50)) # _Chai Wah Wu_, Oct 30 2024
%Y Cf. A000079, A048645, A073267.
%K nonn
%O 1,2
%A _Jeremy Gardiner_, Jul 21 2002