

A048645


Integers with one or two 1bits in their binary expansion.


30



1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 16, 17, 18, 20, 24, 32, 33, 34, 36, 40, 48, 64, 65, 66, 68, 72, 80, 96, 128, 129, 130, 132, 136, 144, 160, 192, 256, 257, 258, 260, 264, 272, 288, 320, 384, 512, 513, 514, 516, 520, 528, 544, 576, 640, 768, 1024, 1025, 1026, 1028, 1032
(list;
table;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

1,2


COMMENTS

Apart from initial 1, sums of two not necessarily distinct powers of 2.
4 does not divide C(2s1,s) (= A001700[ s ]) if and only if s=a(n).
Possible number of sides of a regular polygon such that there exists a triangulation where each triangle is isosceles.  Senpeng Eu, May 07 2008
For n > 1, 1 < k <= n: T(n,1) = A173786(n2,n2) and T(n,k) = A173786(n1,k2).  Reinhard Zumkeller, Feb 28 2010
Also numbers n such that n!/2^(n2) is an integer.  Michel Lagneau, Mar 28 2011
It appears these are also the indices of the terms that are shared by the cellular automata of A147562, A162795, A169707.  Omar E. Pol, Feb 21 2015
Numbers with binary weight 1 or 2.  Omar E. Pol, Feb 22 2015


LINKS

Reinhard Zumkeller, Rows n = 1..100 of triangle, flattened
USA Mathematical Olympiad, Problem 4, 2008.
Eric Weisstein's World of Mathematics, Automatic Set
Eric Weisstein's World of Mathematics, Binomial Coefficient
Index entries for sequences related to cellular automata


FORMULA

a(0) = 1, a(n) = (2^(trinv(n1)1) + 2^((n1)((trinv(n1)*(trinv(n1)1))/2))), i.e., 2^A003056(n) + 2^A002262(n1) (the latter sequence contains the definition of trinv).
Let Theta = Sum_{k >= 0} x^(2^k). Then Sum_{n>=1} x^a(n) = (Theta^2 + Theta + x)/2.  N. J. A. Sloane, Jun 23 2009
It appears that A147562(a(n)) = A162795(a(n)) = A169707(a(n)).  Omar E. Pol, Feb 19 2015


EXAMPLE

From Omar E. Pol, Feb 18 2015: (Start)
Also, written as a triangle T(j,k), k >= 1, in which row lengths are the terms of A028310:
1;
2;
3, 4;
5, 6, 8;
9, 10, 12, 16;
17, 18, 20, 24, 32;
33, 34, 36, 40, 48, 64;
65, 66, 68, 72, 80, 96, 128;
...
It appears that column 1 is A094373.
It appears that the right border gives A000079.
It appears that the first differences in every row that contains at least two terms give the first h1 powers of 2, where h is the length of the row.
(End)


MAPLE

lincom:=proc(a, b, n) local i, j, s, m; s:={}; for i from 0 to n do for j from 0 to n do m:=a^i+b^j; if m<=n then s:={op(s), m} fi od; od; lprint(sort([op(s)])); end: lincom(2, 2, 1000); # Zerinvary Lajos, Feb 24 2007


MATHEMATICA

Select[Range[2000], 1 <= DigitCount[#, 2, 1] <= 2&] (* JeanFrançois Alcover, Mar 06 2016 *)


PROG

(Haskell)
import Data.List (insert)
a048645 n k = a048645_tabl !! (n1) !! (k1)
a048645_row n = a048645_tabl !! (n1)
a048645_tabl = iterate (\xs > insert (2 * head xs + 1) $ map ((* 2)) xs) [1]
a048645_list = concat a048645_tabl
 Reinhard Zumkeller, Dec 19 2012
(PARI) isok(n) = my(hw = hammingweight(n)); (hw == 1)  (hw == 2); \\ Michel Marcus, Mar 06 2016
(PARI) a(n) = if(n <= 2, return(n), n=2); my(c = (sqrtint(8*n + 1)  1) \ 2); 1 << c + 1 << (n  binomial(c + 1, 2)) \\ David A. Corneth, Jan 02 2019
(PARI) nxt(n) = msb = 1 << logint(n, 2); if(n == msb, n + 1, t = n  msb; n + t) \\ David A. Corneth, Jan 02 2019


CROSSREFS

Cf. A018900, A048623, A046097, A169707, A147562, A162795, A003056, A002262, A094373, A028310.
Sequence in context: A018412 A061945 A029509 * A173786 A093863 A091902
Adjacent sequences: A048642 A048643 A048644 * A048646 A048647 A048648


KEYWORD

easy,nonn,base,tabl


AUTHOR

Antti Karttunen, Jul 14 1999


STATUS

approved



