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!)
A347859 a(n) = n/2 if n/2 is a prime, else 3(n-1)/2 if (n-1)/2 is prime, else n. 0
0, 1, 2, 3, 2, 6, 3, 9, 8, 9, 5, 15, 12, 13, 7, 21, 16, 17, 18, 19, 20, 21, 11, 33, 24, 25, 13, 39, 28, 29, 30, 31, 32, 33, 17, 51, 36, 37, 19, 57, 40, 41, 42, 43, 44, 45, 23, 69, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 29, 87, 60, 61, 31, 93, 64, 65, 66, 67, 68, 69, 70 (list; graph; refs; listen; history; text; internal format)
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.
LINKS
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
Cf. A064413 (EKG permutation), A100484 (twice the primes = even semiprimes).
Sequence in context: A329282 A197289 A161888 * A157224 A097914 A286633
KEYWORD
nonn,easy
AUTHOR
M. F. Hasler, Feb 14 2022
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 April 26 21:53 EDT 2024. Contains 372004 sequences. (Running on oeis4.)