[go: up one dir, main page]

login
Search: a003159 -id:a003159
     Sort: relevance | references | number | modified | created      Format: long | short | data
Primorial base log-function: fully additive with a(p) = p#/p, where p# = A034386(p).
+0
151
0, 1, 2, 2, 6, 3, 30, 3, 4, 7, 210, 4, 2310, 31, 8, 4, 30030, 5, 510510, 8, 32, 211, 9699690, 5, 12, 2311, 6, 32, 223092870, 9, 6469693230, 5, 212, 30031, 36, 6, 200560490130, 510511, 2312, 9, 7420738134810, 33, 304250263527210, 212, 10, 9699691, 13082761331670030, 6, 60, 13, 30032, 2312, 614889782588491410, 7, 216, 33, 510512, 223092871, 32589158477190044730, 10
OFFSET
1,3
COMMENTS
Completely additive with a(p^e) = e * A002110(A000720(p)-1).
This is a left inverse of A276086 ("primorial base exp-function"), hence the name "primorial base log-function". When the domain is restricted to the terms of A048103, this works also as a right inverse, as A276086(a(A048103(n))) = A048103(n) for all n >= 1. - Antti Karttunen, Apr 24 2022
On average, every third term is a multiple of 4. See A369001. - Antti Karttunen, May 26 2024
FORMULA
a(1) = 0; for n > 1, a(n) = a(A028234(n)) + (A067029(n) * A002110(A055396(n)-1)).
a(1) = 0, a(n) = (e1*A002110(i1-1) + ... + ez*A002110(iz-1)) when n = prime(i1)^e1 * ... * prime(iz)^ez.
Other identities.
For all n >= 0:
a(A276086(n)) = n.
a(A000040(1+n)) = A002110(n).
a(A002110(1+n)) = A143293(n).
From Antti Karttunen, Apr 24 & Apr 29 2022: (Start)
a(A283477(n)) = A283985(n).
a(A108951(n)) = A346105(n). [The latter has a similar additive formula as this sequence, but instead of primorials, uses their partial sums]
When applied to sequences where a certain subset of the divisors of n has been multiplicatively encoded with the help of A276086, this yields a corresponding number-theoretical sequence, i.e. completes their computation:
a(A319708(n)) = A001065(n) and a(A353564(n)) = A051953(n).
a(A329350(n)) = A069359(n) and a(A329380(n)) = A323599(n).
In the following group, the sum of the rhs-sequences is n [on each row, as say, A328841(n)+A328842(n)=n], because the pointwise product of the corresponding lhs-sequences is A276086:
a(A053669(n)) = A053589(n) and a(A324895(n)) = A276151(n).
a(A328571(n)) = A328841(n) and a(A328572(n)) = A328842(n).
a(A351231(n)) = A351233(n) and a(A327858(n)) = A351234(n).
a(A351251(n)) = A351253(n) and a(A324198(n)) = A351254(n).
The sum or difference of the rhs-sequences is A108951:
a(A344592(n)) = A346092(n) and a(A346091(n)) = A346093(n).
a(A346106(n)) = A346108(n) and a(A346107(n)) = A346109(n).
Here the two sequences are inverse permutations of each other:
a(A328624(n)) = A328625(n) and a(A328627(n)) = A328626(n).
a(A346102(n)) = A328622(n) and a(A346233(n)) = A328623(n).
a(A346101(n)) = A289234(n). [Self-inverse]
Other correspondences:
a(A324350(x,y)) = A324351(x,y).
a(A003961(A276086(n))) = A276154(n). [The primorial base left shift]
a(A276076(n)) = A351576(n). [Sequence reinterpreting factorial base representation as a primorial base representation]
(End)
MATHEMATICA
nn = 60; b = MixedRadix[Reverse@ Prime@ Range@ PrimePi[nn + 1]]; Table[FromDigits[#, b] &@ Reverse@ If[n == 1, {0}, Function[k, ReplacePart[Table[0, {PrimePi[k[[-1, 1]]]}], #] &@ Map[PrimePi@ First@ # -> Last@ # &, k]]@ FactorInteger@ n], {n, nn}] (* Version 10.2, or *)
f[w_List] := Total[Times @@@ Transpose@ {Map[Times @@ # &, Prime@ Range@ Range[0, Length@ w - 1]], Reverse@ w}]; Table[f@ Reverse@ If[n == 1, {0}, Function[k, ReplacePart[Table[0, {PrimePi[k[[-1, 1]]]}], #] &@ Map[PrimePi@ First@ # -> Last@ # &, k]]@ FactorInteger@ n], {n, 60}] (* Michael De Vlieger, Aug 30 2016 *)
PROG
(Scheme, with memoization-macro definec)
(definec (A276085 n) (cond ((= 1 n) (- n 1)) (else (+ (* (A067029 n) (A002110 (+ -1 (A055396 n)))) (A276085 (A028234 n))))))
(PARI) A276085(n) = { my(f = factor(n), pr=1, i=1, s=0); for(k=1, #f~, while(i <= primepi(f[k, 1])-1, pr *= prime(i); i++); s += f[k, 2]*pr); (s); }; \\ Antti Karttunen, Nov 11 2024
(Python)
from sympy import primorial, primepi, factorint
def a002110(n):
return 1 if n<1 else primorial(n)
def a(n):
f=factorint(n)
return sum(f[i]*a002110(primepi(i) - 1) for i in f)
print([a(n) for n in range(1, 101)]) # Indranil Ghosh, Jun 22 2017
CROSSREFS
A left inverse of A276086.
Positions of multiples of k in this sequence, for k=2, 3, 4, 5, 8, 27, 3125: A003159, A339746, A369002, A373140, A373138, A377872, A377878.
Cf. A036554 (positions of odd terms), A035263, A096268 (parity of terms).
Cf. A372575 (rgs-transform), A372576 [a(n) mod 360], A373842 [= A003415(a(n))].
Cf. A373145 [= gcd(A003415(n), a(n))], A373361 [= gcd(n, a(n))], A373362 [= gcd(A001414(n), a(n))], A373485 [= gcd(A083345(n), a(n))], A373835 [= gcd(bigomega(n), a(n))], and also A373367 and A373147 [= A003415(n) mod a(n)], A373148 [= a(n) mod A003415(n)].
Other completely additive sequences with primes p mapped to a function of p include: A001222 (with a(p)=1), A001414 (with a(p)=p), A059975 (with a(p)=p-1), A341885 (with a(p)=p*(p+1)/2), A373149 (with a(p)=prevprime(p)), A373158 (with a(p)=p#).
Cf. also A276075 for factorial base and A048675, A054841 for base-2 and base-10 analogs.
KEYWORD
nonn,changed
AUTHOR
Antti Karttunen, Aug 21 2016
EXTENSIONS
Name amended by Antti Karttunen, Apr 24 2022
Name simplified, the old name moved to the comments - Antti Karttunen, Jun 23 2024
STATUS
approved
Positive integers of the form 2^i*3^j*k, gcd(k,6)=1, and i == j (mod 3).
+0
15
1, 5, 6, 7, 8, 11, 13, 17, 19, 23, 25, 27, 29, 30, 31, 35, 36, 37, 40, 41, 42, 43, 47, 48, 49, 53, 55, 56, 59, 61, 64, 65, 66, 67, 71, 73, 77, 78, 79, 83, 85, 88, 89, 91, 95, 97, 101, 102, 103, 104, 107, 109, 113, 114, 115, 119, 121, 125, 127, 131, 133, 135
OFFSET
1,2
COMMENTS
From Peter Munn, Mar 16 2021: (Start)
The positive integers in the multiplicative subgroup of the positive rationals generated by 8, 6, and A215848 (primes greater than 3).
This subgroup, denoted H, has two cosets: 2H = (1/3)H and 3H = (1/2)H. It follows that the sequence is one part of a 3-part partition of the positive integers with the property that each part's terms are half the even terms of one of the other parts and also one third of the multiples of 3 in the remaining part.
(End)
Positions of multiples of 3 in A276085. Because A276085 is completely additive, this is closed under multiplication: if m and n are in the sequence then so is m*n. - Antti Karttunen, May 27 2024
The coset sequences mentioned in Peter Munn's comment above are A373261 and A373262. - Antti Karttunen, Jun 04 2024
LINKS
FORMULA
a(n) ~ (91/43)*n.
MAPLE
N:= 1000: # for terms <= N
R:= {}:
for k1 from 0 to floor(N/6) do
for k0 in [1, 5] do
k:= k0 + 6*k1;
for j from 0 while 3^j*k <= N do
for i from (j mod 3) by 3 do
x:= 2^i * 3^j * k;
if x > N then break fi;
R:= R union {x}
od od od od:
sort(convert(R, list)); # Robert Israel, Apr 08 2021
MATHEMATICA
Select[Range[130], Mod[IntegerExponent[#, 2] - IntegerExponent[#, 3], 3] == 0 &]
PROG
(PARI) isA339746 = A372573; \\ Antti Karttunen, Jun 04 2024
(Python)
from sympy import factorint
def ok(n):
f = factorint(n, limit=4)
i, j = 0 if 2 not in f else f[2], 0 if 3 not in f else f[3]
return (i-j)%3 == 0
def aupto(limit): return [m for m in range(1, limit+1) if ok(m)]
print(aupto(200)) # Michael S. Branicky, Mar 26 2021
CROSSREFS
Sequences of positive integers in a multiplicative subgroup of positive rationals generated by a set S and A215848: S={}: A007310, S={6}: A064615, S={3,4}: A003159, S={2,9}: A007417, S={4,6}: A036668, S={3,8}: A191257, S={4,9}: A339690, S={6,8}: this sequence.
Positions of 0's in A373153, positions of multiples of 3 in A276085 and in A372576.
Cf. A372573 (characteristic function), A373261, A373262.
Sequences giving positions of multiples of k in A276085, for k=2, 3, 4, 5, 8, 27: A003159, this sequence, A369002, A373140, A373138, A377872.
Cf. also A332820, A373992.
KEYWORD
nonn,changed
AUTHOR
Griffin N. Macris, Dec 15 2020
STATUS
approved
Thue-Morse sequence: let A_k denote the first 2^k terms; then A_0 = 0 and for k >= 0, A_{k+1} = A_k B_k, where B_k is obtained from A_k by interchanging 0's and 1's.
+0
569
0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1
OFFSET
0,1
COMMENTS
Named after Axel Thue, whose name is pronounced as if it were spelled "Tü" where the ü sound is roughly as in the German word üben. (It is incorrect to say "Too-ee" or "Too-eh".) - N. J. A. Sloane, Jun 12 2018
Also called the Thue-Morse infinite word, or the Morse-Hedlund sequence, or the parity sequence.
Fixed point of the morphism 0 --> 01, 1 --> 10, see example. - Joerg Arndt, Mar 12 2013
The sequence is cubefree (does not contain three consecutive identical blocks) [see Offner for a direct proof] and is overlap-free (does not contain XYXYX where X is 0 or 1 and Y is any string of 0's and 1's).
a(n) = "parity sequence" = parity of number of 1's in binary representation of n.
To construct the sequence: alternate blocks of 0's and 1's of successive lengths A003159(k) - A003159(k-1), k = 1, 2, 3, ... (A003159(0) = 0). Example: since the first seven differences of A003159 are 1, 2, 1, 1, 2, 2, 2, the sequence starts with 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0. - Emeric Deutsch, Jan 10 2003
Characteristic function of A000069 (odious numbers). - Ralf Stephan, Jun 20 2003
a(n) = S2(n) mod 2, where S2(n) = sum of digits of n, n in base-2 notation. There is a class of generalized Thue-Morse sequences: Let Sk(n) = sum of digits of n; n in base-k notation. Let F(t) be some arithmetic function. Then a(n)= F(Sk(n)) mod m is a generalized Thue-Morse sequence. The classical Thue-Morse sequence is the case k=2, m=2, F(t)= 1*t. - Ctibor O. Zizka, Feb 12 2008 (with correction from Daniel Hug, May 19 2017)
More generally, the partial sums of the generalized Thue-Morse sequences a(n) = F(Sk(n)) mod m are fractal, where Sk(n) is sum of digits of n, n in base k; F(t) is an arithmetic function; m integer. - Ctibor O. Zizka, Feb 25 2008
Starting with offset 1, = running sums mod 2 of the kneading sequence (A035263, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, ...); also parity of A005187: (1, 3, 4, 7, 8, 10, 11, 15, 16, 18, 19, ...). - Gary W. Adamson, Jun 15 2008
Generalized Thue-Morse sequences mod n (n>1) = the array shown in A141803. As n -> infinity the sequences -> (1, 2, 3, ...). - Gary W. Adamson, Jul 10 2008
The Thue-Morse sequence for N = 3 = A053838, (sum of digits of n in base 3, mod 3): (0, 1, 2, 1, 2, 0, 2, 0, 1, 1, 2, ...) = A004128 mod 3. - Gary W. Adamson, Aug 24 2008
For all positive integers k, the subsequence a(0) to a(2^k-1) is identical to the subsequence a(2^k+2^(k-1)) to a(2^(k+1)+2^(k-1)-1). That is to say, the first half of A_k is identical to the second half of B_k, and the second half of A_k is identical to the first quarter of B_{k+1}, which consists of the k/2 terms immediately following B_k.
Proof: The subsequence a(2^k+2^(k-1)) to a(2^(k+1)-1), the second half of B_k, is by definition formed from the subsequence a(2^(k-1)) to a(2^k-1), the second half of A_k, by interchanging its 0's and 1's. In turn, the subsequence a(2^(k-1)) to a(2^k-1), the second half of A_k, which is by definition also B_{k-1}, is by definition formed from the subsequence a(0) to a(2^(k-1)-1), the first half of A_k, which is by definition also A_{k-1}, by interchanging its 0's and 1's. Interchanging the 0's and 1's of a subsequence twice leaves it unchanged, so the subsequence a(2^k+2^(k-1)) to a(2^(k+1)-1), the second half of B_k, must be identical to the subsequence a(0) to a(2^(k-1)-1), the first half of A_k.
Also, the subsequence a(2^(k+1)) to a(2^(k+1)+2^(k-1)-1), the first quarter of B_{k+1}, is by definition formed from the subsequence a(0) to a(2^(k-1)-1), the first quarter of A_{k+1}, by interchanging its 0's and 1's. As noted above, the subsequence a(2^(k-1)) to a(2^k-1), the second half of A_k, which is by definition also B_{k-1}, is by definition formed from the subsequence a(0) to a(2^(k-1)-1), which is by definition A_{k-1}, by interchanging its 0's and 1's, as well. If two subsequences are formed from the same subsequence by interchanging its 0's and 1's then they must be identical, so the subsequence a(2^(k+1)) to a(2^(k+1)+2^(k-1)-1), the first quarter of B_{k+1}, must be identical to the subsequence a(2^(k-1)) to a(2^k-1), the second half of A_k.
Therefore the subsequence a(0), ..., a(2^(k-1)-1), a(2^(k-1)), ..., a(2^k-1) is identical to the subsequence a(2^k+2^(k-1)), ..., a(2^(k+1)-1), a(2^(k+1)), ..., a(2^(k+1)+2^(k-1)-1), QED.
According to the German chess rules of 1929 a game of chess was drawn if the same sequence of moves was repeated three times consecutively. Euwe, see the references, proved that this rule could lead to infinite games. For his proof he reinvented the Thue-Morse sequence. - Johannes W. Meijer, Feb 04 2010
"Thue-Morse 0->01 & 1->10, at each stage append the previous with its complement. Start with 0, 1, 2, 3 and write them in binary. Next calculate the sum of the digits (mod 2) - that is divide the sum by 2 and use the remainder." Pickover, The Math Book.
Let s_2(n) be the sum of the base-2 digits of n and epsilon(n) = (-1)^s_2(n), the Thue-Morse sequence, then prod(n >= 0, ((2*n+1)/(2*n+2))^epsilon(n) ) = 1/sqrt(2). - Jonathan Vos Post, Jun 06 2012
Dekking shows that the constant obtained by interpreting this sequence as a binary expansion is transcendental; see also "The Ubiquitous Prouhet-Thue-Morse Sequence". - Charles R Greathouse IV, Jul 23 2013
Drmota, Mauduit, and Rivat proved that the subsequence a(n^2) is normal--see A228039. - Jonathan Sondow, Sep 03 2013
Although the probability of a 0 or 1 is equal, guesses predicated on the latest bit seen produce a correct match 2 out of 3 times. - Bill McEachen, Mar 13 2015
From a(0) to a(2n+1), there are n+1 terms equal to 0 and n+1 terms equal to 1 (see Hassan Tarfaoui link, Concours Général 1990). - Bernard Schott, Jan 21 2022
REFERENCES
J.-P. Allouche and J. Shallit, Automatic Sequences, Cambridge Univ. Press, 2003, p. 15.
Jason Bell, Michael Coons, and Eric Rowland, "The Rational-Transcendental Dichotomy of Mahler Functions", Journal of Integer Sequences, Vol. 16 (2013), #13.2.10.
J. Berstel and J. Karhumaki, Combinatorics on words - a tutorial, Bull. EATCS, #79 (2003), pp. 178-228.
B. Bollobas, The Art of Mathematics: Coffee Time in Memphis, Cambridge, 2006, p. 224.
S. Brlek, Enumeration of factors in the Thue-Morse word, Discrete Applied Math., 24 (1989), 83-96. doi:10.1016/0166-218X(92)90274-E.
Yann Bugeaud and Guo-Niu Han, A combinatorial proof of the non-vanishing of Hankel determinants of the Thue-Morse sequence, Electronic Journal of Combinatorics 21(3) (2014), #P3.26.
Y. Bugeaud and M. Queffélec, On Rational Approximation of the Binary Thue-Morse-Mahler Number, Journal of Integer Sequences, 16 (2013), #13.2.3.
Currie, James D. "Non-repetitive words: Ages and essences." Combinatorica 16.1 (1996): 19-40
Colin Defant, Anti-Power Prefixes of the Thue-Morse Word, Journal of Combinatorics, 24(1) (2017), #P1.32
F. M. Dekking, Transcendance du nombre de Thue-Morse, Comptes Rendus de l'Academie des Sciences de Paris 285 (1977), pp. 157-160.
F. M. Dekking, On repetitions of blocks in binary sequences. J. Combinatorial Theory Ser. A 20 (1976), no. 3, pp. 292-299. MR0429728(55 #2739)
Dekking, Michel, Michel Mendès France, and Alf van der Poorten. "Folds." The Mathematical Intelligencer, 4.3 (1982): 130-138 & front cover, and 4:4 (1982): 173-181 (printed in two parts).
Dubickas, Artūras. On a sequence related to that of Thue-Morse and its applications. Discrete Math. 307 (2007), no. 9-10, 1082--1093. MR2292537 (2008b:11086).
Fabien Durand, Julien Leroy, and Gwenaël Richomme, "Do the Properties of an S-adic Representation Determine Factor Complexity?", Journal of Integer Sequences, Vol. 16 (2013), #13.2.6.
M. Euwe, Mengentheoretische Betrachtungen Über das Schachspiel, Proceedings Koninklijke Nederlandse Akademie van Wetenschappen, Amsterdam, Vol. 32 (5): 633-642, 1929.
S. Ferenczi, Complexity of sequences and dynamical systems, Discrete Math., 206 (1999), 145-154.
S. R. Finch, Mathematical Constants, Cambridge, 2003, Section 6.8.
W. H. Gottschalk and G. A. Hedlund, Topological Dynamics. American Mathematical Society, Colloquium Publications, Vol. 36, Providence, RI, 1955, p. 105.
J. Grytczuk, Thue type problems for graphs, points and numbers, Discrete Math., 308 (2008), 4419-4429.
A. Hof, O. Knill and B. Simon, Singular continuous spectrum for palindromic Schroedinger operators, Commun. Math. Phys. 174 (1995), 149-159.
Mari Huova and Juhani Karhumäki, "On Unavoidability of k-abelian Squares in Pure Morphic Words", Journal of Integer Sequences, Vol. 16 (2013), #13.2.9.
B. Kitchens, Review of "Computational Ergodic Theory" by G. H. Choe, Bull. Amer. Math. Soc., 44 (2007), 147-155.
Le Breton, Xavier, Linear independence of automatic formal power series. Discrete Math. 306 (2006), no. 15, 1776-1780.
M. Lothaire, Combinatorics on Words. Addison-Wesley, Reading, MA, 1983, p. 23.
Donald MacMurray, A mathematician gives an hour to chess, Chess Review 6 (No. 10, 1938), 238. [Discusses Marston's 1938 article]
Mauduit, Christian. Multiplicative properties of the Thue-Morse sequence. Period. Math. Hungar. 43 (2001), no. 1-2, 137--153. MR1830572 (2002i:11081)
C. A. Pickover, Wonders of Numbers, Adventures in Mathematics, Mind and Meaning, Chapter 17, 'The Pipes of Papua,' Oxford University Press, Oxford, England, 2000, pages 34-38.
C. A. Pickover, A Passion for Mathematics, Wiley, 2005; see p. 60.
Clifford A. Pickover, The Math Book, From Pythagoras to the 57th Dimension, 250 Milestones in the History of Mathematics, Sterling Publ., NY, 2009, page 316.
Narad Rampersad and Elise Vaslet, "On Highly Repetitive and Power Free Words", Journal of Integer Sequences, Vol. 16 (2013), #13.2.7.
G. Richomme, K. Saari, L. Q. Zamboni, Abelian complexity in minimal subshifts, J. London Math. Soc. 83(1) (2011) 79-95.
Michel Rigo, Formal Languages, Automata and Numeration Systems, 2 vols., Wiley, 2014. Mentions this sequence - see "List of Sequences" in Vol. 2.
M. Rigo, P. Salimov, and E. Vandomme, "Some Properties of Abelian Return Words", Journal of Integer Sequences, Vol. 16 (2013), #13.2.5.
Benoit Rittaud, Elise Janvresse, Emmanuel Lesigne and Jean-Christophe Novelli, Quand les maths se font discrètes, Le Pommier, 2008 (ISBN 978-2-7465-0370-0).
A. Salomaa, Jewels of Formal Language Theory. Computer Science Press, Rockville, MD, 1981, p. 6.
Shallit, J. O. "On Infinite Products Associated with Sums of Digits." J. Number Th. 21, 128-134, 1985.
Ian Stewart, "Feedback", Mathematical Recreations Column, Scientific American, 274 (No. 3, 1996), page 109 [Historical notes on this sequence]
Thomas Stoll, On digital blocks of polynomial values and extractions in the Rudin-Shapiro sequence, RAIRO - Theoretical Informatics and Applications (RAIRO: ITA), EDP Sciences, 2016, 50, pp. 93-99. <hal-01278708>.
A. Thue. Über unendliche Zeichenreihen, Norske Vid. Selsk. Skr. I. Mat. Nat. Kl. Christiania, No. 7 (1906), 1-22.
A. Thue, Über die gegenseitige Lage gleicher Teile gewisser Zeichenreihen, Norske Vid. Selsk. Skr. I. Mat. Nat. Kl. Christiania, 1 (1912), 1-67.
S. Wolfram, A New Kind of Science, Wolfram Media, 2002; p. 890.
LINKS
A. G. M. Ahmed, AA Weaving. In: Proceedings of Bridges 2013: Mathematics, Music, Art, ..., 2013.
A. Aksenov, The Newman phenomenon and Lucas sequence, arXiv preprint arXiv:1108.5352 [math.NT], 2011-2012.
Max A. Alekseyev and N. J. A. Sloane, On Kaprekar's Junction Numbers, arXiv:2112.14365, 2021; Journal of Combinatorics and Number Theory 12:3 (2022), 115-155.
J.-P. Allouche, Series and infinite products related to binary expansions of integers, Behaviour, 4.4 (1992): p. 5.
J.-P. Allouche, Lecture notes on automatic sequences, Krakow October 2013.
J.-P. Allouche, Thue, Combinatorics on words, and conjectures inspired by the Thue-Morse sequence, J. de Théorie des Nombres de Bordeaux, 27, no. 2 (2015), 375-388.
J.-P. Allouche, Andre Arnold, Jean Berstel, Srecko Brlek, William Jockusch, Simon Plouffe and Bruce E. Sagan, A relative of the Thue-Morse sequence, Discrete Math., 139 (1995), 455-461.
Jean-Paul Allouche, Julien Cassaigne, Jeffrey Shallit and Luca Q. Zamboni, A Taxonomy of Morphic Sequences, arXiv preprint arXiv:1711.10807 [cs.FL], Nov 29 2017.
J.-P. Allouche and H. Cohen, Dirichlet Series and Curious Infinite Products, Bull. London Math. Soc. 17, 531-538, 1985.
J.-P. Allouche and M. Mendes France, Automata and Automatic Sequences, in: Axel F. and Gratias D. (eds), Beyond Quasicrystals. Centre de Physique des Houches, vol 3. Springer, Berlin, Heidelberg, pp. 293-367, 1995; DOI https://doi.org/10.1007/978-3-662-03130-8_11.
J.-P. Allouche and M. Mendes France, Automata and Automatic Sequences, in: Axel F. and Gratias D. (eds), Beyond Quasicrystals. Centre de Physique des Houches, vol 3. Springer, Berlin, Heidelberg, pp. 293-367, 1995; DOI https://doi.org/10.1007/978-3-662-03130-8_11. [Local copy]
J.-P. Allouche and Jeffrey Shallit, The Ubiquitous Prouhet-Thue-Morse Sequence, in C. Ding. T. Helleseth and H. Niederreiter, eds., Sequences and Their Applications: Proceedings of SETA '98, Springer-Verlag, 1999, pp. 1-16.
J.-P. Allouche and J. Shallit, The Ring of k-regular Sequences, II, Theoretical Computer Science 307.1 (2003): 3-29. doi:10.1016/S0304-3975(03)00090-2
Jorge Almeida and Ondrej Klíma, Binary patterns in the Prouhet-Thue-Morse sequence, arXiv:1904.07137 [math.CO], 2019.
G. N. Arzhantseva, C. H. Cashen, D. Gruber and D. Hume, Contracting geodesics in infinitely presented graphical small cancellation groups, arXiv preprint arXiv:1602.03767 [math.GR], 2016-2018.
Ricardo Astudillo, On a Class of Thue-Morse Type Sequences, J. Integer Seqs., Vol. 6, 2003.
F. Axel et al., Vibrational modes in a one dimensional "quasi-alloy": the Morse case, J. de Physique, Colloq. C3, Supp. to No. 7, Vol. 47 (Jul 1986), pp. C3-181-C3-186; see Eq. (10).
M. Baake, U. Grimm and J. Nilsson, Scaling of the Thue-Morse diffraction measure, arXiv preprint arXiv:1311.4371 [math-ph], 2013.
Scott Balchin and Dan Rust, Computations for Symbolic Substitutions, Journal of Integer Sequences, Vol. 20 (2017), Article 17.4.1.
Lucilla Baldini and Josef Eschgfäller, Random functions from coupled dynamical systems, arXiv preprint arXiv:1609.01750 [math.CO], 2016. See Example 3.11.
J. Berstel, Axel Thue's papers on repetitions in words: a translation, July 21 1994. Publications du LaCIM, Département de mathématiques et d'informatique 20, Université du Québec à Montréal, 1995, 85 pages. [Cached copy]
J.-F. Bertazzon, Resolution of an integral equation with the Thue-Morse sequence, arXiv:1201.2502v1 [math.CO], Jan 12, 2012.
J. Cooper and A. Dutle, Greedy Galois Games, Amer. Math. Mnthly, 120 (2013), 441-451.
Françoise Dejean, Sur un Théorème de Thue, J. Combinatorial Theory, vol. 13 A, iss. 1 (1972) 90-99.
F. Michel Dekking, Morphisms, Symbolic sequences, and their Standard Forms, arXiv:1509.00260 [math.CO], 2015.
F. M. Dekking, The Thue-Morse Sequence in Base 3/2, J. Int. Seq., Vol. 26 (2023), Article 23.2.3.
A. de Luca and S. Varricchio, Some combinatorial properties of the Thue-Morse sequence and a problem in semigroups, Theoret. Comput. Sci. 63 (1989), 333-348.
E. Deutsch and B. E. Sagan, Congruences for Catalan and Motzkin numbers and related sequences, J. Num. Theory 117 (2006), 191-215.
M. Drmota, C. Mauduit and J. Rivat, The Thue-Morse Sequence Along The Squares is Normal, Abstract, ÖMG-DMV Congress, 2013.
Arthur Dolgopolov, Equitable Sequencing and Allocation Under Uncertainty, Preprint, 2016.
J. Endrullis, D. Hendriks and J. W. Klop, Degrees of streams, Journal of Integers B 11 (2011): 1-40..
A. S. Fraenkel, New games related to old and new sequences, INTEGERS, Electronic J. of Combinatorial Number Theory, Vol. 4, Paper G6, 2004.
Hao Fu and G.-N. Han, Computer assisted proof for Apwenian sequences related to Hankel determinants, arXiv preprint arXiv:1601.04370 [math.NT], 2016.
Maciej Gawro and Maciej Ulas, "On formal inverse of the Prouhet-Thue-Morse sequence." Discrete Mathematics 339.5 (2016): 1459-1470. Also arXiv:1601.04840, 2016.
Daniel Goc, Luke Schaeffer and Jeffrey Shallit, The Subword Complexity of k-Automatic Sequences is k-Synchronized, arXiv 1206.5352 [cs.FL], Jun 28 2012.
G. A. Hedlund, Remarks on the work of Axel Thue on sequences, Nordisk Mat. Tid., 15 (1967), 148-150.
Dimitri Hendriks, Frits G. W. Dannenberg, Jorg Endrullis, Mark Dow and Jan Willem Klop, Arithmetic Self-Similarity of Infinite Sequences, arXiv preprint 1201.3786 [math.CO], 2012.
A. M. Hinz, S. Klavžar, U. Milutinović and C. Petr, The Tower of Hanoi - Myths and Maths, Birkhäuser 2013. See page 79. Website for book
Tanya Khovanova, There are no coincidences, arXiv preprint 1410.2193 [math.CO], 2014.
Clark Kimberling, Intriguing infinite words composed of zeros and ones, Elemente der Mathematik (2021).
Naoki Kobayashi, Kazutaka Matsuda and Ayumi Shinohara, Functional Programs as Compressed Data, Higher-Order and Symbolic Computation, 25, no. 1 (2012): 39-84..
Philip Lafrance, Narad Rampersad and Randy Yee, Some properties of a Rudin-Shapiro-like sequence, arXiv:1408.2277 [math.CO], 2014.
C. Mauduit and J. Rivat, La somme des chiffres des carrés, Acta Mathem. 203 (1) (2009) 107-148.
Harold Marston Morse, Recurrent geodesics on a surface of negative curvature, Trans. Amer. Math. Soc., 22 (1921), 84-100.
F. Mignosi, A. Restivo, and M. Sciortino, Words and forbidden factors, WORDS (Rouen, 1999). Theoret. Comput. Sci. 273 (2002), no. 1-2, 99--117. MR1872445 (2002m:68096).
Marston Morse, A solution of the problem of infinite play in chess, (review), Bull. Amer. Math. Soc., 44 (No. 9, 1938), p. 632. [Mentions an application to chess]
K. Nakano, Shall We Juggle, Coinductively?, in Certified Programs and Proofs, Lecture Notes in Computer Science Volume 7679, 2012, pp. 160-172.
Hieu D. Nguyen, A mixing of Prouhet-Thue-Morse sequences and Rademacher functions, arXiv preprint arXiv:1405.6958 [math.NT], 2014.
Hieu D. Nguyen, A Generalization of the Digital Binomial Theorem , J. Int. Seq. 18 (2015) # 15.5.7.
C. D. Offner, Repetitions of Words and the Thue-Morse sequence. Preprint, no date.
Matt Parker, The Fairest Sharing Sequence Ever, YouTube video, Nov 27 2015
A. Parreau, M. Rigo, E. Rowland and E. Vandomme, A new approach to the 2-regularity of the l-abelian complexity of 2-automatic sequences, arXiv preprint arXiv:1405.3532 [cs.FL], 2014.
C. A. Pickover, "Wonders of Numbers, Adventures in Mathematics, Mind and Meaning," Zentralblatt review
E. Prouhet, Mémoire sur quelques relations entre les puissances des nombres, Comptes Rendus Acad. des Sciences, 33 (No. 8, 1851), p. 225. [Said to implicitly mention this sequence]
Michel Rigo, Relations on words, arXiv preprint arXiv:1602.03364 [cs.FL], 2016.
Luke Schaeffer and Jeffrey Shallit, Closed, Palindromic, Rich, Privileged, Trapezoidal, and Balanced Words in Automatic Sequences, Electronic Journal of Combinatorics 23(1) (2016), #P1.25.
M. R. Schroeder & N. J. A. Sloane, Correspondence, 1991
R. Schroeppel and R. W. Gosper, HACKMEM #122 (1972).
Vladimir Shevelev, Two analogs of Thue-Morse sequence, arXiv preprint arXiv:1603.04434 [math.NT], 2016-2017.
L. Spiegelhofer, Normality of the Thue-Morse Sequence along Piatetski-Shapiro sequences, Quart. J. Math. 66 (3) (2015).
Hassan Tarfaoui, Concours Général 1990 - Exercice 1 (in French).
Eric Weisstein's World of Mathematics, Thue-Morse Sequence
Eric Weisstein's World of Mathematics, Thue-Morse Constant
Eric Weisstein's World of Mathematics, Parity
Joost Winter, Marcello M. Bonsangue, and Jan J. M. M. Rutten, Context-free coalgebras, Journal of Computer and System Sciences, 81.5 (2015): 911-939.
Hans Zantema, Complexity of Automatic Sequences, International Conference on Language and Automata Theory and Applications (LATA 2020): Language and Automata Theory and Applications, 260-271.
FORMULA
a(2n) = a(n), a(2n+1) = 1 - a(n), a(0) = 0. Also, a(k+2^m) = 1 - a(k) if 0 <= k < 2^m.
If n = Sum b_i*2^i is the binary expansion of n then a(n) = Sum b_i (mod 2).
Let S(0) = 0 and for k >= 1, construct S(k) from S(k-1) by mapping 0 -> 01 and 1 -> 10; sequence is S(infinity).
G.f.: (1/(1 - x) - Product_{k >= 0} (1 - x^(2^k)))/2. - Benoit Cloitre, Apr 23 2003
a(0) = 0, a(n) = (n + a(floor(n/2))) mod 2; also a(0) = 0, a(n) = (n - a(floor(n/2))) mod 2. - Benoit Cloitre, Dec 10 2003
a(n) = -1 + (Sum_{k=0..n} binomial(n,k) mod 2) mod 3 = -1 + A001316(n) mod 3. - Benoit Cloitre, May 09 2004
Let b(1) = 1 and b(n) = b(ceiling(n/2)) - b(floor(n/2)) then a(n-1) = (1/2)*(1 - b(2n-1)). - Benoit Cloitre, Apr 26 2005
a(n) = 1 - A010059(n) = A001285(n) - 1. - Ralf Stephan, Jun 20 2003
a(n) = A001969(n) - 2n. - Franklin T. Adams-Watters, Aug 28 2006
a(n) = A115384(n) - A115384(n-1) for n > 0. - Reinhard Zumkeller, Aug 26 2007
For n >= 0, a(A004760(n+1)) = 1 - a(n). - Vladimir Shevelev, Apr 25 2009
a(A160217(n)) = 1 - a(n). - Vladimir Shevelev, May 05 2009
a(n) == A000069(n) (mod 2). - Robert G. Wilson v, Jan 18 2012
a(n) = A000035(A000120(n)). - Omar E. Pol, Oct 26 2013
a(n) = A000035(A193231(n)). - Antti Karttunen, Dec 27 2013
a(n) + A181155(n-1) = 2n for n >= 1. - Clark Kimberling, Oct 06 2014
G.f. A(x) satisfies: A(x) = x / (1 - x^2) + (1 - x) * A(x^2). - Ilya Gutkovskiy, Jul 29 2021
From Bernard Schott, Jan 21 2022: (Start)
a(n) = a(n*2^k) for k >= 0.
a((2^m-1)^2) = (1-(-1)^m)/2 (see Hassan Tarfaoui link, Concours Général 1990). (End)
EXAMPLE
The evolution starting at 0 is:
0
0, 1
0, 1, 1, 0
0, 1, 1, 0, 1, 0, 0, 1
0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0
0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1
.......
A_2 = 0 1 1 0, so B_2 = 1 0 0 1 and A_3 = A_2 B_2 = 0 1 1 0 1 0 0 1.
From Joerg Arndt, Mar 12 2013: (Start)
The first steps of the iterated substitution are
Start: 0
Rules:
0 --> 01
1 --> 10
-------------
0: (#=1)
0
1: (#=2)
01
2: (#=4)
0110
3: (#=8)
01101001
4: (#=16)
0110100110010110
5: (#=32)
01101001100101101001011001101001
6: (#=64)
0110100110010110100101100110100110010110011010010110100110010110
(End)
From Omar E. Pol, Oct 28 2013: (Start)
Written as an irregular triangle in which row lengths is A011782, the sequence begins:
0;
1;
1,0;
1,0,0,1;
1,0,0,1,0,1,1,0;
1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1;
1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0;
It appears that: row j lists the first A011782(j) terms of A010059, with j >= 0; row sums give A166444 which is also 0 together with A011782; right border gives A000035.
(End)
MAPLE
s := proc(k) local i, ans; ans := [ 0, 1 ]; for i from 0 to k do ans := [ op(ans), op(map(n->(n+1) mod 2, ans)) ] od; return ans; end; t1 := s(6); A010060 := n->t1[n]; # s(k) gives first 2^(k+2) terms.
a := proc(k) b := [0]: for n from 1 to k do b := subs({0=[0, 1], 1=[1, 0]}, b) od: b; end; # a(k), after the removal of the brackets, gives the first 2^k terms. # Example: a(3); gives [[[[0, 1], [1, 0]], [[1, 0], [0, 1]]]]
A010060:=proc(n)
add(i, i=convert(n, base, 2)) mod 2 ;
end proc:
seq(A010060(n), n=0..104); # Emeric Deutsch, Mar 19 2005
map(`-`, convert(StringTools[ThueMorse](1000), bytes), 48); # Robert Israel, Sep 22 2014
MATHEMATICA
Table[ If[ OddQ[ Count[ IntegerDigits[n, 2], 1]], 1, 0], {n, 0, 100}];
mt = 0; Do[ mt = ToString[mt] <> ToString[(10^(2^n) - 1)/9 - ToExpression[mt] ], {n, 0, 6} ]; Prepend[ RealDigits[ N[ ToExpression[mt], 2^7] ] [ [1] ], 0]
Mod[ Count[ #, 1 ]& /@Table[ IntegerDigits[ i, 2 ], {i, 0, 2^7 - 1} ], 2 ] (* Harlan J. Brothers, Feb 05 2005 *)
Nest[ Flatten[ # /. {0 -> {0, 1}, 1 -> {1, 0}}] &, {0}, 7] (* Robert G. Wilson v Sep 26 2006 *)
a[n_] := If[n == 0, 0, If[Mod[n, 2] == 0, a[n/2], 1 - a[(n - 1)/2]]] (* Ben Branman, Oct 22 2010 *)
a[n_] := Mod[Length[FixedPointList[BitAnd[#, # - 1] &, n]], 2] (* Jan Mangaldan, Jul 23 2015 *)
Table[2/3 (1 - Cos[Pi/3 (n - Sum[(-1)^Binomial[n, k], {k, 1, n}])]), {n, 0, 100}] (* or, for version 10.2 or higher *) Table[ThueMorse[n], {n, 0, 100}] (* Vladimir Reshetnikov, May 06 2016 *)
ThueMorse[Range[0, 100]] (* The program uses the ThueMorse function from Mathematica version 11 *) (* Harvey P. Dale, Aug 11 2016 *)
Nest[Join[#, 1 - #] &, {0}, 7] (* Paolo Xausa, Oct 25 2024 *)
PROG
(Haskell)
a010060 n = a010060_list !! n
a010060_list =
0 : interleave (complement a010060_list) (tail a010060_list)
where complement = map (1 - )
interleave (x:xs) ys = x : interleave ys xs
-- Doug McIlroy (doug(AT)cs.dartmouth.edu), Jun 29 2003
-- Edited by Reinhard Zumkeller, Oct 03 2012
(PARI) a(n)=if(n<1, 0, sum(k=0, length(binary(n))-1, bittest(n, k))%2)
(PARI) a(n)=if(n<1, 0, subst(Pol(binary(n)), x, 1)%2)
(PARI) default(realprecision, 6100); x=0.0; m=20080; for (n=1, m-1, x=x+x; x=x+sum(k=0, length(binary(n))-1, bittest(n, k))%2); x=2*x/2^m; for (n=0, 20000, d=floor(x); x=(x-d)*2; write("b010060.txt", n, " ", d)); \\ Harry J. Smith, Apr 28 2009
(PARI) a(n)=hammingweight(n)%2 \\ Charles R Greathouse IV, Mar 22 2013
(Python)
A010060_list = [0]
for _ in range(14):
A010060_list += [1-d for d in A010060_list] # Chai Wah Wu, Mar 04 2016
(Python)
def A010060(n): return n.bit_count()&1 # Chai Wah Wu, Mar 01 2023
(R)
maxrow <- 8 # by choice
b01 <- 1
for(m in 0:maxrow) for(k in 0:(2^m-1)){
b01[2^(m+1)+ k] <- b01[2^m+k]
b01[2^(m+1)+2^m+k] <- 1-b01[2^m+k]
}
(b01 <- c(0, b01))
# Yosu Yurramendi, Apr 10 2017
CROSSREFS
Cf. A001285 (for 1, 2 version), A010059 (for 1, 0 version), A106400 (for +1, -1 version), A048707. A010060(n)=A000120(n) mod 2.
Cf. A007413, A080813, A080814, A036581, A108694. See also the Thue (or Roth) constant A014578, also A014571.
Run lengths give A026465. Backward first differences give A029883.
Cf. A004128, A053838, A059448, A171900, A161916, A214212, A005942 (subword complexity), A010693 (Abelian complexity), A225186 (squares), A228039 (a(n^2)), A282317.
Sequences mentioned in the Allouche et al. "Taxonomy" paper, listed by example number: 1: A003849, 2: A010060, 3: A010056, 4: A020985 and A020987, 5: A191818, 6: A316340 and A273129, 18: A316341, 19: A030302, 20: A063438, 21: A316342, 22: A316343, 23: A003849 minus its first term, 24: A316344, 25: A316345 and A316824, 26: A020985 and A020987, 27: A316825, 28: A159689, 29: A049320, 30: A003849, 31: A316826, 32: A316827, 33: A316828, 34: A316344, 35: A043529, 36: A316829, 37: A010060.
KEYWORD
nonn,core,easy,nice
STATUS
approved
A squarefree (or Thue-Morse) ternary sequence: closed under 1->123, 2->13, 3->2. Start with 1.
(Formerly M0406)
+0
25
1, 2, 3, 1, 3, 2, 1, 2, 3, 2, 1, 3, 1, 2, 3, 1, 3, 2, 1, 3, 1, 2, 3, 2, 1, 2, 3, 1, 3, 2, 1, 2, 3, 2, 1, 3, 1, 2, 3, 2, 1, 2, 3, 1, 3, 2, 1, 3, 1, 2, 3, 1, 3, 2, 1, 2, 3, 2, 1, 3, 1, 2, 3, 1, 3, 2, 1, 3, 1, 2, 3, 2, 1, 2, 3, 1, 3, 2, 1, 3, 1, 2, 3, 1, 3, 2, 1, 2, 3, 2, 1, 3, 1, 2, 3, 2, 1, 2, 3, 1, 3, 2, 1, 2, 3
OFFSET
1,2
COMMENTS
a(n)=2 if and only if n-1 is in A079523. - Benoit Cloitre, Mar 10 2003
Partial sums modulo 4 of the sequence 1, a(1), a(1), a(2), a(2), a(3), a(3), a(4), a(4), a(5), a(5), a(6), a(6), ... - Philippe Deléham, Mar 04 2004
To construct the sequence: start with 1 and concatenate 4 -1 = 3: 1, 3, then change the last term (2 -> 1, 3 ->2 ) gives 1, 2. Concatenate 1, 2 with 4 -1 = 3, 4 - 2 = 2: 1, 2, 3, 2 and change the last term: 1, 2, 3, 1. Concatenate 1, 2, 3, 1 with 4 - 1 = 3, 4 - 2 = 2, 4 - 3 = 1, 4 - 1 = 3: 1, 2, 3, 1, 3, 2, 1, 3 and change the last term: 1, 2, 3, 1, 3, 2, 1, 2 etc. - Philippe Deléham, Mar 04 2004
To construct the sequence: start with the Thue-Morse sequence A010060 = 0, 1, 1, 0, 1, 0, 0, 1, ... Then change 0 -> 1, 2, 3, _ and 1 -> 3, 2, 1, _ gives: 1, 2, 3, _, 3, 2, 1, _,3, 2, 1, _, 1, 2, 3, _, 3, 2, 1, _, ... and fill in the successive holes with the successive terms of the sequence itself. - Philippe Deléham, Mar 04 2004
To construct the sequence: to insert the number 2 between the A003156(k)-th term and the (1 + A003156(k))-th term of the sequence 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, ... - Philippe Deléham, Mar 04 2004
Conjecture. The sequence is formed by the numbers of 1's between every pair of consecutive 2's in A076826. - Vladimir Shevelev, May 31 2009
REFERENCES
Michel Rigo, Formal Languages, Automata and Numeration Systems, 2 vols., Wiley, 2014. Mentions this sequence - see "List of Sequences" in Vol. 2.
J. Roberts, Lure of the Integers, Math. Assoc. America, 1992, p. 18.
N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
A. Thue, Über unendliche Zeichenreihen, Norske Vid. Selsk. Skr. I. Mat. Nat. Kl. Christiania, No. 7 (1906), 1-22.
LINKS
James D. Currie, Non-repetitive words: Ages and essences, Combinatorica 16.1 (1996): 19-40. See p. 20.
James D. Currie, Palindrome positions in ternary square-free words, Theoretical Computer Science, 396 (2008) 254-257.
F. Michel Dekking, Morphisms, Symbolic Sequences, and Their Standard Forms, Journal of Integer Sequences, Vol. 19 (2016), Article 16.1.1.
V. Keranen, New Abelian Square-Free DT0L-Languages over 4 Letters, Theoretical Computer Science, Volume 410, Issues 38-40, 6 September 2009, Pages 3893-3900.
S. Kitaev and T. Mansour, Counting the occurrences of generalized patterns in words generated by a morphism, arXiv:math/0210170 [math.CO], 2002.
Andrzej Tomski and Maciej Zakarczemny, A note on Browkin's and Cao's cancellation algorithm, Technical Transections 7/2018.
FORMULA
a(n) modulo 2 = A035263(n). a(A036554(n)) = 2. a(A003159(n)) = 1 if n odd. a(A003159(n)) = 3 if n even. a(n) = A033485(n) mod 4. a(n) = 4 - A036585(n-1). - Philippe Deléham, Mar 04 2004
a(n) = 2 - A029883(n) = 3 - A036577(n). - Philippe Deléham, Mar 20 2004
For n>=1, we have: 1) a(A108269(n))=A010684(n-1); 2) a(A079523(n))=A010684(n-1); 3) a(A081706(2n))=A010684(n). - Vladimir Shevelev, Jun 22 2009
EXAMPLE
Here are the first 5 stages in the construction of this sequence, together with Mma code, taken from Keranen's article. His alphabet is a,b,c rather than 1,2,3.
productions = {"a" -> "abc ", "b" -> "ac ", "c" -> "b ", " " -> ""};
NestList[g, "a", 5] // TableForm
a
abc
abc ac b
abc ac b abc b ac
abc ac b abc b ac abc ac b ac abc b
abc ac b abc b ac abc ac b ac abc b abc ac b abc b ac abc b abc ac b ac
MATHEMATICA
Nest[ Flatten[ # /. {1 -> {1, 2, 3}, 2 -> {1, 3}, 3 -> {2}}] &, {1}, 7] (* Robert G. Wilson v, May 07 2005 *)
2 - Differences[ThueMorse[Range[0, 100]]] (* Paolo Xausa, Oct 25 2024 *)
PROG
(PARI) {a(n) = if( n<1 || valuation(n, 2)%2, 2, 2 + (-1)^subst( Pol(binary(n)), x, 1))};
(Python)
def A007413(n): return 2-(n.bit_count()&1)+((n-1).bit_count()&1) # Chai Wah Wu, Mar 03 2023
CROSSREFS
First differences of A000069.
Equals A036580(n-1) + 1.
KEYWORD
nonn,easy
STATUS
approved
a(n) = a(n-1) + a(floor(n/2)), a(1) = 1.
(Formerly N0236)
+0
36
1, 2, 3, 5, 7, 10, 13, 18, 23, 30, 37, 47, 57, 70, 83, 101, 119, 142, 165, 195, 225, 262, 299, 346, 393, 450, 507, 577, 647, 730, 813, 914, 1015, 1134, 1253, 1395, 1537, 1702, 1867, 2062, 2257, 2482, 2707, 2969, 3231, 3530, 3829, 4175, 4521, 4914, 5307, 5757
OFFSET
1,2
COMMENTS
Sequence gives the number of partitions of 2n into "strongly decreasing" parts (see the function s*(n) in the paper by Bessenrodt, Olsson, and Sellers); see the example in A040039.
a(A036554(n)) is even, a(A003159(n)) is odd. - Benoit Cloitre, Oct 23 2002
Partial sums of the sequence a(1)=1, a(1), a(1), a(2), a(2), a(3), a(3), a(4), a(4), a(5), a(5), a(6), ...; example: a(1) = 1, a(2) = 1+1 = 2, a(3) = 1+1+1 = 3, a(4) = 1+1+1+2 = 5, a(5) = 1+1+1+2+2 = 7, ... - Philippe Deléham, Jan 02 2004
The number of odd numbers before the n-th even number in this sequence is A003156(n). - Philippe Deléham, Mar 27 2004
There are no terms divisible by 4 and there are infinitely many terms divisible by {2,3,5,6,7,9,10,11,13,14,15} (see van Doorn link). - Ivan N. Ianakiev, Aug 06 2022 and Wouter van Doorn, Sep 17 2024
a(n) = A001401(n), for 1..14. A001401(15) = 84. - Wolfdieter Lang, Jan 09 2023
REFERENCES
N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
LINKS
J. Arkin, Problem H-102: Gone but not forgotten, Fibonacci Quarterly, Vol. 9 (1971), page 135.
Christine Bessenrodt, Jorn B. Olsson, and James A. Sellers, Unique path partitions: Characterization and Congruences, arXiv:1107.1156 [math.CO], 2011-2012.
William Gasarch, What is known about that sequence, Computational Complexity blog, Jul 20 2022.
Wouter van Doorn, On the congruence properties and growth rate of a recursively defined sequence, arXiv:2406.09532 [math.NT], 2024.
FORMULA
a(n) = A000123(n)/2, for n >= 1.
Conjecture: lim_{n->oo} a(2n)/a(n)*log(n)/n = c = 1.64.... and a(n)/A(n) is bounded where A(n)=1 if n is a power of 2, otherwise A(n) = sqrt(n)*Product_{k<log_2(n)} n/2^k/log(n/2^k)). - Benoit Cloitre, Jan 26 2003
G.f.: A(x) satisfies x + (1+x)*A(x^2) = (1-x)*A(x). a(n) modulo 2 = A035263(n). - Philippe Deléham, Feb 25 2004
G.f.: (1/2)*(((1-x)*Product_{n>=0} (1-x^(2^n)))^(-1)-1). a(n) modulo 4 = A007413(n). - Philippe Deléham, Feb 28 2004
Sum_{k=1..n} a(k) = (a(2n+1)-1)/2 = A178855(n). - Philippe Deléham, Mar 18 2004
a(2n-1) = A131205(n). - Jean-Paul Allouche, Aug 11 2021
There exists a function f(n) such that n^f(n) < a(n) < n^(f(n) + epsilon) for all epsilon > 0 and all large enough n. - Wouter van Doorn, Sep 17 2024
MAPLE
a:= proc(n) option remember;
`if`(n<2, n, a(n-1)+a(iquo(n, 2)))
end:
seq(a(n), n=1..60); # Alois P. Heinz, Dec 16 2019
MATHEMATICA
b[1]=1; b[n_] := b[n]=Sum[b[k], {k, 1, n/2}]; Table[b[n], {n, 3, 105, 2}] (* Robert G. Wilson v, Apr 22 2001 *)
PROG
(PARI) a(n)=if(n<2, 1, a(floor(n/2))+a(n-1))
(Haskell)
import Data.List (transpose)
a033485 n = a033485_list !! (n-1)
a033485_list = 1 : zipWith (+)
a033485_list (concat $ transpose [a033485_list, a033485_list])
-- Reinhard Zumkeller, Nov 15 2012
(Magma) [n le 1 select 1 else Self(n-1) + Self(Floor(n/2)) : n in [1..60]]; // Vincenzo Librandi, Nov 20 2015
(Python)
from itertools import islice
from collections import deque
def A033485_gen(): # generator of terms
aqueue, f, b, a = deque([2]), True, 1, 2
yield from (1, 2)
while True:
a += b
yield a
aqueue.append(a)
if f: b = aqueue.popleft()
f = not f
A033485_list = list(islice(A033485_gen(), 40)) # Chai Wah Wu, Jun 07 2022
CROSSREFS
Cf. A040039 (first differences), A178855 (partial sums).
Also half of A000123 (with first term omitted).
Cf. A022907.
KEYWORD
nonn,nice,easy
AUTHOR
N. J. A. Sloane. This was in the 1973 "Handbook", but was then dropped from the database. Resubmitted by Philippe Deléham. Entry revised by N. J. A. Sloane, Jun 10 2012
STATUS
approved
a(n) = 3*n^2 + 2*n - 4 * Sum_{k=1..n} A003159(k).
+0
6
1, 0, 1, 4, 5, 4, 1, 0, 1, 0, 1, 4, 5, 8, 13, 16, 17, 16, 17, 20, 21, 20, 17, 16, 17, 16, 13, 8, 5, 4, 1, 0, 1, 0, 1, 4, 5, 4, 1, 0, 1, 0, 1, 4, 5, 8, 13, 16, 17, 16, 17, 20, 21, 24, 29, 32, 37, 44, 49, 52, 53, 56, 61, 64, 65, 64, 65, 68, 69, 68, 65, 64, 65, 64, 65, 68, 69, 72, 77, 80
OFFSET
1,4
COMMENTS
0 <= a(n) <= n for any n.
FORMULA
For any k, a(A062880(k)) = 0; a(A000695(k))=A000695(k)
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Benoit Cloitre, Jun 17 2002
STATUS
approved
Trajectory of 1 under the morphism 0 -> 11, 1 -> 10; parity of 2-adic valuation of 2n: a(n) = A000035(A001511(n)).
+0
83
1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1
OFFSET
1,1
COMMENTS
First Feigenbaum symbolic (or period-doubling) sequence, corresponding to the accumulation point of the 2^{k} cycles through successive bifurcations.
To construct the sequence: start with 1 and concatenate: 1,1, then change the last term (1->0; 0->1) gives: 1,0. Concatenate those 2 terms: 1,0,1,0, change the last term: 1,0,1,1. Concatenate those 4 terms: 1,0,1,1,1,0,1,1 change the last term: 1,0,1,1,1,0,1,0, etc. - Benoit Cloitre, Dec 17 2002
Let T denote the present sequence. Here is another way to construct T. Start with the sequence S = 1,0,1,_,1,0,1,_,1,0,1,_,1,0,1,_,... and fill in the successive holes with the successive terms of the sequence T (from paper by Allouche et al.). - Emeric Deutsch, Jan 08 2003 [Note that if we fill in the holes with the terms of S itself, we get A141260. - N. J. A. Sloane, Jan 14 2009]
From N. J. A. Sloane, Feb 27 2009: (Start)
In more detail: define S to be 1, 0, 1___1, 0, 1___1, 0, 1___1, 0, 1___1, 0, 1___1,0,1___...
If we fill the holes with S we get A141260:
1, 0, 1___1, 0, 1___1, 0, 1___1, 0, 1___1, 0, 1___1, 0, 1___1, 0, 1___1, 0, 1___1, 0,
........1.........0.........1.........1.........0.......1.........1.........0...
- the result is
1..0..1.1.1..0..1.0.1..0..1.1.1..0..1.1.1..0..1.0.1.... = A141260.
But instead, if we define T recursively by filling the holes in S with the terms of T itself, we get A035263:
1, 0, 1___1, 0, 1___1, 0, 1___1, 0, 1___1, 0, 1___1, 0, 1___1, 0, 1___1, 0, 1___1, 0,
........1.........0.........1.........1.........1.......0.........1.........0...
- the result is
1..0..1.1.1..0..1.0.1..0..1.1.1..0..1.1.1..0..1.1.1.0.1.0.1..0..1.1.1..0..1.0.1.. = A035263. (End)
Characteristic function of A003159, i.e., A035263(n)=1 if n is in A003159 and A035263(n)=0 otherwise (from paper by Allouche et al.). - Emeric Deutsch, Jan 15 2003
This is the sequence of R (=1), L (=0) moves in the Towers of Hanoi puzzle: R, L, R, R, R, L, R, L, R, L, R, R, R, ... - Gary W. Adamson, Sep 21 2003
Manfred Schroeder, p. 279 states, "... the kneading sequences for unimodal maps in the binary notation, 0, 1, 0, 1, 1, 1, 0, 1..., are obtained from the Morse-Thue sequence by taking sums mod 2 of adjacent elements." On p. 278, in the chapter "Self-Similarity in the Logistic Parabola", he writes, "Is there a closer connection between the Morse-Thue sequence and the symbolic dynamics of the superstable orbits? There is indeed. To see this, let us replace R by 1 and C and L by 0." - Gary W. Adamson, Sep 21 2003
Partial sums modulo 2 of the sequence 1, a(1), a(1), a(2), a(2), a(3), a(3), a(4), a(4), a(5), a(5), a(6), a(6), ... . - Philippe Deléham, Jan 02 2004
Parity of A007913, A065882 and A065883. - Philippe Deléham, Mar 28 2004
The length of n-th run of 1's in this sequence is A080426(n). - Philippe Deléham, Apr 19 2004
Also parity of A005043, A005773, A026378, A104455, A117641. - Philippe Deléham, Apr 28 2007
Equals parity of the Towers of Hanoi, or ruler sequence (A001511), where the Towers of Hanoi sequence (1, 2, 1, 3, 1, 2, 1, 4, ...) denotes the disc moved, labeled (1, 2, 3, ...) starting from the top; and the parity of (1, 2, 1, 3, ...) denotes the direction of the move, CW or CCW. The frequency of CW moves converges to 2/3. - Gary W. Adamson, May 11 2007
A conjectured identity relating to the partition sequence, A000041: p(x) = A(x) * A(x^2) when A(x) = the Euler transform of A035263 = polcoeff A174065: (1 + x + x^2 + 2x^3 + 3x^4 + 4x^5 + ...). - Gary W. Adamson, Mar 21 2010
a(n) is 1 if the number of trailing zeros in the binary representation of n is even. - Ralf Stephan, Aug 22 2013
From Gary W. Adamson, Mar 25 2015: (Start)
A conjectured identity relating to the partition sequence, A000041 as polcoeff p(x); A003159, and its characteristic function A035263: (1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, ...); and A036554 indicating n-th terms with zeros in A035263: (2, 6, 8, 10, 14, 18, 22, ...).
The conjecture states that p(x) = A(x) = A(x^2) when A(x) = polcoeffA174065 = the Euler transform of A035263 = 1/(1-x)*(1-x^3)*(1-x^4)*(1-x^5)*... = (1 + x + x^2 + 2x^3 + 3x^4 + 4x^5 + ...) and the aerated variant = the Euler transform of the complement of A035263: 1/(1-x^2)*(1-x^6)*(1-x^8)*... = (1 + x^2 + x^4 + 2x^6 + 3x^8 + 4x^10 + ...).
(End)
The conjecture above was proved by Jean-Paul Allouche on Dec 21 2013.
Regarded as a column vector, this sequence is the product of A047999 (Sierpinski's gasket) regarded as an infinite lower triangular matrix and A036497 (the Fredholm-Rueppel sequence) where the 1's have alternating signs, 1, -1, 0, 1, 0, 0, 0, -1, .... - Gary W. Adamson, Jun 02 2021
The numbers of 1's through n (A050292) can be determined by starting with the binary (say for 19 = 1 0 0 1 1) and writing: next term is twice current term if 0, otherwise twice plus 1. The result is 1, 2, 4, 9, 19. Take the difference row, = 1, 1, 2, 5, 10; and add the odd-indexed terms from the right: 5, 4, 3, 2, 1 = 10 + 2 + 1 = 13. The algorithm is the basis for determining the disc configurations in the tower of Hanoi game, as shown in the Jul 24 2021 comment of A060572. - Gary W. Adamson, Jul 28 2021
REFERENCES
Karamanos, Kostas. "From symbolic dynamics to a digital approach." International Journal of Bifurcation and Chaos 11.06 (2001): 1683-1694. (Full version. See p. 1685)
Karamanos, K. (2000). From symbolic dynamics to a digital approach: chaos and transcendence. In Michel Planat (Ed.), Noise, Oscillators and Algebraic Randomness (Lecture Notes in Physics, pp. 357-371). Springer, Berlin, Heidelberg. (Short version. See p. 359)
Manfred R. Schroeder, "Fractals, Chaos, Power Laws", W. H. Freeman, 1991
S. Wolfram, A New Kind of Science, Wolfram Media, 2002; p. 892, column 2, Note on p. 84, part (a).
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..65536 (first 10000 terms from T. D. Noe)
Ricardo Gómez Aíza, Symbolic dynamical scales: modes, orbitals, and transversals, arXiv:2009.02669 [math.DS], 2020.
J.-P. Allouche, Andre Arnold, Jean Berstel, Srecko Brlek, William Jockusch, Simon Plouffe and Bruce E. Sagan, A sequence related to that of Thue-Morse, Discrete Math., 139 (1995), 455-461.
J.-P. Allouche and M. Mendes France, Automata and Automatic Sequences, in: Axel F. and Gratias D. (eds), Beyond Quasicrystals. Centre de Physique des Houches, vol 3. Springer, Berlin, Heidelberg, pp. 293-367, 1995; DOI https://doi.org/10.1007/978-3-662-03130-8_11.
J.-P. Allouche and M. Mendes France, Automata and Automatic Sequences, in: Axel F. and Gratias D. (eds), Beyond Quasicrystals. Centre de Physique des Houches, vol 3. Springer, Berlin, Heidelberg, pp. 293-367, 1995; DOI https://doi.org/10.1007/978-3-662-03130-8_11. [Local copy]
J.-P. Allouche and Jeffrey Shallit, The Ubiquitous Prouhet-Thue-Morse Sequence, in C. Ding. T. Helleseth and H. Niederreiter, eds., Sequences and Their Applications: Proceedings of SETA '98, Springer-Verlag, 1999, pp. 1-16.
Joerg Arndt, Matters Computational (The Fxtbook), pp.9-10, pp.734-738
Scott Balchin and Dan Rust, Computations for Symbolic Substitutions, Journal of Integer Sequences, Vol. 20 (2017), Article 17.4.1.
F. Michel Dekking, Morphisms, Symbolic Sequences, and Their Standard Forms, Journal of Integer Sequences, Vol. 19 (2016), Article 16.1.1.
B. Derrida, A. Gervois and Y. Pomeau, Iteration of endomorphisms on the real axis and representation of number, Ann. Inst. Henri Poincaré, Section A: Physique Théorique, Vol. XXIX no. 3, 305-356 (1978).
Emeric Deutsch and Bruce E. Sagan, Congruences for Catalan and Motzkin numbers and related sequences, arXiv:math/0407326 [math.CO], 2004.
Emeric Deutsch and Bruce E. Sagan, Congruences for Catalan and Motzkin numbers and related sequences, J. Num. Theory 117 (2006), 191-215.
A. M. Hinz, S. Klavžar, U. Milutinović, and C. Petr, The Tower of Hanoi - Myths and Maths, Birkhäuser 2013. See page 79. Book's website
Hsien-Kuei Hwang, S. Janson, and T.-H. Tsai, Exact and Asymptotic Solutions of a Divide-and-Conquer Recurrence Dividing at Half: Theory and Applications, ACM Transactions on Algorithms, 13:4 (2017), #47; DOI: 10.1145/3127585.
K. Karamanos, Symbolic Dynamics to a Digital Approach, Int. J. of Bifurcation and Chaos, 11(6), 1683-1694 (2001).
K. Karamanos and G. Nicolis, Symbolic Dynamics and Entropy Analysis of Feigenbaum Limit Sets, Chaos, Solitons and Fractals 10(7), 1135 - 1150 (1999).
D. Kohel, S. Ling and C. Xing, Explicit Sequence Expansions
Joseph Meleshko, Pascal Ochem, Jeffrey Shallit, and Sonja Linghui Shan, Pseudoperiodic Words and a Question of Shevelev, arXiv:2207.10171 [math.CO], 2022.
N. Metropolis, M. L. Stein and P. R. Stein, On finite limit sets for transformations on the unit interval, J. Combin. Theory, A 15 (1973), 25-44.
Jeffrey Shallit and Anatoly Zavyalov, Transduction of Automatic Sequences and Applications, arXiv:2303.15203 [cs.FL], 2023, see p. 5.
Ralf Stephan, Divide-and-conquer generating functions. I. Elementary sequences, arXiv:math/0307027 [math.CO], 2003.
Eric Weisstein's World of Mathematics, Binary carry sequence.
Eric Weisstein's World of Mathematics, Double-free set.
FORMULA
Absolute values of first differences (A029883) of Thue-Morse sequence (A001285 or A010060). Self-similar under 10->1 and 11->0.
Series expansion: (1/x) * Sum_{i>=0} (-1)^(i+1)*x^(2^i)/(x^(2^i)-1). - Antonio G. Astudillo (afg_astudillo(AT)hotmail.com), Feb 17 2003
a(n) = Sum_{k>=0} (-1)^k*(floor((n+1)/2^k)-floor(n/2^k)). - Benoit Cloitre, Jun 03 2003
Another g.f.: Sum_{k>=0} x^(2^k)/(1+(-1)^k*x^(2^k)). - Ralf Stephan, Jun 13 2003
a(2*n) = 1-a(n), a(2*n+1) = 1. - Ralf Stephan, Jun 13 2003
a(n) = parity of A033485(n). - Philippe Deléham, Aug 13 2003
Equals A088172 mod 2, where A088172 = 1, 2, 3, 7, 13, 26, 53, 106, 211, 422, 845, ... (first differences of A019300). - Gary W. Adamson, Sep 21 2003
a(n) = a(n-1) - (-1)^n*a(floor(n/2)). - Benoit Cloitre, Dec 02 2003
a(1) = 1 and a(n) = abs(a(n-1) - a(floor(n/2))). - Benoit Cloitre, Dec 02 2003
a(n) = 1 - A096268(n+1); A050292 gives partial sums. - Reinhard Zumkeller, Aug 16 2006
Multiplicative with a(2^k) = 1 - (k mod 2), a(p^k) = 1, p > 2. Dirichlet g.f.: Product_{n = 4 or an odd prime} (1/(1-1/n^s)). - Christian G. Bower, May 18 2005
a(-n) = a(n). a(0)=0. - Michael Somos, Sep 04 2006
Dirichlet g.f.: zeta(s)*2^s/(2^s+1). - Ralf Stephan, Jun 17 2007
a(n+1) = a(n) XOR a(ceiling(n/2)), a(1) = 1. - Reinhard Zumkeller, Jun 11 2009
Let D(x) be the generating function, then D(x) + D(x^2) == x/(1-x). - Joerg Arndt, May 11 2010
a(n) = A010060(n) XOR A010060(n+1); a(A079523(n)) = 0; a(A121539(n)) = 1. - Reinhard Zumkeller, Mar 01 2012
a((2*n-1)*2^p) = (p+1) mod 2, p >= 0 and n >= 1. - Johannes W. Meijer, Feb 07 2013
a(n) = A000035(A001511(n)). - Omar E. Pol, Oct 29 2013
a(n) = 2-A056832(n) = (5-A089608(n))/4. - Antti Karttunen, Sep 11 2017, after Benoit Cloitre
For n >= 0, a(n+1) = M(2n) mod 2 where M(n) is the Motzkin number A001006 (see Deutsch and Sagan 2006 link). - David Callan, Oct 02 2018
a(n) = A038712(n) mod 3. - Kevin Ryde, Jul 11 2019
Given any n in the form (k * 2^m, k odd), extract k and m. Categorize the results into two outcomes of (k, m, even or odd). If (k, m) is (odd, even) substitute 1. If (odd, odd), denote the result 0. Example: 5 = (5 * 2^0), (odd, even, = 1). (6 = 3 * 2^1), (odd, odd, = 0). - Gary W. Adamson, Jun 23 2021
MAPLE
nmax:=105: for p from 0 to ceil(simplify(log[2](nmax))) do for n from 1 to ceil(nmax/(p+2)) do a((2*n-1)*2^p) := (p+1) mod 2 od: od: seq(a(n), n=1..nmax); # Johannes W. Meijer, Feb 07 2013
A035263 := n -> 1 - padic[ordp](n, 2) mod 2:
seq(A035263(n), n=1..105); # Peter Luschny, Oct 02 2018
MATHEMATICA
a[n_] := a[n] = If[ EvenQ[n], 1 - a[n/2], 1]; Table[ a[n], {n, 1, 105}] (* Or *)
Rest[ CoefficientList[ Series[ Sum[ x^(2^k)/(1 + (-1)^k*x^(2^k)), {k, 0, 20}], {x, 0, 105}], x]]
f[1] := True; f[x_] := Xor[f[x - 1], f[Floor[x/2]]]; a[x_] := Boole[f[x]] (* Ben Branman, Oct 04 2010 *)
a[n_] := If[n == 0, 0, 1 - Mod[ IntegerExponent[n, 2], 2]]; (* Jean-François Alcover, Jul 19 2013, after Michael Somos *)
Nest[ Flatten[# /. {0 -> {1, 1}, 1 -> {1, 0}}] &, {0}, 7] (* Robert G. Wilson v, Jul 23 2014 *)
SubstitutionSystem[{0->{1, 1}, 1->{1, 0}}, 1, {7}][[1]] (* Harvey P. Dale, Jun 06 2022 *)
PROG
(PARI) {a(n) = if( n==0, 0, 1 - valuation(n, 2)%2)}; /* Michael Somos, Sep 04 2006 */
(PARI) {a(n) = if( n==0, 0, n = abs(n); subst( Pol(binary(n)) - Pol(binary(n-1)), x, 1)%2)}; /* Michael Somos, Sep 04 2006 */
(PARI) {a(n) = if( n==0, 0, n = abs(n); direuler(p=2, n, 1 / (1 - X^((p<3) + 1)))[n])}; /* Michael Somos, Sep 04 2006 */
(Haskell)
import Data.Bits (xor)
a035263 n = a035263_list !! (n-1)
a035263_list = zipWith xor a010060_list $ tail a010060_list
-- Reinhard Zumkeller, Mar 01 2012
(Scheme) (define (A035263 n) (let loop ((n n) (i 1)) (cond ((odd? n) (modulo i 2)) (else (loop (/ n 2) (+ 1 i)))))) ;; (Use mod instead of modulo in R6RS) Antti Karttunen, Sep 11 2017
(Python)
def A035263(n): return (n&-n).bit_length()&1 # Chai Wah Wu, Jan 09 2023
CROSSREFS
Parity of A001511. Anti-parity of A007814.
Absolute values of first differences of A010060. Apart from signs, same as A029883. Essentially the same as A056832.
Swapping 0 and 1 gives A096268.
Cf. A033485, A050292 (partial sums), A089608, A088172, A019300, A039982, A073675, A121701, A141260, A000041, A174065, A220466, A154269 (Mobius transform).
Limit of A317957(n) for large n.
KEYWORD
nonn,easy,nice,mult
EXTENSIONS
Alternative description added to the name by Antti Karttunen, Sep 11 2017
STATUS
approved
Squarefree part of n: a(n) is the smallest positive number m such that n/m is a square.
+0
298
1, 2, 3, 1, 5, 6, 7, 2, 1, 10, 11, 3, 13, 14, 15, 1, 17, 2, 19, 5, 21, 22, 23, 6, 1, 26, 3, 7, 29, 30, 31, 2, 33, 34, 35, 1, 37, 38, 39, 10, 41, 42, 43, 11, 5, 46, 47, 3, 1, 2, 51, 13, 53, 6, 55, 14, 57, 58, 59, 15, 61, 62, 7, 1, 65, 66, 67, 17, 69, 70, 71, 2, 73, 74, 3, 19, 77
OFFSET
1,2
COMMENTS
Also called core(n). [Not to be confused with the squarefree kernel of n, A007947.]
Sequence read mod 4 gives A065882. - Philippe Deléham, Mar 28 2004
This is an arithmetic function and is undefined if n <= 0.
A note on square roots of numbers: we can write sqrt(n) = b*sqrt(c) where c is squarefree. Then b = A000188(n) is the "inner square root" of n, c = A007913(n), lcm(A007947(b),c) = A007947(n) = "squarefree kernel" of n and bc = A019554(n) = "outer square root" of n. [Corrected by M. F. Hasler, Mar 01 2018]
If n > 1, the quantity f(n) = log(n/core(n))/log(n) satisfies 0 <= f(n) <= 1; f(n) = 0 when n is squarefree and f(n) = 1 when n is a perfect square. One can define n as being "epsilon-almost squarefree" if f(n) < epsilon. - Kurt Foster (drsardonicus(AT)earthlink.net), Jun 28 2008
a(n) is the smallest natural number m such that product of geometric mean of the divisors of n and geometric mean of the divisors of m are integers. Geometric mean of the divisors of number n is real number b(n) = Sqrt(n). a(n) = 1 for infinitely many n. a(n) = 1 for numbers from A000290: a(A000290(n)) = 1. For n = 8; b(8) = sqrt(8), a(n) = 2 because b(2) = sqrt(2); sqrt(8) * sqrt(2) = 4 (integer). - Jaroslav Krizek, Apr 26 2010
Dirichlet convolution of A010052 with the sequence of absolute values of A055615. - R. J. Mathar, Feb 11 2011
Booker, Hiary, & Keating outline a method for bounding (on the GRH) a(n) for large n using L-functions. - Charles R Greathouse IV, Feb 01 2013
According to the formula a(n) = n/A000188(n)^2, the scatterplot exhibits the straight lines y=x, y=x/4, y=x/9, ..., i.e., y=x/k^2 for all k=1,2,3,... - M. F. Hasler, May 08 2014
The Dirichlet inverse of this sequence is A008836(n) * A063659(n). - Álvar Ibeas, Mar 19 2015
a(n) = 1 if n is a square, a(n) = n if n is a product of distinct primes. - Zak Seidov, Jan 30 2016
All solutions of the Diophantine equation n*x=y^2 or, equivalently, G(n,x)=y, with G being the geometric mean, are of the form x=k^2*a(n), y=k*sqrt(n*a(n)), where k is a positive integer. - Stanislav Sykora, Feb 03 2016
If f is a multiplicative function then Sum_{d divides n} f(a(d)) is also multiplicative. For example, A010052(n) = Sum_{d divides n} mu(a(d)) and A046951(n) = Sum_{d divides n} mu(a(d)^2). - Peter Bala, Jan 24 2024
LINKS
Daniel Forgues, Table of n, a(n) for n = 1..100000 (first 1000 terms from T. D. Noe)
Krassimir T. Atanassov, On Some of Smarandache's Problems.
Krassimir T. Atanassov, On the 22nd, 23rd, and the 24th Smarandache Problems, Notes on Number Theory and Discrete Mathematics, Sophia, Bulgaria, Vol. 5 (1999), No. 2, 80-82.
Andrew Booker, Ghaith Hiary, and Jon Keating, Detecting squarefree numbers, CNTA XII (2012).
John M. Campbell, An Integral Representation of Kekulé Numbers, and Double Integrals Related to Smarandache Sequences, arXiv preprint arXiv:1105.3399 [math.GM], 2011.
Vlad Copil and Laurenţiu Panaitopol, Properties of a sequence generated by positive integers, Bulletin mathématique de la Société des Sciences Mathématiques de Roumanie, Nouvelle Série, Vol. 50 (98), No. 2 (2007), pp. 131-137; alternative link.
Florentin Smarandache, Only Problems, Not Solutions!, Xiquan Publ., Phoenix-Chicago, 1993.
Eric Weisstein's World of Mathematics, Squarefree Part.
FORMULA
Multiplicative with a(p^k) = p^(k mod 2). - David W. Wilson, Aug 01 2001
a(n) modulo 2 = A035263(n); a(A036554(n)) is even; a(A003159(n)) is odd. - Philippe Deléham, Mar 28 2004
Dirichlet g.f.: zeta(2s)*zeta(s-1)/zeta(2s-2). - R. J. Mathar, Feb 11 2011
a(n) = n/( Sum_{k=1..n} floor(k^2/n)-floor((k^2 -1)/n) )^2. - Anthony Browne, Jun 06 2016
a(n) = rad(n)/a(n/rad(n)), where rad = A007947. This recurrence relation together with a(1) = 1 generate the sequence. - Velin Yanev, Sep 19 2017
From Peter Munn, Nov 18 2019: (Start)
a(k*m) = A059897(a(k), a(m)).
a(n) = n / A008833(n).
(End)
a(A225546(n)) = A225546(A006519(n)). - Peter Munn, Jan 04 2020
From Amiram Eldar, Mar 14 2021: (Start)
Theorems proven by Copil and Panaitopol (2007):
Lim sup_{n->oo} a(n+1)-a(n) = oo.
Lim inf_{n->oo} a(n+1)-a(n) = -oo.
Sum_{k=1..n} 1/a(k) ~ c*sqrt(n) + O(log(n)), where c = zeta(3/2)/zeta(3) (A090699). (End)
a(n) = A019554(n)^2/n. - Jianing Song, May 08 2022
Sum_{k=1..n} a(k) ~ c * n^2, where c = Pi^2/30 = 0.328986... . - Amiram Eldar, Oct 25 2022
a(n) = A007947(A350389(n)). - Amiram Eldar, Jan 20 2024
MAPLE
A007913 := proc(n) local f, a, d; f := ifactors(n)[2] ; a := 1 ; for d in f do if type(op(2, d), 'odd') then a := a*op(1, d) ; end if; end do: a; end proc: # R. J. Mathar, Mar 18 2011
# second Maple program:
a:= n-> mul(i[1]^irem(i[2], 2), i=ifactors(n)[2]):
seq(a(n), n=1..100); # Alois P. Heinz, Jul 20 2015
seq(n / expand(numtheory:-nthpow(n, 2)), n=1..77); # Peter Luschny, Jul 12 2022
MATHEMATICA
data = Table[Sqrt[n], {n, 1, 100}]; sp = data /. Sqrt[_] -> 1; sfp = data/sp /. Sqrt[x_] -> x (* Artur Jasinski, Nov 03 2008 *)
Table[Times@@Power@@@({#[[1]], Mod[ #[[2]], 2]}&/@FactorInteger[n]), {n, 100}] (* Zak Seidov, Apr 08 2009 *)
Table[{p, e} = Transpose[FactorInteger[n]]; Times @@ (p^Mod[e, 2]), {n, 100}] (* T. D. Noe, May 20 2013 *)
Sqrt[#] /. (c_:1)*a_^(b_:0) -> (c*a^b)^2& /@ Range@100 (* Bill Gosper, Jul 18 2015 *)
PROG
(Magma) [ Squarefree(n) : n in [1..256] ]; // N. J. A. Sloane, Dec 23 2006
(PARI) a(n)=core(n)
(Haskell)
a007913 n = product $
zipWith (^) (a027748_row n) (map (`mod` 2) $ a124010_row n)
-- Reinhard Zumkeller, Jul 06 2012
(Python)
from sympy import factorint, prod
def A007913(n):
return prod(p for p, e in factorint(n).items() if e % 2)
# Chai Wah Wu, Feb 03 2015
(Sage)
[squarefree_part(n) for n in (1..77)] # Peter Luschny, Feb 04 2015
CROSSREFS
See A000188, A007947, A008833, A019554, A117811 for related information, specific to n.
See A027746, A027748, A124010 for factorization data for n.
Analogous sequences: A050985, A053165, A055231.
Cf. A002734, A005117 (range of values), A059897, A069891 (partial sums), A090699, A350389.
Related to A006519 via A225546.
KEYWORD
nonn,easy,mult,nice
AUTHOR
R. Muller, Mar 15 1996
EXTENSIONS
More terms from Michael Somos, Nov 24 2001
Definition reformulated by Daniel Forgues, Mar 24 2009
STATUS
approved
Numbers k for which k' / gcd(k,k') is even, where k' stands for the arithmetic derivative of k, A003415.
+0
23
1, 9, 12, 15, 16, 20, 21, 25, 28, 33, 35, 39, 44, 49, 51, 52, 55, 57, 65, 68, 69, 76, 77, 81, 85, 87, 91, 92, 93, 95, 108, 111, 115, 116, 119, 121, 123, 124, 129, 133, 135, 141, 143, 144, 145, 148, 155, 159, 161, 164, 169, 172, 177, 180, 183, 185, 187, 188, 189, 192, 201, 203, 205, 209, 212, 213, 215, 217, 219, 221
OFFSET
1,2
COMMENTS
From Antti Karttunen, Feb 09 2024: (Start)
Numbers k for which A276085(k) is a multiple of four.
Even terms in this sequence are all multiples of four.
A multiplicative semigroup; if m and n are in the sequence then so is m*n.
(End)
Appears to be products of an even number of terms from {4} U A065091 (counting repetitions). - Peter Munn, Jul 15 2024
LINKS
FORMULA
For all n >= 1, A235127(a(n)) == A087436(a(n)) (mod 2). - Antti Karttunen, Feb 09 2024
PROG
(PARI) \\ See A369001
CROSSREFS
Cf. A003415, A083345, A087436, A235127, A276085, A369001 (characteristic function), A369003 (complement).
Positions of even terms in A083345.
Subsequence of A368998, which is a subsequence of A235992.
Setwise difference A003159 \ A373142.
Disjoint union of A369005 and A373265.
Disjoint union of A373138 and A373267.
Disjoint union of A369976 and A369977.
Other subsequences: A046337 (odd terms in this sequence), A373259.
KEYWORD
nonn
AUTHOR
Antti Karttunen, Jan 14 2024
STATUS
approved
a(0)=0, a(1)=1, a(n)=((2*n-1)*a(n-1)-5*n*a(n-2))/(n-1).
+0
5
0, 1, 3, 0, -20, -45, 21, 308, 540, -585, -4235, -5676, 11232, 54145, 51975, -182400, -654160, -380205, 2680425, 7516400, 1320900, -36753255, -82175665, 24032700, 477852900, 850446025, -749925189, -5944471092, -8220606800, 14049061455, 71102953305, 71989187536, -220682377872
OFFSET
0,3
COMMENTS
n divides a(n) iff the binary representation of n ends with an even number of zeros (i.e. n is in A003159)
LINKS
FORMULA
log(abs(a(n))) is asymptotic to c*n where c=0.80... [c = log(5)/2 = 0.8047189562... - Vaclav Kotesovec, Feb 15 2019]
a(n) ~ sqrt(n) * 5^(n/2) / sqrt(8*Pi) * ((sqrt(2 + sqrt(5)) + sqrt(38 + 25*sqrt(5)) / (16*n)) * sin(n*arctan(2)) - (sqrt(-2 + sqrt(5)) - sqrt(-38 + 25*sqrt(5)) / (16*n)) * cos(n*arctan(2))). - Vaclav Kotesovec, Feb 15 2019
From Seiichi Manyama, Jul 09 2024: (Start)
G.f.: x/(1 - 2*x + 5*x^2)^(3/2).
a(n+1) = binomial(n+2,2) * A343773(n). (End)
MATHEMATICA
RecurrenceTable[{-5 n a[n-2] + (2*n - 1) a[n-1] + (1 - n) a[n] ==
0, a[0] == 0, a[1] == 1}, a, {n, 0, 30}] (* Vaclav Kotesovec, Feb 15 2019 *)
nxt[{n_, a_, b_}]:={n+1, b, (b(2n+1)-5a(n+1))/n}; NestList[nxt, {1, 0, 1}, 40][[;; , 2]] (* Harvey P. Dale, Apr 22 2024 *)
PROG
(PARI) a(n)=if(n<2, if(n, 1, 0), 1/(n-1)*((2*n-1)*a(n-1)-5*n*a(n-2)))
CROSSREFS
KEYWORD
sign
AUTHOR
Benoit Cloitre, Feb 27 2005
STATUS
approved

Search completed in 0.120 seconds