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!)
A364391 a(n) = n - (largest nontrivial divisor of n, or 0 if there is none). 1
1, 2, 3, 2, 5, 3, 7, 4, 6, 5, 11, 6, 13, 7, 10, 8, 17, 9, 19, 10, 14, 11, 23, 12, 20, 13, 18, 14, 29, 15, 31, 16, 22, 17, 28, 18, 37, 19, 26, 20, 41, 21, 43, 22, 30, 23, 47, 24, 42, 25, 34, 26, 53, 27, 44, 28, 38, 29, 59, 30, 61, 31, 42, 32, 52, 33, 67, 34, 46, 35 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
LINKS
FORMULA
a(n) = n - A032742(n) if n is composite, n otherwise. - Jon E. Schoenfield, Jul 21 2023
EXAMPLE
The largest nontrivial divisor of 6 is 3, so a(6) = 6 - 3 = 3.
MATHEMATICA
a[n_] := n - If[CompositeQ[n], n/FactorInteger[n][[1, 1]], 0]; Array[a, 100] (* Amiram Eldar, Jul 22 2023 *)
PROG
(Python)
from sympy import isprime, primefactors
def A364391(n): return n if n==1 or isprime(n) else n-n//min(primefactors(n)) # Chai Wah Wu, Aug 20 2023
CROSSREFS
Sequence in context: A363627 A073890 A079311 * A060474 A065988 A335285
KEYWORD
nonn
AUTHOR
Todor Szimeonov, Jul 21 2023
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 June 28 02:17 EDT 2024. Contains 373761 sequences. (Running on oeis4.)