OFFSET
1,1
COMMENTS
This sequence looks at the effect on p^2 - 1 of A039634 with the primes represented by their indices. It seems that primes obtained by iterating the map A039634 on p^2 - 1 never fall into a cycle before reaching 2. Conjecture: Iterating the map k -> a(k) eventually reaches 1. For example, 1 -> 2 -> 1; 5 -> 4 -> 2 -> 1; and 27 -> 67 -> 16 -> 14 -> 4 -> 2 -> 1.
LINKS
FORMULA
MATHEMATICA
Array[PrimePi@ FixedPoint[If[EvenQ[#] && # > 2, #/2, If[PrimeQ[#] || (# === 1), #, (# - 1)/2]] &, Prime[#]^2 - 1] &, 70] (* Michael De Vlieger, Jul 06 2021 *)
PROG
(Python)
from sympy import prime, isprime, primepi
def a(n):
p = prime(n); m = p*p - 1
while not isprime(m): m = m//2
return primepi(m)
for n in range(1, 71): print(a(n))
CROSSREFS
KEYWORD
nonn
AUTHOR
Ya-Ping Lu, Jul 03 2021
STATUS
approved