cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A185358 The period of the sequence i^i (mod n) starts from i=a(n).

This page as a plain text file.
%I A185358 #30 May 08 2021 08:35:58
%S A185358 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,
%T A185358 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,
%U A185358 1,1,1,3,1,1,1,1,1,1,1,3,4,1,1,1
%N A185358 The period of the sequence i^i (mod n) starts from i=a(n).
%H A185358 G. C. Greubel, <a href="/A185358/b185358.txt">Table of n, a(n) for n = 1..5000</a>
%H A185358 R. Hampel, <a href="https://doi.org/10.4064/ap-1-2-360-366">The length of the shortest period of rests of numbers n^n</a>, Ann. Polon. Math. 1 (1955), 360-366.
%F A185358 If n = Product_{pi^ei} then a(n) = Max_{1- pi*(1+floor[-ei/pi])}.
%t A185358 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}]
%o A185358 (Python)
%o A185358 from sympy import factorint, floor
%o A185358 def a(n):
%o A185358     f=factorint(n)
%o A185358     return 1 if n==1 else max(1 - i*(1 + (-f[i])//i) for i in f)
%o A185358 print([a(n) for n in range(1, 201)]) # _Indranil Ghosh_, Jun 29 2017
%Y A185358 Cf. A185359.
%K A185358 nonn
%O A185358 1,8
%A A185358 _José María Grau Ribas_, Jan 21 2012