OFFSET
1,3
COMMENTS
The values at a(2^n+1), n>=0, are given by A089588: {1,2,2,7,2,9,38,79,2,220,..} and it is conjectured that a(n)=2 only when n is a Fermat number 2^(2^j)+1.
FORMULA
a(2^(2^n)+1)=2; a(2^n-1)=2^(n-1); a(4^n-2)=4^(n-1) (conjectures).
EXAMPLE
a(7)=4 since 4 is the smallest number between 1 and 6 that has the maximum number of decreasing power residues mod 7:
n=7: k=1..6, m=1..7
k^m (mod 7).. #>'s
1=1=1=1=1=1=1:0
2<4>1<2<4>1<2:2
3>2<6>4<5>1<3:3
4>2>1<4>2>1<4:4 <- max of 4 >'s first occurs at k=4
5>4<6>2<3>1<5:3
6>1<6>1<6>1<6:3
PROG
(PARI) a(n) = local(high, lowK, count); high = 0; for (k = 1, n - 1, count = 0; for (m = 1, n - 1, if (k^m%n > k^(m+1)%n, count++)); if (count > high, high = count; lowK = k)); if(n==2, 1, lowK) \\ David Wasserman, Sep 20 2005 [a(2) corrected by Georg Fischer, Jun 20 2022]
CROSSREFS
KEYWORD
nonn
AUTHOR
Paul D. Hanna, Nov 09 2003
STATUS
approved