A003242
Number of compositions of n such that no two adjacent parts are equal (these are sometimes called Carlitz compositions).
Original entry on oeis.org
1, 1, 1, 3, 4, 7, 14, 23, 39, 71, 124, 214, 378, 661, 1152, 2024, 3542, 6189, 10843, 18978, 33202, 58130, 101742, 178045, 311648, 545470, 954658, 1670919, 2924536, 5118559, 8958772, 15680073, 27443763, 48033284, 84069952, 147142465, 257534928, 450748483, 788918212
Offset: 0
From _Joerg Arndt_, Oct 27 2012: (Start)
The 23 such compositions of n=7 are
[ 1] 1 2 1 2 1
[ 2] 1 2 1 3
[ 3] 1 2 3 1
[ 4] 1 2 4
[ 5] 1 3 1 2
[ 6] 1 3 2 1
[ 7] 1 4 2
[ 8] 1 5 1
[ 9] 1 6
[10] 2 1 3 1
[11] 2 1 4
[12] 2 3 2
[13] 2 4 1
[14] 2 5
[15] 3 1 2 1
[16] 3 1 3
[17] 3 4
[18] 4 1 2
[19] 4 2 1
[20] 4 3
[21] 5 2
[22] 6 1
[23] 7
(End)
- Miklos Bona, editor, Handbook of Enumerative Combinatorics, CRC Press, 2015, page 191.
- Alois P. Heinz, Table of n, a(n) for n = 0..4100 (first 501 terms from Christian G. Bower)
- L. Carlitz, Restricted Compositions, Fibonacci Quarterly, 14 (1976) 254-264.
- Sylvie Corteel, Paweł Hitczenko, Generalizations of Carlitz Compositions, Journal of Integer Sequences, Vol. 10 (2007), Article 07.8.8
- Steven R. Finch, Errata and Addenda to Mathematical Constants, arXiv:2001.00578 [math.HO], 2020-2022, p. 42 and 117.
- P. Flajolet and R. Sedgewick, Analytic Combinatorics, 2009; see page 201
- F. Harary & R. W. Robinson, The number of achiral trees, Jnl. Reine Angewandte Mathematik 278 (1975), 322-335. (Annotated scanned copy)
- A. Knopfmacher and H. Prodinger, On Carlitz compositions, European Journal of Combinatorics, Vol. 19, 1998, pp. 579-589.
- E. Munarini, M. Poneti, S. Rinaldi, Matrix compositions, JIS 12 (2009) 09.4.8, Chapter 8.
Compositions with adjacent parts coprime are
A167606.
The complement is counted by
A261983.
-
a003242 n = a003242_list !! n
a003242_list = 1 : f [1] where
f xs = y : f (y : xs) where
y = sum $ zipWith (*) xs a048272_list
-- Reinhard Zumkeller, Nov 04 2015
-
b:= proc(n, i) option remember; `if`(n=0, 1,
add(`if`(j=i, 0, b(n-j, `if`(j<=n-j, j, 0))), j=1..n))
end:
a:= n-> b(n, 0):
seq(a(n), n=0..50); # Alois P. Heinz, Mar 27 2014
-
A048272[n_] := Total[If[OddQ[#], 1, -1]& /@ Divisors[n]]; a[n_] := a[n] = Sum[A048272[k]*a[n-k], {k, 1, n}]; a[0] = 1; Table[a[n], {n, 0, 38}](* Jean-François Alcover, Nov 25 2011, after Vladeta Jovovic *)
nmax = 50; CoefficientList[Series[1/(1 - Sum[x^k/(1 + x^k), {k, 1, nmax}]), {x, 0, nmax}], x] (* Vaclav Kotesovec, Jul 07 2020 *)
Table[Count[Flatten[Permutations/@IntegerPartitions[n],1],?(FreeQ[Differences[#],0]&)],{n,0,20}] (* The program generates the first 21 terms of the sequence. *) (* _Harvey P. Dale, Nov 23 2024 *)
-
N = 66; x = 'x + O('x^N); p=2;
gf = 1/(1-sum(k=1,N, x^k/(1-x^k)-p*x^(k*p)/(1-x^(k*p))));
Vec(gf) /* Joerg Arndt, Apr 28 2013 */
A000837
Number of partitions of n into relatively prime parts. Also aperiodic partitions.
Original entry on oeis.org
1, 1, 1, 2, 3, 6, 7, 14, 17, 27, 34, 55, 63, 100, 119, 167, 209, 296, 347, 489, 582, 775, 945, 1254, 1481, 1951, 2334, 2980, 3580, 4564, 5386, 6841, 8118, 10085, 12012, 14862, 17526, 21636, 25524, 31082, 36694, 44582, 52255, 63260, 74170, 88931, 104302
Offset: 0
Of the 11 partitions of 6, we must exclude 6, 4+2, 3+3 and 2+2+2, so a(6) = 11 - 4 = 7.
For n=6, 2+2+1+1 is periodic because it can be written 2*(2+1), similarly 1+1+1+1+1+1, 3+3 and 2+2+2.
The a(6) = 7 partitions into relatively prime parts are (51), (411), (321), (3111), (2211), (21111), (111111). The a(6) = 7 aperiodic partitions are (6), (51), (42), (411), (321), (3111), (21111). - _Gus Wiseman_, Dec 19 2017
- H. W. Gould, personal communication.
- Vaclav Kotesovec, Table of n, a(n) for n = 0..10000 (terms 0..1000 from T. D. Noe)
- Mohamed El Bachraoui, On the Parity of p(n,3) and p_psi(n,3), Contributions to Discrete Mathematics, Vol. 5.2 (2010).
- Wolfdieter Lang, Cantor's List of Real Algebraic Numbers of Heights 1 to 7, arXiv:2307.10645 [math.NT], 2023.
- Mircea Merca and Maxie D. Schmidt, Generating Special Arithmetic Functions by Lambert Series Factorizations, arXiv:1706.00393 [math.NT], 2017. See Remark 3.4.
- N. J. A. Sloane, Transforms
-
p[n_] := IntegerPartitions[n]; l[n_] := Length[p[n]]; g[n_, j_] := Apply[GCD, Part[p[n], j]]; h[n_] := Table[g[n, j], {j, 1, l[n]}]; Join[{1}, Table[Count[h[n], 1], {n, 1, 20}]]
(* Clark Kimberling, Mar 09 2012 *)
a[0] = 1; a[n_] := Sum[ MoebiusMu[n/d] * PartitionsP[d], {d, Divisors[n]}]; Table[a[n], {n, 0, 50}] (* Jean-François Alcover, Oct 03 2013 *)
-
N=66; x='x+O('x^N); gf=2+sum(n=1,N, (1/eta(x^n))*moebius(n)); Vec(gf) \\ Joerg Arndt, May 11 2013
-
print1("1, "); for(n=1,46,my(s=0);forpart(X=n,s+=gcd(X)==1);print1(s,", ")) \\ Hugo Pfoertner, Mar 27 2020
-
from sympy import npartitions, mobius, divisors
def a(n): return 1 if n==0 else sum(mobius(n//d)*npartitions(d) for d in divisors(n)) # Indranil Ghosh, Apr 26 2017
A059966
a(n) = (1/n) * Sum_{ d divides n } mu(n/d) * (2^d - 1).
Original entry on oeis.org
1, 1, 2, 3, 6, 9, 18, 30, 56, 99, 186, 335, 630, 1161, 2182, 4080, 7710, 14532, 27594, 52377, 99858, 190557, 364722, 698870, 1342176, 2580795, 4971008, 9586395, 18512790, 35790267, 69273666, 134215680, 260300986, 505286415, 981706806
Offset: 1
a(4)=3: the 3 elements [a,c], [a[a,b]] and d form a basis of all homogeneous elements of degree 4 in the free Lie algebra with generators a of degree 1, b of degree 2, c of degree 3 and d of degree 4.
From _Gus Wiseman_, Dec 19 2017: (Start)
The sequence of Lyndon compositions organized by sum begins:
(1),
(2),
(3),(12),
(4),(13),(112),
(5),(14),(23),(113),(122),(1112),
(6),(15),(24),(114),(132),(123),(1113),(1122),(11112),
(7),(16),(25),(115),(34),(142),(124),(1114),(133),(223),(1213),(1132),(1123),(11113),(1222),(11212),(11122),(111112). (End)
- C. Reutenauer, Free Lie algebras, Clarendon press, Oxford (1993).
- Reinhard Zumkeller, Table of n, a(n) for n = 1..1000
- Nicolas Andrews, Lucas Gagnon, Félix Gélinas, Eric Schlums, and Mike Zabrocki, When are Hopf algebras determined by integer sequences?, arXiv:2505.06941 [math.CO], 2025. See p. 17.
- S. V. Duzhin and D. V. Pasechnik, Groups acting on necklaces and sandpile groups, Journal of Mathematical Sciences, August 2014, Volume 200, Issue 6, pp 690-697. See page 85. - N. J. A. Sloane, Jun 30 2014
- Seok-Jin Kang and Myung-Hwan Kim, Free Lie Algebras, Generalized Witt Formula and the Denominator Identity, Journal of Algebra 183, 560-594 (1996).
- Michael J. Mossinghoff and Timothy S. Trudgian, A tale of two omegas, arXiv:1906.02847 [math.NT], 2019.
- G. Niklasch, Some number theoretical constants: 1000-digit values [Cached copy]
- Jakob Oesinghaus, Quasi-symmetric functions and the Chow ring of the stack of expanded pairs, arXiv:1806.10700 [math.AG], 2018.
- Robert Schneider, Andrew V. Sills, and Hunter Waldron, On the q-factorization of power series, arXiv:2501.18744 [math.CO], 2025. See p. 6.
Apart from initial terms, same as
A001037.
Cf.
A000225,
A000740,
A008683,
A008965,
A011782,
A060223,
A185700,
A228369,
A269134 A281013,
A296302,
A296373.
-
a059966 n = sum (map (\x -> a008683 (n `div` x) * a000225 x)
[d | d <- [1..n], mod n d == 0]) `div` n
-- Reinhard Zumkeller, Nov 18 2011
-
Table[1/n Apply[Plus, Map[(MoebiusMu[n/# ](2^# - 1)) &, Divisors[n]]], {n, 20}]
(* Second program: *)
Table[(1/n) DivisorSum[n, MoebiusMu[n/#] (2^# - 1) &], {n, 35}] (* Michael De Vlieger, Jul 22 2019 *)
-
from sympy import mobius, divisors
def A059966(n): return sum(mobius(n//d)*(2**d-1) for d in divisors(n,generator=True))//n # Chai Wah Wu, Feb 03 2022
Description corrected by Axel Kleinschmidt, Sep 15 2002
A329739
Number of compositions of n whose run-lengths are all different.
Original entry on oeis.org
1, 1, 2, 2, 5, 8, 10, 20, 28, 41, 62, 102, 124, 208, 278, 426, 571, 872, 1158, 1718, 2306, 3304, 4402, 6286, 8446, 11725, 15644, 21642, 28636, 38956, 52296, 70106, 93224, 124758, 165266, 218916, 290583, 381706, 503174, 659160, 865020, 1124458, 1473912, 1907298
Offset: 0
The a(1) = 1 through a(7) = 20 compositions:
(1) (2) (3) (4) (5) (6) (7)
(11) (111) (22) (113) (33) (115)
(112) (122) (114) (133)
(211) (221) (222) (223)
(1111) (311) (411) (322)
(1112) (1113) (331)
(2111) (3111) (511)
(11111) (11112) (1114)
(21111) (1222)
(111111) (2221)
(4111)
(11113)
(11122)
(22111)
(31111)
(111112)
(111211)
(112111)
(211111)
(1111111)
Compositions with relatively prime run-lengths are
A000740.
Compositions with distinct multiplicities are
A242882.
Compositions with distinct differences are
A325545.
Compositions with equal run-lengths are
A329738.
Compositions with normal run-lengths are
A329766.
-
Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],UnsameQ@@Length/@Split[#]&]],{n,0,10}]
A027375
Number of aperiodic binary strings of length n; also number of binary sequences with primitive period n.
Original entry on oeis.org
0, 2, 2, 6, 12, 30, 54, 126, 240, 504, 990, 2046, 4020, 8190, 16254, 32730, 65280, 131070, 261576, 524286, 1047540, 2097018, 4192254, 8388606, 16772880, 33554400, 67100670, 134217216, 268419060, 536870910, 1073708010, 2147483646, 4294901760
Offset: 0
a(3) = 6 = |{ 001, 010, 011, 100, 101, 110 }|. - corrected by _Geoffrey Critzer_, Dec 07 2014
- J.-P. Allouche and J. Shallit, Automatic Sequences, Cambridge Univ. Press, 2003, p. 13. - From N. J. A. Sloane, Oct 26 2012
- E. R. Berlekamp, Algebraic Coding Theory, McGraw-Hill, NY, 1968, p. 84.
- Blanchet-Sadri, Francine. Algorithmic combinatorics on partial words. Chapman & Hall/CRC, Boca Raton, FL, 2008. ii+385 pp. ISBN: 978-1-4200-6092-8; 1-4200-6092-9 MR2384993 (2009f:68142). See p. 164.
- S. W. Golomb, Shift-Register Sequences, Holden-Day, San Francisco, 1967.
- Mark I. Krusemeyer, George T. Gilbert, Loren C. Larson, A Mathematical Orchard, Problems and Solutions, MAA, 2012, Problem 128, pp. 225-227.
- T. D. Noe, Table of n, a(n) for n = 0..300
- J.-P. Allouche, Note on the transcendence of a generating function. In A. Laurincikas and E. Manstavicius, editors, Proceedings of the Palanga Conference for the 75th birthday of Prof. Kubilius, New trends in Probab. and Statist., Vol. 4, pages 461-465, 1997.
- B. Chaffin, J. P. Linderman, N. J. A. Sloane and Allan Wilks, On Curling Numbers of Integer Sequences, arXiv:1212.6102 [math.CO], Dec 25 2012.
- B. Chaffin, J. P. Linderman, N. J. A. Sloane and Allan Wilks, On Curling Numbers of Integer Sequences, Journal of Integer Sequences, Vol. 16 (2013), Article 13.4.3.
- John D. Cook, Counting primitive bit strings (2014).
- P. Flajolet and R. Sedgewick, Analytic Combinatorics, 2009; see page 85.
- Guilhem Gamard, Gwenaël Richomme, Jeffrey Shallit and Taylor J. Smith, Periodicity in rectangular arrays, arXiv:1602.06915 [cs.DM], 2016; Information Processing Letters 118 (2017) 58-63. See Table 1.
- O. Georgiou, C. P. Dettmann and E. G. Altmann, Faster than expected escape for a class of fully chaotic maps, arXiv preprint arXiv:1207.7000 [nlin.CD], 2012. - From _N. J. A. Sloane_, Dec 23 2012
- E. N. Gilbert and J. Riordan, Symmetry types of periodic sequences, Illinois J. Math., 5 (1961), 657-665.
- David W. Lyons, Cristina Mullican, Adam Rilatt, and Jack D. Putnam, Werner states from diagrams, arXiv:2302.05572 [quant-ph], 2023.
- Robert M. May, Simple mathematical models with very complicated dynamics, Nature, Vol. 261, June 10, 1976, pp. 459-467; reprinted in The Theory of Chaotic Attractors, pp. 85-93. Springer, New York, NY, 2004. The sequences listed in Table 2 are A000079, A027375, A000031, A001037, A000048, A051841. - _N. J. A. Sloane_, Mar 17 2019
- M. B. Nathanson, Primitive sets and Euler phi function for subsets of {1,2,...,n}, arXiv:math/0608150 [math.NT], 2006-2007.
- P. Pongsriiam, Relatively Prime Sets, Divisor Sums, and Partial Sums, arXiv:1306.4891 [math.NT], 2013 and J. Int. Seq. 16 (2013) #13.9.1.
- P. Pongsriiam, A remark on relative prime sets, arXiv:1306.2529 [math.NT], 2013.
- P. Pongsriiam, A remark on relative prime sets, Integers 13 (2013), A49.
- R. C. Read, Combinatorial problems in the theory of music, Disc. Math. 167/168 (1997) 543-551, sequence A(n).
- M. Tang, Relatively Prime Sets and a Phi Function for Subsets of {1, 2, ... , n}, J. Int. Seq. 13 (2010) # 10.7.6.
- László Tóth, Menon-type identities concerning subsets of the set {1,2,...,n}, arXiv:2109.06541 [math.NT], 2021.
A038199 and
A056267 are essentially the same sequence with different initial terms.
-
a027375 n = n * a001037 n -- Reinhard Zumkeller, Feb 01 2013
-
with(numtheory): A027375 :=n->add( mobius(d)*2^(n/d), d = divisors(n)); # N. J. A. Sloane, Sep 25 2012
-
Table[ Apply[ Plus, MoebiusMu[ n / Divisors[n] ]*2^Divisors[n] ], {n, 1, 32} ]
a[0]=0; a[n_] := DivisorSum[n, MoebiusMu[n/#]*2^#&]; Array[a, 40, 0] (* Jean-François Alcover, Dec 01 2015 *)
-
a(n) = sumdiv(n,d,moebius(n\d)*2^d);
-
from sympy import mobius, divisors
def a(n): return sum(mobius(d)*2**(n//d) for d in divisors(n))
print([a(n) for n in range(101)]) # Indranil Ghosh, Jun 28 2017
A078374
Number of partitions of n into distinct and relatively prime parts.
Original entry on oeis.org
1, 0, 1, 1, 2, 2, 4, 4, 6, 7, 11, 10, 17, 17, 23, 26, 37, 36, 53, 53, 70, 77, 103, 103, 139, 147, 184, 199, 255, 260, 339, 358, 435, 474, 578, 611, 759, 810, 963, 1045, 1259, 1331, 1609, 1726, 2015, 2200, 2589, 2762, 3259, 3509, 4058, 4416, 5119, 5488, 6364, 6882
Offset: 1
From _Gus Wiseman_, Oct 18 2020: (Start)
The a(1) = 1 through a(13) = 17 partitions (empty column indicated by dot, A = 10, B = 11, C = 12):
1 . 21 31 32 51 43 53 54 73 65 75 76
41 321 52 71 72 91 74 B1 85
61 431 81 532 83 543 94
421 521 432 541 92 651 A3
531 631 A1 732 B2
621 721 542 741 C1
4321 632 831 643
641 921 652
731 5421 742
821 6321 751
5321 832
841
931
A21
5431
6421
7321
(End)
A000837 is the not necessarily strict version.
A302796 gives the Heinz numbers of these partitions.
A305713 is the pairwise coprime instead of relatively prime version.
A000740 counts relatively prime compositions.
Cf.
A007359,
A101268,
A289508,
A289509,
A291166,
A298748,
A337451,
A337485,
A337451,
A337561,
A337563.
-
Table[Length[Select[IntegerPartitions[n],UnsameQ@@#&&GCD@@#==1&]],{n,15}] (* Gus Wiseman, Oct 18 2020 *)
A329738
Number of compositions of n whose run-lengths are all equal.
Original entry on oeis.org
1, 1, 2, 4, 6, 8, 19, 24, 45, 75, 133, 215, 401, 662, 1177, 2035, 3587, 6190, 10933, 18979, 33339, 58157, 101958, 178046, 312088, 545478, 955321, 1670994, 2925717, 5118560, 8960946, 15680074, 27447350, 48033502, 84076143, 147142496, 257546243, 450748484, 788937192
Offset: 0
The a(1) = 1 through a(6) = 19 compositions:
(1) (2) (3) (4) (5) (6)
(11) (12) (13) (14) (15)
(21) (22) (23) (24)
(111) (31) (32) (33)
(121) (41) (42)
(1111) (131) (51)
(212) (123)
(11111) (132)
(141)
(213)
(222)
(231)
(312)
(321)
(1122)
(1212)
(2121)
(2211)
(111111)
Compositions with relatively prime run-lengths are
A000740.
Compositions with equal multiplicities are
A098504.
Compositions with equal differences are
A175342.
Compositions with distinct run-lengths are
A329739.
-
Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],SameQ@@Length/@Split[#]&]],{n,0,10}]
-
seq(n)={my(b=Vec(1/(1 - sum(k=1, n, x^k/(1+x^k) + O(x*x^n)))-1)); concat([1], vector(n, k, sumdiv(k, d, b[d])))} \\ Andrew Howroyd, Dec 30 2020
A328596
Numbers whose reversed binary expansion is a Lyndon word (aperiodic necklace).
Original entry on oeis.org
1, 2, 4, 6, 8, 12, 14, 16, 20, 24, 26, 28, 30, 32, 40, 44, 48, 52, 56, 58, 60, 62, 64, 72, 80, 84, 88, 92, 96, 100, 104, 106, 108, 112, 116, 118, 120, 122, 124, 126, 128, 144, 152, 160, 164, 168, 172, 176, 180, 184, 188, 192, 200, 208, 212, 216, 218, 220, 224
Offset: 1
The sequence of terms together with their binary expansions and binary indices begins:
1: 1 ~ {1}
2: 10 ~ {2}
4: 100 ~ {3}
6: 110 ~ {2,3}
8: 1000 ~ {4}
12: 1100 ~ {3,4}
14: 1110 ~ {2,3,4}
16: 10000 ~ {5}
20: 10100 ~ {3,5}
24: 11000 ~ {4,5}
26: 11010 ~ {2,4,5}
28: 11100 ~ {3,4,5}
30: 11110 ~ {2,3,4,5}
32: 100000 ~ {6}
40: 101000 ~ {4,6}
44: 101100 ~ {3,4,6}
48: 110000 ~ {5,6}
52: 110100 ~ {3,5,6}
56: 111000 ~ {4,5,6}
58: 111010 ~ {2,4,5,6}
-
aperQ[q_]:=Array[RotateRight[q,#]&,Length[q],1,UnsameQ];
neckQ[q_]:=Array[OrderedQ[{q,RotateRight[q,#]}]&,Length[q]-1,1,And];
Select[Range[100],aperQ[Reverse[IntegerDigits[#,2]]]&&neckQ[Reverse[IntegerDigits[#,2]]]&]
A100953
Number of partitions of n into relatively prime parts such that multiplicities of parts are also relatively prime.
Original entry on oeis.org
1, 1, 0, 1, 2, 5, 5, 13, 14, 25, 28, 54, 54, 99, 105, 160, 192, 295, 315, 488, 546, 760, 890, 1253, 1404, 1945, 2234, 2953, 3459, 4563, 5186, 6840, 7909, 10029, 11716, 14843, 17123, 21635, 25035, 30981, 36098, 44581, 51370, 63259, 73223, 88739, 103048, 124752
Offset: 0
-
read transforms : a000837 := [] : b000837 := fopen("b000837.txt",READ) : bfil := readline(b000837) : while StringTools[WordCount](bfil) > 0 do b := sscanf( bfil,"%d %d") ; a000837 := [op(a000837),op(2,b)] ; bfil := readline(b000837) ; od: fclose(b000837) ; a000837 := subsop(1=NULL,a000837) : a := MOBIUS(a000837) : for n from 1 to 120 do printf("%d, ",op(n,a)) ; od: # R. J. Mathar, Mar 12 2008
# second Maple program:
with(numtheory): with(combinat):
b:= proc(n) option remember; `if`(n=0, 1, add(
mobius(n/d)*numbpart(d), d=divisors(n)))
end:
a:= proc(n) option remember; `if`(n=0, 1, add(
mobius(n/d)*b(d), d=divisors(n)))
end:
seq(a(n), n=0..60); # Alois P. Heinz, Dec 19 2017
-
Table[Length[Select[IntegerPartitions[n],And[GCD@@#===1,GCD@@Length/@Split[#]===1]&]],{n,20}] (* Gus Wiseman, Dec 19 2017 *)
b[n_] := b[n] = If[n==0, 1, Sum[
MoebiusMu[n/d]*PartitionsP[d], {d, Divisors[n]}]];
a[n_] := a[n] = If[n==0, 1, Sum[
MoebiusMu[n/d]*b[d], {d, Divisors[n]}]];
a /@ Range[0, 60] (* Jean-François Alcover, May 21 2021, after Alois P. Heinz *)
A275692
Numbers k such that every rotation of the binary digits of k is less than k.
Original entry on oeis.org
0, 1, 2, 4, 6, 8, 12, 14, 16, 20, 24, 26, 28, 30, 32, 40, 48, 50, 52, 56, 58, 60, 62, 64, 72, 80, 84, 96, 98, 100, 104, 106, 108, 112, 114, 116, 118, 120, 122, 124, 126, 128, 144, 160, 164, 168, 192, 194, 196, 200, 202, 208, 210, 212, 216, 218, 224, 226, 228
Offset: 1
6 is in the sequence because its binary representation 110 is greater than all the rotations 011 and 101.
10 is not in the sequence because its binary representation 1010 is unchanged under rotation by 2 places.
From _Gus Wiseman_, Oct 31 2019: (Start)
The sequence of terms together with their binary expansions and binary indices begins:
1: 1 ~ {1}
2: 10 ~ {2}
4: 100 ~ {3}
6: 110 ~ {2,3}
8: 1000 ~ {4}
12: 1100 ~ {3,4}
14: 1110 ~ {2,3,4}
16: 10000 ~ {5}
20: 10100 ~ {3,5}
24: 11000 ~ {4,5}
26: 11010 ~ {2,4,5}
28: 11100 ~ {3,4,5}
30: 11110 ~ {2,3,4,5}
32: 100000 ~ {6}
40: 101000 ~ {4,6}
48: 110000 ~ {5,6}
50: 110010 ~ {2,5,6}
52: 110100 ~ {3,5,6}
56: 111000 ~ {4,5,6}
58: 111010 ~ {2,4,5,6}
(End)
Numbers whose binary expansion is aperiodic are
A328594.
Numbers whose reversed binary expansion is a necklace are
A328595.
Length of Lyndon factorization of binary expansion is
A211100.
Length of co-Lyndon factorization of binary expansion is
A329312.
Length of Lyndon factorization of reversed binary expansion is
A329313.
Length of co-Lyndon factorization of reversed binary expansion is
A329326.
All of the following pertain to compositions in standard order (
A066099):
- Rotational symmetries are counted by
A138904.
- Constant compositions are
A272919.
- Lyndon compositions are
A275692 (this sequence).
- Co-Lyndon compositions are
A326774.
- Co-Lyndon factorizations are counted by
A333765.
- Lyndon factorizations are counted by
A333940.
-
filter:= proc(n) local L, k;
L:= convert(convert(n,binary),string);
for k from 1 to length(L)-1 do
if lexorder(L,StringTools:-Rotate(L,k)) then return false fi;
od;
true
end proc:
select(filter, [$0..1000]);
-
filterQ[n_] := Module[{bits, rr}, bits = IntegerDigits[n, 2]; rr = NestList[RotateRight, bits, Length[bits]-1] // Rest; AllTrue[rr, FromDigits[#, 2] < n&]];
Select[Range[0, 1000], filterQ] (* Jean-François Alcover, Apr 29 2019 *)
-
def ok(n):
b = bin(n)[2:]
return all(b[i:] + b[:i] < b for i in range(1, len(b)))
print([k for k in range(230) if ok(k)]) # Michael S. Branicky, May 26 2022
Showing 1-10 of 199 results.
Comments