A006694 Number of cyclotomic cosets of 2 mod 2n+1.
0, 1, 1, 2, 2, 1, 1, 4, 2, 1, 5, 2, 2, 3, 1, 6, 4, 5, 1, 4, 2, 3, 7, 2, 4, 7, 1, 4, 4, 1, 1, 12, 6, 1, 5, 2, 8, 7, 5, 2, 4, 1, 11, 4, 8, 9, 13, 4, 2, 7, 1, 2, 14, 1, 3, 4, 4, 5, 11, 8, 2, 7, 3, 18, 10, 1, 9, 10, 2, 1, 5, 4, 6, 9, 1, 10, 12, 13, 3, 4, 8, 1, 13, 2, 2, 11, 1, 8, 4, 1, 1, 4, 6, 7, 19, 2, 2, 19, 1, 2
Offset: 0
Examples
Mod 15 there are 4 cosets: {1, 2, 4, 8}, {3, 6, 12, 9}, {5, 10}, {7, 14, 13, 11}, so a(7) = 4. Mod 13 there is only one coset: {1, 2, 4, 8, 3, 6, 12, 11, 9, 5, 10, 7}, so a(6) = 1.
References
- Donald E. Knuth, The Art of Computer Programming, Vol. 1, 3rd edition, Addison-Wesley, 1997.
- F. J. MacWilliams and N. J. A. Sloane, The Theory of Error-Correcting Codes, Elsevier/North Holland, 1977, pp. 104-105.
- N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
Links
- Ray Chandler, Table of n, a(n) for n = 0..10000
- Christopher Adler and Jean-Paul Allouche, Finite self-similar sequences, permutation cycles, and music composition, Journal of Mathematics and the Arts, 16:3, 244-261, (2022).
- J.-P. Allouche, Suites infinies à répétitions bornées, Séminaire de Théorie des Nombres de Bordeaux, 20 (13 April, 1984), 1-11.
- J.-P. Allouche, Suites infinies à répétitions bornées, Séminaire de Théorie des Nombres de Bordeaux, 20 (13 April, 1984), 1-11.
- Jean-Paul Allouche, Manon Stipulanti, and Jia-Yan Yao, Doubling modulo odd integers, generalizations, and unexpected occurrences, arXiv:2504.17564 [math.NT], 2025.
- Michael Assis, Folding Pi, arXiv:2403.09277 [math.NT], 2024.
Crossrefs
Programs
-
Maple
with(group); with(numtheory); gen_rss_perm := proc(n) local a, i; a := []; for i from 1 to n do a := [op(a), ((2*i) mod (n+1))]; od; RETURN(a); end; count_of_disjcyc_seq := [seq(nops(convert(gen_rss_perm(2*j),'disjcyc')),j=0..)];
-
Mathematica
Needs["Combinatorica`"]; f[n_] := Length[ToCycles[Mod[2Range[2n], 2n + 1]]]; Table[f[n], {n, 0, 100}] (* Ray Chandler, Apr 25 2008 *) f[n_] := Length[FactorList[x^(2n + 1) - 1, Modulus -> 2]] - 2; Table[f[n], {n, 0, 100}] (* Ray Chandler, Apr 25 2008 *) a[n_] := Sum[ EulerPhi[d] / MultiplicativeOrder[2, d], {d, Divisors[2n + 1]}] - 1; Table[a[n], {n, 0, 99}] (* Jean-François Alcover, Dec 14 2011, after Joerg Arndt *)
-
PARI
a(n)=sumdiv(2*n+1, d, eulerphi(d)/znorder(Mod(2, d))) - 1; /* cf. A081844 */ vector(122, n, a(n-1)) \\ Joerg Arndt, Jan 18 2011
-
Python
from sympy import totient, n_order, divisors def A006694(n): return sum(totient(d)//n_order(2,d) for d in divisors((n+1<<1)-1,generator=True) if d>1) # Chai Wah Wu, Apr 09 2024
Formula
Conjecture: a((3^n-1)/2) = n. - Vladimir Shevelev, May 26 2008 [This is correct. 2*((3^n-1)/2) + 1 = 3^n and the polynomial (x^(3^n) - 1) / (x - 1) factors over GF(2) into Product_{k=0..n-1} x^(2*3^k) + x^(3^k) + 1. - Joerg Arndt, Apr 01 2019]
a(n) = A081844(n) - 1.
From Vladimir Shevelev, Jan 19 2011: (Start)
1) a(n)=A037226(n) iff 2n+1 is prime;
2) The only case when a(n) < A037226(n) is n=0;
3) If {C_i}, i=1..a(n), is the set of all cyclotomic cosets of 2 mod (2n+1), then lcm(|C_1|, ..., |C_{a(n)}|) = A002326(n). (End)
a(n) = A000374(2*n + 1) - 1. - Joerg Arndt, Apr 01 2019
a(n) = (Sum_{d|(2n+1)} phi(d)/ord(2,d)) - 1, where phi = A000010 and ord(2,d) is the multiplicative order of 2 modulo d. - Jianing Song, Nov 13 2021
Extensions
Additional comments from Antti Karttunen, Jan 05 2000
Extended by Ray Chandler, Apr 25 2008
Edited by N. J. A. Sloane, Apr 27 2008 at the suggestion of Ray Chandler
Comments