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!)
A374163 a(1) = 1; for n>1 a(n) is the minimum value of k > 0 such that sigma^{k}(n)-1 is prime, if such a k exists; otherwise -1, where sigma^{k} is the k-th iteration of sigma=A000203. 1
1, 1, 1, 2, 1, 1, 1, 2, 2, 1, 1, 4, 1, 1, 1, 2, 1, 4, 1, 1, 1, 5, 1, 1, 2, 1, 2, 3, 1, 1, 1, 2, 1, 1, 1, 4, 1, 1, 3, 1, 1, 2, 1, 1, 2, 1, 1, 2, 2, 2, 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 1, 2, 1, 2, 1, 7, 1, 2, 2, 7, 1, 3, 1, 1, 2, 1, 2, 1, 1, 2, 8, 2, 1, 1, 1, 1, 2, 1, 1, 1, 3, 1, 1, 7, 2 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,4
LINKS
EXAMPLE
For n=12, sigma^{4}(12)-1 = 360-1 = 359 is prime, and there is no positive k<4 such that sigma^{k}(12)-1 is prime, so a(12)=4.
MAPLE
sigma_iterate := proc (n, k)
local sigma_result, i:
sigma_result := n:
for i to k do
sigma_result := sigma(sigma_result)
end do:
return sigma_result
end proc:
find_min_k := proc (n)
local k, sigma_k_n, prime_candidate:
k := 0:
do
k := k+1:
sigma_k_n := sigma_iterate(n, k):
prime_candidate := sigma_k_n - 1:
if isprime(prime_candidate) then
return k
end if
end do
end proc:
map(find_min_k, [$ 2 .. 100]);
MATHEMATICA
A374163[n_] := If[n==1, 1, Length[NestWhileList[DivisorSigma[1, #]&, n, !PrimeQ[# - 1]&, {2, 1}]] - 1]; Array[A374163, 100] (* Paolo Xausa, Jul 24 2024 *)
PROG
(PARI) a(n) = my(k=1, s=sigma(n)); while(!isprime(s-1), k++; s = sigma(s)); k; \\ Michel Marcus, Jun 29 2024
CROSSREFS
Sequence in context: A025864 A070242 A242748 * A266012 A202111 A187759
KEYWORD
nonn
AUTHOR
Rafik Khalfi, Jun 29 2024
EXTENSIONS
Offset corrected by N. J. A. Sloane, Jul 25 2024
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 August 15 03:10 EDT 2024. Contains 375172 sequences. (Running on oeis4.)