OFFSET
0,3
COMMENTS
Inspired by the "EKG permutation" A064413 which has a quite similar graph (a main ray with slope 1 and two secondary rays with slope 1/2 and 3/2) but probably not many other common properties.
PROG
(PARI) apply( {a(n)=if(!isprime(n\2), n, n%2, n\2*3, n\2)}, [0..88])
(Python)
from sympy import isprime
def a(n):
if n%2 == 0 and isprime(n//2): return n//2
if (n-1)%2 == 0 and isprime((n-1)//2): return 3*(n-1)//2
return n
print([a(n) for n in range(71)]) # Michael S. Branicky, Feb 21 2022
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
M. F. Hasler, Feb 14 2022
STATUS
approved