A007885 Numbers n such that balanced sequences exist with n distinct elements.
1, 2, 3, 4, 5, 7, 11, 13, 19, 23, 29, 37, 47, 53, 59, 61, 67, 71, 79, 83, 101, 103, 107, 131, 139, 149, 163, 167, 173, 179, 181, 191, 197, 199, 211, 227, 239, 263, 269, 271, 293, 311, 317, 347, 349, 359, 367, 373, 379, 383, 389, 419, 421, 443, 461, 463, 467
Offset: 1
Examples
n=5 is in the sequence, since 0,2,3,4,6 is balanced. n=6 is not because every balanced sequence of length 6 is affinely equivalent to 0,1,2,2,3,4.
Links
- Fred Galvin, Problem 10430, Amer. Math. Monthly, 102 (1995), 71.
- Fred Galvin, John Isbell and Robin J. Chapman, Problem 10430 solution, Amer. Math. Monthly, 104 (1997), 671-672.
Programs
-
Mathematica
o2[n_] := MultiplicativeOrder[2, n]; For[n=1, True, n++, If[Mod[4, n]==0||(PrimeQ[n]&&(o2[n]==n-1|| (o2[n]==(n-1)/2&&Mod[n, 4]==3))), Print[n]]]
-
PARI
is(n)=n<6 || (isprime(n) && (znorder(Mod(2,n))==n-1 || znorder(Mod(-2,n))==n-1)) \\ Charles R Greathouse IV, Nov 21 2014
Extensions
More terms and additional comments from Dean Hickerson, Sep 20 2001
Comments