login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A185358 The period of the sequence i^i (mod n) starts from i=a(n). 2
1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 5, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 5, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 3, 4, 1, 1, 1 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,8
LINKS
R. Hampel, The length of the shortest period of rests of numbers n^n, Ann. Polon. Math. 1 (1955), 360-366.
FORMULA
If n = Product_{pi^ei} then a(n) = Max_{1- pi*(1+floor[-ei/pi])}.
MATHEMATICA
a[p_, e_]:=1- p*(1+Floor[-e/p]); a[n_]:=Max@Module[{fa=FactorInteger[n]}, Table[a[fa[[i, 1]], fa[[i, 2]]], {i, 1, Length[fa]}]]; Table[a[n], {n, 1, 84}]
PROG
(Python)
from sympy import factorint, floor
def a(n):
f=factorint(n)
return 1 if n==1 else max(1 - i*(1 + (-f[i])//i) for i in f)
print([a(n) for n in range(1, 201)]) # Indranil Ghosh, Jun 29 2017
CROSSREFS
Cf. A185359.
Sequence in context: A031229 A031228 A031227 * A368247 A331273 A363332
KEYWORD
nonn
AUTHOR
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 23 16:40 EDT 2024. Contains 371916 sequences. (Running on oeis4.)