A162363 Binary Keith numbers, excluding positive powers of 2.
1, 3, 143, 285, 569, 683, 1138, 1366, 2276, 154203, 308405, 616810, 678491, 1356981, 1480343, 2713962, 2960686, 2212558911, 4425117821, 8850235641, 17700471281
Offset: 1
Examples
In binary, 143 = (1,0,0,0,1,1,1,1). Subsequent terms are 5,9,18,36,72,143.
Programs
-
Maple
isA162363 := proc(n) local L,t,a ; if numtheory[factorset](n) = {2} then return false; end if; L := ListTools[Reverse](convert(n,base,2)) ; t := nops(L) ; while true do a := add(op(-i,L),i=1..t) ; L := [op(L),a] ; if a > n then return false; elif a = n then return true; end if; end do: end proc: for n from 1 do if isA162363(n) then printf("%d,\n",n); end if; end do: # R. J. Mathar, Jan 12 2016
-
Mathematica
IsKeith2[n_Integer] := Module[{b,s}, b=IntegerDigits[n,2]; s=Total[b]; If[s<=1, n==1, k=1; While[s=2*s-b[[k]]; s
Extensions
Corrected name T. D. Noe, Jul 11 2009
Typo in binary for 2212558911 corrected by Jaroslav Krizek, Dec 09 2015
Comments