OFFSET
1,7
COMMENTS
This is the 3-adic valuation of prime(n)+1.
By Dirichlet's theorem on arithmetic progressions, the asymptotic density of primes p such that p == 3^k-1 (mod 3^k) within all the primes is 1/(2*3^(k-1)), for k >= 1. This is also the asymptotic density of terms in this sequence that are >= k. Therefore, the asymptotic density of the occurrences of k in this sequence is d(k) = 1/(2*3^(k-1)) - 1/(2*3^k) = 1/3^k, and the asymptotic mean of this sequence is Sum_{k>=1} k*d(k) = 3/4. - Amiram Eldar, Mar 14 2025
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000 (terms 1..1000 from Bruno Berselli)
MATHEMATICA
Table[IntegerExponent[Prime[n] + 1, 3], {n, 100}]
PROG
(PARI) forprime(p=2, 700, print1(valuation(p+1, 3), ", "));
(Magma) [Valuation(NthPrime(n)+1, 3): n in [1..100]];
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Bruno Berselli, Aug 05 2013
STATUS
approved
