A007088
The binary numbers (or binary words, or binary vectors, or binary expansion of n): numbers written in base 2.
Original entry on oeis.org
0, 1, 10, 11, 100, 101, 110, 111, 1000, 1001, 1010, 1011, 1100, 1101, 1110, 1111, 10000, 10001, 10010, 10011, 10100, 10101, 10110, 10111, 11000, 11001, 11010, 11011, 11100, 11101, 11110, 11111, 100000, 100001, 100010, 100011, 100100, 100101, 100110, 100111
Offset: 0
a(6)=110 because (1/2)*((1-(-1)^6)*10^0 + (1-(-1)^3)*10^1 + (1-(-1)^1)*10^2) = 10 + 100.
G.f. = x + 10*x^2 + 11*x^3 + 100*x^4 + 101*x^5 + 110*x^6 + 111*x^7 + 1000*x^8 + ...
.
000 The numbers < 2^n can be regarded as vectors with
001 a fixed length n if padded with zeros on the left
010 side. This represents the n-fold Cartesian product
011 over the set {0, 1}. In the example on the left,
100 n = 3. (See also the second Python program.)
101 Binary vectors in this format can also be seen as a
110 representation of the subsets of a set with n elements.
111 - _Peter Luschny_, Jan 22 2024
- John H. Conway and Richard K. Guy, The Book of Numbers, New York: Springer-Verlag, 1996. See p. 21.
- Jan Gullberg, Mathematics from the Birth of Numbers, W. W. Norton & Co., NY & London, 1997, §2.8 Binary, Octal, Hexadecimal, p. 64.
- Manfred R. Schroeder, "Fractals, Chaos, Power Laws", W. H. Freeman, 1991, p. 383.
- N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
- N. J. A. Sloane, Table of n, a(n) for n = 0..32768 (first 8192 terms from Franklin T. Adams-Watters)
- Heinz Gumin, Herrn von Leibniz' Rechnung mit Null und Eins, Siemens AG, 3. Auflage 1979 -- contains facsimiles of Leibniz's papers from 1679 and 1703.
- Hsien-Kuei Hwang, Svante Janson, and Tsung-Hsi Tsai, Identities and periodic oscillations of divide-and-conquer recurrences splitting at half, arXiv:2210.10968 [cs.DS], 2022, p. 45.
- G. W. Leibniz, Explication de l'arithmétique binaire, qui se sert des seuls caractères 0 & 1; avec des remarques sur son utilité, et sur ce qu'elle donne le sens des anciennes figures chinoises de Fohy, Mémoires de l'Académie Royale des Sciences, 1703, pp. 85-89; reprinted in Gumin (1979).
- N. J. A. Sloane, Table of a(n) for n = 0..1048576 (A large file).
- Robert G. Wilson v, Letter to N. J. A. Sloane, Sep. 1992.
- Index entries for sequences related to Most Wanted Primes video.
- Index entries for 10-automatic sequences.
- Index entries for sequences related to binary expansion of n.
Cf.
A028897 (convert binary to decimal).
Cf.
A000042,
A007089-
A007095,
A000695,
A005836,
A033042-
A033052,
A159918,
A004290,
A169965,
A169966,
A169967,
A169964,
A204093,
A204094,
A204095,
A097256,
A257773,
A257770.
-
a007088 0 = 0
a007088 n = 10 * a007088 n' + m where (n',m) = divMod n 2
-- Reinhard Zumkeller, Jan 10 2012
-
A007088 := n-> convert(n, binary): seq(A007088(n), n=0..50); # R. J. Mathar, Aug 11 2009
-
Table[ FromDigits[ IntegerDigits[n, 2]], {n, 0, 39}]
Table[Sum[ (Floor[( Mod[f/2 ^n, 2])])*(10^n) , {n, 0, Floor[Log[2, f]]}], {f, 1, 100}] (* José de Jesús Camacho Medina, Jul 24 2014 *)
FromDigits/@Tuples[{1,0},6]//Sort (* Harvey P. Dale, Aug 10 2017 *)
-
{a(n) = subst( Pol( binary(n)), x, 10)}; /* Michael Somos, Jun 07 2002 */
-
{a(n) = if( n<=0, 0, n%2 + 10*a(n\2))}; /* Michael Somos, Jun 07 2002 */
-
a(n)=fromdigits(binary(n),10) \\ Charles R Greathouse IV, Apr 08 2015
-
def a(n): return int(bin(n)[2:])
print([a(n) for n in range(40)]) # Michael S. Branicky, Jan 10 2021
-
from itertools import product
n = 4
for p in product([0, 1], repeat=n): print(''.join(str(x) for x in p))
# Peter Luschny, Jan 22 2024
A000695
Moser-de Bruijn sequence: sums of distinct powers of 4.
Original entry on oeis.org
0, 1, 4, 5, 16, 17, 20, 21, 64, 65, 68, 69, 80, 81, 84, 85, 256, 257, 260, 261, 272, 273, 276, 277, 320, 321, 324, 325, 336, 337, 340, 341, 1024, 1025, 1028, 1029, 1040, 1041, 1044, 1045, 1088, 1089, 1092, 1093, 1104, 1105, 1108, 1109, 1280, 1281, 1284, 1285
Offset: 0
G.f.: x + 4*x^2 + 5*x^3 + 16*x^4 + 17*x^5 + 20*x^6 + 21*x^7 + 64*x^8 + ...
If n=27, then b_0=1, b_1=1, b_2=0, b_3=1, b_4=1. Therefore a(27) = 4^4 + 4^3 + 4 + 1 = 325; k = b_0 + b_2*2 + b_4*2^2 = 5, l = b_1 + b_3*2 = 3, such that a(5)=17, a(3)=5 and 27 = 17 + 2*5. - _Vladimir Shevelev_, Nov 10 2008
- N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
- N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
- T. D. Noe, Table of n, a(n) for n = 0..1023
- Jean-Paul Allouche and Jeffrey Shallit, The ring of k-regular sequences, Theoretical Computer Sci., Vol. 98 (1992), pp. 163-197.
- Jean-Paul Allouche and Jeffrey Shallit, The ring of k-regular sequences, Theoretical Computer Sci., Vol. 98 (1992), pp. 163-197.
- David Applegate, Marc LeBrun and N. J. A. Sloane, Carryless Arithmetic (I): The Mod 10 Version.
- David Applegate, Omar E. Pol and N. J. A. Sloane, The Toothpick Sequence and Other Sequences from Cellular Automata, Congressus Numerantium, Vol. 206 (2010), pp. 157-191. [There is a typo in Theorem 6: (13) should read u(n) = 4.3^(wt(n-1)-1) for n >= 2.]
- David Applegate, Marc LeBrun and N. J. A. Sloane, Dismal Arithmetic, J. Int. Seq., Vol. 14 (2011), Article 11.9.8.
- Joerg Arndt, Matters Computational (The Fxtbook), pp. 59-60, pp. 750-751.
- Robert Baillie and Thomas Schmelzer, Summing Kempner's Curious (Slowly-Convergent) Series, Mathematica Notebook kempnerSums.nb, Wolfram Library Archive, 2008.
- N. G. de Bruijn, Some direct decompositions of the set of integers, Math. Comp., Vol. 18, No. 88 (1964), pp. 537-546.
- Karl Dilcher and Larry Ericksen, Hyperbinary expansions and Stern polynomials, Elec. J. Combin, Vol. 22, No. 2 (2015), #P2.24.
- Roger B. Eggleton, Maximal Midpoint-Free Subsets of Integers, International Journal of Combinatorics Volume 2015, Article ID 216475, 14 pages.
- S. J. Eigen, Y. Ito, and V. S. Prasad, Universally bad integers and the 2-adics, J. Number Theory, Vol. 107, No. 2 (2004), pp. 322-334.
- Hsien-Kuei Hwang, Svante Janson, and Tsung-Hsi Tsai, Identities and periodic oscillations of divide-and-conquer recurrences splitting at half, arXiv:2210.10968 [cs.DS], 2022, p. 44.
- Bin Lan and James A. Sellers, Properties of a Restricted Binary Partition Function a la Andrews and Lewis, Electronic Journal of Combinatorial Number Theory, Volume 15 #A23.
- Lukasz Merta, Composition inverses of the variations of the Baum-Sweet sequence, arXiv:1803.00292 [math.NT], 2018. See m(n) p. 11.
- Leo Moser, An application of generating series, Math. Mag., Vol. 35, No. 1 (1962), pp. 37-38.
- Leo Moser, An application of generating series, Math. Mag., Vol. 35, No. 1 (1962), pp. 37-38. [Annotated scanned copy]
- John Tyler Rascoe, Illustration of terms.
- Vladimir Shevelev, Two analogs of Thue-Morse sequence, arXiv:1603.04434 [math.NT], 2016-2017.
- N. J. A. Sloane, Catalog of Toothpick and Cellular Automata Sequences in the OEIS
- Ralf Stephan, Some divide-and-conquer sequences with (relatively) simple ordinary generating functions, 2004.
- Ralf Stephan, Table of generating functions.
- Ralf Stephan, Divide-and-conquer generating functions. I. Elementary sequences, arXiv:math/0307027 [math.CO], 2003.
- Stephen Nicholas Swatman, Ana-Lucia Varbanescu, Andy D. Pimentel, Andreas Salzburger, and Attila Krasznahorkay, Finding Morton-Like Layouts for Multi-Dimensional Arrays Using Evolutionary Algorithms, arXiv:2309.07002 [cs.NE], 2023.
- Eric Weisstein's World of Mathematics, Moser-de Bruijn Sequence.
- Eric Weisstein's World of Mathematics, Negabinary.
- Wikipedia, Morton code. (also known as Z-order curve. Cf. Marc LeBrun's comments about binary interleaving.)
- Index entries for 2-automatic sequences.
For generating functions Product_{k>=0} (1 + a*x^(b^k)) for the following values of (a,b) see: (1,2)
A000012 and
A000027, (1,3)
A039966 and
A005836, (1,4)
A151666 and
A000695, (1,5)
A151667 and
A033042, (2,2)
A001316, (2,3)
A151668, (2,4)
A151669, (2,5)
A151670, (3,2)
A048883, (3,3)
A117940, (3,4)
A151665, (3,5)
A151671, (4,2)
A102376, (4,3)
A151672, (4,4)
A151673, (4,5)
A151674.
Cf.
A000225,
A000302,
A001511,
A007583,
A059884,
A059901,
A059904,
A059905,
A059906,
A007088,
A033042-
A033052,
A126684,
A145812.
-
uint32_t a_next(uint32_t a_n) { return (a_n + 0xaaaaaaab) & 0x55555555; } /* Falk Hüffner, Jan 24 2022 */
-
a000695 n = if n == 0 then 0 else 4 * a000695 n' + b
where (n',b) = divMod n 2
-- Reinhard Zumkeller, Feb 21 2014, Dec 03 2011
-
function a(n)
m, r, b = n, 0, 1
while m > 0
m, q = divrem(m, 2)
r += b * q
b *= 4
end
r end; [a(n) for n in 0:51] |> println # Peter Luschny, Jan 03 2021
-
m:=60; R:=PowerSeriesRing(Integers(), m); [0] cat Coefficients(R!( (&+[4^k*x^(2^k)/(1+x^(2^k)): k in [0..20]])/(1-x) )); // G. C. Greubel, Dec 06 2018
-
a:= proc(n) local m, r, b; m, r, b:= n, 0, 1;
while m>0 do r:= r+b*irem(m, 2, 'm'); b:= b*4 od; r
end:
seq(a(n), n=0..100); # Alois P. Heinz, Mar 16 2013
-
Table[FromDigits[Riffle[IntegerDigits[n, 2], 0], 2], {n, 0, 51}] (* Jacob A. Siehler, Jun 30 2010 *)
Table[FromDigits[IntegerDigits[n, 2], 4], {n, 0, 51}] (* IWABUCHI Yu(u)ki, Apr 06 2013 *)
Union@ Flatten@ NestList[ Join[ 4#, 4# + 1] &, {0}, 6] (* Robert G. Wilson v, Aug 30 2014 *)
Select[ Range[0, 1320], Total@ IntegerDigits[#, 2] == Total@ IntegerDigits[#, 4] &] (* Robert G. Wilson v, Oct 24 2014 *)
Union[FromDigits[#,4]&/@Flatten[Table[Tuples[{0,1},n],{n,6}],1]] (* Harvey P. Dale, Oct 03 2015 *)
a[ n_] := Which[n < 1, 0, EvenQ[n], a[n/2] 4, True, a[n - 1] + 1]; (* Michael Somos, Nov 30 2016 *)
-
a(n)=n=binary(n);sum(i=1,#n,n[i]*4^(#n-i)) \\ Charles R Greathouse IV, Mar 04 2013
-
{a(n) = if( n<1, 0, n%2, a(n-1) + 1, a(n/2) * 4)}; /* Michael Somos, Nov 30 2016 */
-
A000695(n)=fromdigits(binary(n),4) \\ M. F. Hasler, Oct 16 2018
-
def a(n):
n = bin(n)[2:]
x = len(n)
return sum(int(n[i]) * 4**(x - 1 - i) for i in range(x))
[a(n) for n in range(101)] # Indranil Ghosh, Jun 25 2017
-
def a():
x = 0
while True:
yield x
y = ~(x << 1)
x = (x - y) & y # Falk Hüffner, Dec 21 2021
-
from itertools import count, islice
def A000695_gen(): # generator of terms
yield (a:=0)
for n in count(1):
yield (a := a+((1<<((~n & n-1).bit_length()<<1)+1)+1)//3)
A000695_list = list(islice(A000695_gen(),30)) # Chai Wah Wu, Feb 22 2023
-
def A000695(n): return int(bin(n)[2:],4) # Chai Wah Wu, Aug 21 2023
-
s=(sum(4^k*x^(2^k)/(1+x^(2^k)) for k in range(10))/(1-x)).series(x, 60); s.coefficients(x, sparse=False) # G. C. Greubel, Dec 06 2018
A005836
Numbers whose base-3 representation contains no 2.
Original entry on oeis.org
0, 1, 3, 4, 9, 10, 12, 13, 27, 28, 30, 31, 36, 37, 39, 40, 81, 82, 84, 85, 90, 91, 93, 94, 108, 109, 111, 112, 117, 118, 120, 121, 243, 244, 246, 247, 252, 253, 255, 256, 270, 271, 273, 274, 279, 280, 282, 283, 324, 325, 327, 328, 333, 334, 336, 337, 351, 352
Offset: 1
12 is a term because 12 = 110_3.
This sequence regarded as a triangle with rows of lengths 1, 1, 2, 4, 8, 16, ...:
0
1
3, 4
9, 10, 12, 13
27, 28, 30, 31, 36, 37, 39, 40
81, 82, 84, 85, 90, 91, 93, 94, 108, 109, 111, 112, 117, 118, 120, 121
... - _Philippe Deléham_, Jun 06 2015
- Richard K. Guy, Unsolved Problems in Number Theory, 3rd Edition, Springer, 2004, Section E10, pp. 317-323.
- N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
- David W. Wilson, Table of n, a(n) for n = 1..10000 (first 1024 terms from T. D. Noe)
- J.-P. Allouche, G.-N. Han, and Jeffrey Shallit, On some conjectures of P. Barry, arXiv:2006.08909 [math.NT], 2020.
- J.-P. Allouche and Jeffrey Shallit, The ring of k-regular sequences, Theoretical Computer Sci., 98 (1992), 163-197.
- J.-P. Allouche and Jeffrey Shallit, The ring of k-regular sequences, Theoretical Computer Sci., 98 (1992), 163-197.
- J.-P. Allouche, Jeffrey Shallit and G. Skordev, Self-generating sets, integers with missing blocks and substitutions, Discrete Math. 292 (2005) 1-15.
- David Applegate, Omar E. Pol and N. J. A. Sloane, The Toothpick Sequence and Other Sequences from Cellular Automata, Congressus Numerantium, Vol. 206 (2010), 157-191. [There is a typo in Theorem 6: (13) should read u(n) = 4.3^(wt(n-1)-1) for n >= 2.]
- Megumi Asada, Bruce Fang, Eva Fourakis, Sarah Manski, Nathan McNew, Steven J. Miller, Gwyneth Moreland, Ajmain Yamin, and Sindy Xin Zhang, Avoiding 3-Term Geometric Progressions in Hurwitz Quaternions, Williams College (2023).
- Robert Baillie and Thomas Schmelzer, Summing Kempner's Curious (Slowly-Convergent) Series, Mathematica Notebook kempnerSums.nb, Wolfram Library Archive, 2008.
- Noam Benson-Tilsen, Samuel Brock, Brandon Faunce, Monish Kumar, Noah Dokko Stein, and Joshua Zelinsky, Total Difference Labeling of Regular Infinite Graphs, arXiv:2107.11706 [math.CO], 2021.
- Raghavendra Bhat, Cristian Cobeli, and Alexandru Zaharescu, Filtered rays over iterated absolute differences on layers of integers, arXiv:2309.03922 [math.NT], 2023. See page 16.
- Matvey Borodin, Hannah Han, Kaylee Ji, Tanya Khovanova, Alexander Peng, David Sun, Isabel Tu, Jason Yang, William Yang, Kevin Zhang, and Kevin Zhao, Variants of Base 3 over 2, arXiv:1901.09818 [math.NT], 2019.
- Ben Chen, Richard Chen, Joshua Guo, Tanya Khovanova, Shane Lee, Neil Malur, Nastia Polina, Poonam Sahoo, Anuj Sakarda, Nathan Sheffield, and Armaan Tipirneni, On Base 3/2 and its Sequences, arXiv:1808.04304 [math.NT], 2018.
- Karl Dilcher and Larry Ericksen, Hyperbinary expansions and Stern polynomials, Elec. J. Combin, Vol. 22 (2015), Article P2.24.
- P. Erdős, V. Lev, G. Rauzy, C. Sandor, and A. Sarkozy, Greedy algorithm, arithmetic progressions, subset sums and divisibility, Discrete Math., Vol. 200, No. 1-3 (1999), pp. 119-135 (see Table 1). alternate link.
- Joseph L. Gerver and L. Thomas Ramsey, Sets of integers with no long arithmetic progressions generated by the greedy algorithm, Math. Comp., Vol. 33, No. 148 (1979), pp. 1353-1359.
- Hsien-Kuei Hwang, Svante Janson, and Tsung-Hsi Tsai, Identities and periodic oscillations of divide-and-conquer recurrences splitting at half, arXiv:2210.10968 [cs.DS], 2022, p. 45.
- Ryota Inagaki, Tanya Khovanova, and Austin Luo, Permutation-based Strategies for Labeled Chip-Firing on k-ary Trees, arXiv:2503.09577 [math.CO], 2025. See p. 18.
- Kathrin Kostorz, Robert W. Hölzel and Katharina Krischer, Distributed coupling complexity in a weakly coupled oscillatory network with associative properties, New J. Phys., Vol. 15 (2013), #083010; doi:10.1088/1367-2630/15/8/083010.
- Clark Kimberling, Affinely recursive sets and orderings of languages, Discrete Math., Vol. 274, Vol. 1-3 (2004), pp. 147-160.
- John W. Layman, Some Properties of a Certain Nonaveraging Sequence, J. Integer Sequences, Vol. 2 (1999), Article 99.1.3.
- Manfred Madritsch and Stephan Wagner, A central limit theorem for integer partitions, Monatsh. Math., Vol. 161, No. 1 (2010), pp. 85-114.
- Richard A. Moy and David Rolnick, Novel structures in Stanley sequences, Discrete Math., Vol. 339, No. 2 (2016), pp. 689-698; arXiv preprint, arXiv:1502.06013 [math.CO], 2015.
- A. M. Odlyzko and R. P. Stanley, Some curious sequences constructed with the greedy algorithm, 1978, remark 1 (PDF, PS, TeX).
- Paul Pollack, Analytic and Combinatorial Number Theory Course Notes, p. 228. [?Broken link]
- Paul Pollack, Analytic and Combinatorial Number Theory Course Notes, p. 228.
- David Rolnick and Praveen S. Venkataramana, On the growth of Stanley sequences, Discrete Math., Vol. 338, No. 11 (2015), pp. 1928-1937, see p. 1930; arXiv preprint, arXiv:1408.4710 [math.CO], 2014.
- N. J. A. Sloane, Catalog of Toothpick and Cellular Automata Sequences in the OEIS.
- Ralf Stephan, Divide-and-conquer generating functions. I. Elementary sequences, arXiv:math/0307027 [math.CO], 2003.
- Ralf Stephan, Some divide-and-conquer sequences with (relatively) simple ordinary generating functions, 2004.
- Ralf Stephan, Table of generating functions.
- Zoran Sunic, Tree morphisms, transducers and integer sequences, arXiv:math/0612080 [math.CO], 2006.
- B. Vasic, K. Pedagani and M. Ivkovic, High-rate girth-eight low-density parity-check codes on rectangular integer lattices, IEEE Transactions on Communications, Vol. 52, Issue 8 (2004), pp. 1248-1252.
- Eric Weisstein's World of Mathematics, Central Binomial Coefficient.
- Index entries for 3-automatic sequences.
Cf.
A039966 (characteristic function).
Cf.
A002426,
A004793,
A005823,
A007088,
A007089,
A032924,
A033042-
A033052,
A054591,
A055246,
A062548,
A065361,
A074940,
A081601,
A081603,
A081611,
A083096,
A089118,
A121153,
A170943,
A185256.
For generating functions Product_{k>=0} (1+a*x^(b^k)) for the following values of (a,b) see: (1,2)
A000012 and
A000027, (1,3)
A039966 and
A005836, (1,4)
A151666 and
A000695, (1,5)
A151667 and
A033042, (2,2)
A001316, (2,3)
A151668, (2,4)
A151669, (2,5)
A151670, (3,2)
A048883, (3,3)
A117940, (3,4)
A151665, (3,5)
A151671, (4,2)
A102376, (4,3)
A151672, (4,4)
A151673, (4,5)
A151674.
Summary of increasing sequences avoiding arithmetic progressions of specified lengths (the second of each pair is obtained by adding 1 to the first):
-
a005836 n = a005836_list !! (n-1)
a005836_list = filter ((== 1) . a039966) [0..]
-- Reinhard Zumkeller, Jun 09 2012, Sep 29 2011
-
function a(n)
m, r, b = n, 0, 1
while m > 0
m, q = divrem(m, 2)
r += b * q
b *= 3
end
r end; [a(n) for n in 0:57] |> println # Peter Luschny, Jan 03 2021
-
t := (j, n) -> add(binomial(n,k)^j, k=0..n):
for i from 1 to 400 do
if(t(4,i) mod 3 <>0) then print(i) fi
od; # Gary Detlefs, Nov 28 2011
# alternative Maple program:
a:= proc(n) option remember: local k, m:
if n=1 then 0 elif n=2 then 1 elif n>2 then k:=floor(log[2](n-1)): m:=n-2^k: procname(m)+3^k: fi: end proc:
seq(a(n), n=1.. 20); # Paul Weisenhorn, Mar 22 2020
# third Maple program:
a:= n-> `if`(n=1, 0, irem(n-1, 2, 'q')+3*a(q+1)):
seq(a(n), n=1..100); # Alois P. Heinz, Jan 26 2022
-
Table[FromDigits[IntegerDigits[k, 2], 3], {k, 60}]
Select[Range[0, 400], DigitCount[#, 3, 2] == 0 &] (* Harvey P. Dale, Jan 04 2012 *)
Join[{0}, Accumulate[Table[(3^IntegerExponent[n, 2] + 1)/2, {n, 57}]]] (* IWABUCHI Yu(u)ki, Aug 01 2012 *)
FromDigits[#,3]&/@Tuples[{0,1},7] (* Harvey P. Dale, May 10 2019 *)
-
A=vector(100);for(n=2,#A,A[n]=if(n%2,3*A[n\2+1],A[n-1]+1));A \\ Charles R Greathouse IV, Jul 24 2012
-
is(n)=while(n,if(n%3>1,return(0));n\=3);1 \\ Charles R Greathouse IV, Mar 07 2013
-
a(n) = fromdigits(binary(n-1),3); \\ Gheorghe Coserea, Jun 15 2018
-
def A005836(n):
return int(format(n-1,'b'),3) # Chai Wah Wu, Jan 04 2015
Edited by the Associate Editors of the OEIS, Apr 07 2009
A033042
Sums of distinct powers of 5.
Original entry on oeis.org
0, 1, 5, 6, 25, 26, 30, 31, 125, 126, 130, 131, 150, 151, 155, 156, 625, 626, 630, 631, 650, 651, 655, 656, 750, 751, 755, 756, 775, 776, 780, 781, 3125, 3126, 3130, 3131, 3150, 3151, 3155, 3156, 3250, 3251, 3255, 3256, 3275, 3276, 3280, 3281, 3750, 3751
Offset: 0
- T. D. Noe, Table of n, a(n) for n = 0..1023
- David Applegate, Omar E. Pol and N. J. A. Sloane, The Toothpick Sequence and Other Sequences from Cellular Automata, Congressus Numerantium, Vol. 206 (2010), 157-191. [There is a typo in Theorem 6: (13) should read u(n) = 4.3^(wt(n-1)-1) for n >= 2.]
- K. Dilcher and L. Ericksen, Hyperbinary expansions and Stern polynomials, Elec. J. Combin, 22, 2015, #P2.24.
- Hsien-Kuei Hwang, Svante Janson, and Tsung-Hsi Tsai, Identities and periodic oscillations of divide-and-conquer recurrences splitting at half, arXiv:2210.10968 [cs.DS], 2022, p. 45.
- N. J. A. Sloane, Catalog of Toothpick and Cellular Automata Sequences in the OEIS
For generating functions Product_{k>=0} (1 + a*x^(b^k)) for the following values of (a,b) see: (1,2)
A000012 and
A000027, (1,3)
A039966 and
A005836, (1,4)
A151666 and
A000695, (1,5)
A151667 and
A033042, (2,2)
A001316, (2,3)
A151668, (2,4)
A151669, (2,5)
A151670, (3,2)
A048883, (3,3)
A117940, (3,4)
A151665, (3,5)
A151671, (4,2)
A102376, (4,3)
A151672, (4,4)
A151673, (4,5)
A151674.
-
function a(n)
m, r, b = n, 0, 1
while m > 0
m, q = divrem(m, 2)
r += b * q
b *= 5
end
r end; [a(n) for n in 0:49] |> println # Peter Luschny, Jan 03 2021
-
a:= proc(n) local m, r, b; m, r, b:= n, 0, 1;
while m>0 do r:= r+b*irem(m, 2, 'm'); b:= b*5 od; r
end:
seq(a(n), n=0..100); # Alois P. Heinz, Mar 16 2013
-
t = Table[FromDigits[RealDigits[n, 2], 5], {n, 1, 100}]
(* Clark Kimberling, Aug 02 2012 *)
FromDigits[#,5]&/@Tuples[{0,1},7] (* Harvey P. Dale, May 22 2018 *)
-
a(n) = subst(Pol(binary(n)), 'x, 5);
vector(50, i, a(i-1)) \\ Gheorghe Coserea, Sep 15 2015
-
a(n)=fromdigits(binary(n),5) \\ Charles R Greathouse IV, Jan 11 2017
-
def A033042(n): return int(bin(n)[2:],5) # Chai Wah Wu, Oct 30 2024
A104257
Square array T(a,n) read by antidiagonals: replace 2^i with a^i in binary representation of n, where a,n >= 2.
Original entry on oeis.org
2, 3, 3, 4, 4, 4, 5, 5, 9, 5, 6, 6, 16, 10, 6, 7, 7, 25, 17, 12, 7, 8, 8, 36, 26, 20, 13, 8, 9, 9, 49, 37, 30, 21, 27, 9, 10, 10, 64, 50, 42, 31, 64, 28, 10, 11, 11, 81, 65, 56, 43, 125, 65, 30, 11, 12, 12, 100, 82, 72, 57, 216, 126, 68, 31, 12, 13, 13, 121, 101, 90, 73, 343
Offset: 2
Array begins:
2, 3, 4, 5, 6, 7, 8, 9, ...
3, 4, 9, 10, 12, 13, 27, 28, ...
4, 5, 16, 17, 20, 21, 64, 65, ...
5, 6, 25, 26, 30, 31, 125, 126, ...
6, 7, 36, 37, 42, 43, 216, 217, ...
7, 8, 49, 50, 56, 57, 343, 344, ...
8, 9, 64, 65, 72, 73, 512, 513, ...
9, 10, 81, 82, 90, 91, 729, 730, ...
...
Rows include (essentially)
A005836,
A000695,
A033042,
A033043,
A033044,
A033045,
A033046,
A033047,
A033048,
A033049,
A033050,
A033051,
A033052.
-
T[, 0] = 0; T[2, n] := n; T[a_, 2] := a;
T[a_, n_] := T[a, n] = If[EvenQ[n], a T[a, n/2], a T[a, (n-1)/2]+1];
Table[T[a-n+2, n], {a, 2, 13}, {n, 2, a}] // Flatten (* Jean-François Alcover, Feb 09 2021 *)
-
T(a, n) = fromdigits(binary(n), a); \\ Michel Marcus, Aug 19 2022
-
def T(a, n): return n if n < 2 else (max(a, n) if min(a, n) == 2 else a*T(a, n//2) + n%2)
print([T(a-n+2, n) for a in range(2, 14) for n in range(2, a+1)]) # Michael S. Branicky, Aug 02 2022
A097262
Numbers whose set of base 16 digits is {0,F}, where F base 16 = 15 base 10.
Original entry on oeis.org
0, 15, 240, 255, 3840, 3855, 4080, 4095, 61440, 61455, 61680, 61695, 65280, 65295, 65520, 65535, 983040, 983055, 983280, 983295, 986880, 986895, 987120, 987135, 1044480, 1044495, 1044720, 1044735, 1048320, 1048335, 1048560, 1048575
Offset: 0
-
[n: n in [0..1110000] | Set(IntegerToSequence(n, 16)) subset {0, 15}]; // Vincenzo Librandi, Jun 05 2012
-
f[n_] := FromDigits[ IntegerDigits[n, 2] /. {1 -> 15}, 16]; Array[f, 32, 0] (* or *)
FromDigits[#, 16] & /@ Tuples[{0, 15}, 6] (* Harvey P. Dale, Sep 22 2011 *) (* or much slower *)
fQ[n_] := Union@ Join[{0, 15}, IntegerDigits[n, 16]] == {0, 15}; Select[ Range[0, 11000000 ], fQ] (* Robert G. Wilson v, May 12 2012 *)
A033043
Sums of distinct powers of 6.
Original entry on oeis.org
0, 1, 6, 7, 36, 37, 42, 43, 216, 217, 222, 223, 252, 253, 258, 259, 1296, 1297, 1302, 1303, 1332, 1333, 1338, 1339, 1512, 1513, 1518, 1519, 1548, 1549, 1554, 1555, 7776, 7777, 7782, 7783, 7812, 7813, 7818, 7819, 7992, 7993, 7998, 7999, 8028, 8029, 8034
Offset: 0
-
function a(n)
m, r, b = n, 0, 1
while m > 0
m, q = divrem(m, 2)
r += b * q
b *= 6
end
r end; [a(n) for n in 0:46] |> println # Peter Luschny, Jan 03 2021
-
S:= {0,1}:
for i from 1 to 6 do S:= S union (S +~ 6^i) od:
sort(convert(S,list)); # Robert Israel, Apr 04 2025
-
t = Table[FromDigits[RealDigits[n, 2], 6], {n, 0, 100}] (* Clark Kimberling, Aug 02 2012 *)
FromDigits[#,6]&/@Tuples[{0,1},6] (* Harvey P. Dale, Mar 31 2016 *)
-
A033043(n,b=6)=subst(Pol(binary(n)),'x,b) \\ M. F. Hasler, Feb 01 2016
-
a(n)=fromdigits(binary(n), 6) \\ Charles R Greathouse IV, Jan 11 2017
-
def A033043(n): return int(bin(n)[2:],6) # Chai Wah Wu, Apr 04 2025
A033045
Sums of distinct powers of 8.
Original entry on oeis.org
0, 1, 8, 9, 64, 65, 72, 73, 512, 513, 520, 521, 576, 577, 584, 585, 4096, 4097, 4104, 4105, 4160, 4161, 4168, 4169, 4608, 4609, 4616, 4617, 4672, 4673, 4680, 4681, 32768, 32769, 32776, 32777, 32832, 32833, 32840, 32841, 33280, 33281, 33288
Offset: 0
a(7)=72 because 72_10 = 110_8.
- David A. Corneth, Table of n, a(n) for n = 0..9999 (first 1024 terms from T. D. Noe)
- Hsien-Kuei Hwang, Svante Janson, and Tsung-Hsi Tsai, Identities and periodic oscillations of divide-and-conquer recurrences splitting at half, arXiv:2210.10968 [cs.DS], 2022, p. 45.
- Michael Penn, "almost" a generating function..., YouTube video, 2020.
A033046
Sums of distinct powers of 9.
Original entry on oeis.org
0, 1, 9, 10, 81, 82, 90, 91, 729, 730, 738, 739, 810, 811, 819, 820, 6561, 6562, 6570, 6571, 6642, 6643, 6651, 6652, 7290, 7291, 7299, 7300, 7371, 7372, 7380, 7381, 59049, 59050, 59058, 59059, 59130, 59131, 59139, 59140, 59778, 59779, 59787
Offset: 0
A033044
Sums of distinct powers of 7.
Original entry on oeis.org
0, 1, 7, 8, 49, 50, 56, 57, 343, 344, 350, 351, 392, 393, 399, 400, 2401, 2402, 2408, 2409, 2450, 2451, 2457, 2458, 2744, 2745, 2751, 2752, 2793, 2794, 2800, 2801, 16807, 16808, 16814, 16815, 16856, 16857, 16863, 16864, 17150, 17151, 17157
Offset: 1
-
t = Table[FromDigits[RealDigits[n, 2], 7], {n, 0, 100}]
(* Clark Kimberling, Aug 03 2012 *)
FromDigits[#,7]&/@Tuples[{0,1},6] (* Harvey P. Dale, Apr 30 2015 *)
-
A033044(n,b=7)=subst(Pol(binary(n-1)),'x,b) \\ M. F. Hasler, Feb 01 2016
-
a(n)=fromdigits(binary(n), 7) \\ Charles R Greathouse IV, Jan 11 2017
Showing 1-10 of 19 results.
Comments