A066421 a(n) = least k > 0 such that sigma^(k)(n) + 1 is prime, if such k exists; otherwise 0, where sigma^(k) denotes application of sigma k times.
1, 2, 1, 5, 1, 1, 4, 3, 4, 1, 1, 1, 3, 2, 2, 5, 1, 5, 2, 1, 4, 1, 2, 1, 5, 1, 1, 4, 1, 1, 4, 3, 9, 4, 9, 2, 2, 1, 4, 3, 1, 1, 9, 8, 1, 1, 9, 8, 5, 4, 1, 5, 4, 3, 1, 3, 4, 3, 1, 4, 2, 1, 2, 4, 8, 3, 2, 1, 1, 3, 1, 2, 3, 2, 8, 2, 1, 4, 4, 3, 4, 1, 8, 7, 1, 2, 3, 1, 3, 2, 1, 4, 3, 3, 3, 4, 5, 4, 1, 2
Offset: 1
Keywords
Examples
sigma(sigma(sigma(8))) + 1 = sigma(sigma(15)) + 1 = sigma(24) + 1 = 60 + 1 = 61, a prime; hence a(8) = 3.
Links
- Antti Karttunen, Table of n, a(n) for n = 1..36089
Programs
-
Mathematica
A066421[n_]:=Length[NestWhileList[DivisorSigma[1,#]&,DivisorSigma[1,n],!PrimeQ[#+1]&]];Array[A066421,100] (* Paolo Xausa, Oct 16 2023 *)
-
PARI
A066421(n) = { my(k=1,s=sigma(n)); while(!isprime(1+s),k++;s = sigma(s)); k; }; \\ Antti Karttunen, Nov 07 2017
Extensions
More terms from Gabriel Cunningham (gcasey(AT)mit.edu), Oct 15 2004
Description clarified by Antti Karttunen, Nov 07 2017
Comments