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!)
A340008 a(n) is the image of n under the map: n -> n/2 if n is even, n-> n^2 - 1 if n is an odd prime, otherwise n -> n - 1. 8
0, 1, 8, 2, 24, 3, 48, 4, 8, 5, 120, 6, 168, 7, 14, 8, 288, 9, 360, 10, 20, 11, 528, 12, 24, 13, 26, 14, 840, 15, 960, 16, 32, 17, 34, 18, 1368, 19, 38, 20, 1680, 21, 1848, 22, 44, 23, 2208, 24, 48, 25, 50, 26, 2808, 27, 54, 28, 56, 29, 3480, 30, 3720, 31, 62, 32 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,3
COMMENTS
This map is used in A339991.
LINKS
MATHEMATICA
Array[Which[EvenQ@ #, #/2, PrimeQ@ #, #^2 - 1, True, # - 1] &, 64] (* Michael De Vlieger, Dec 28 2020 *)
PROG
(Python)
from sympy import isprime
for n in range(1, 1001):
if n%2 == 0: a = n/2
elif isprime(n) == 1: a = n*n - 1
else: a = n - 1
print(a)
(PARI) a(n) = if (n%2, if (isprime(n), n^2-1, n-1), n/2); \\ Michel Marcus, Dec 26 2020
CROSSREFS
Cf. A339991.
Sequence in context: A180728 A308217 A248297 * A006708 A355585 A273671
KEYWORD
nonn
AUTHOR
Ya-Ping Lu, Dec 26 2020
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 September 14 21:48 EDT 2024. Contains 375929 sequences. (Running on oeis4.)