OFFSET
2,1
LINKS
Antti Karttunen, Table of n, a(n) for n = 2..10001
FORMULA
a(n) = if n prime then (n * pp(n) + 1) else (n / lpf(n)) for n > 1 where pp(n) = if n > 2 then Max{p prime | p < n} else 1; [prime-predecessor] and lpf(n) = if n > 2 then Min{p prime | p < n and p divides n} else 1; [where lpf = A020639].
If A010051(n) = 1 [when n is a prime], a(n) = 1 + (A064989(n)*n), otherwise a(n) = A032742(n). - Antti Karttunen, Jan 23 2017
EXAMPLE
MATHEMATICA
Join[{3}, Table[If[PrimeQ[n], n*Prime[PrimePi[n]-1]+1, n/Min[First/@FactorInteger[n]]], {n, 3, 69}]] (* Jayanta Basu, May 27 2013 *)
PROG
(Scheme) (define (A063041 n) (if (= 1 (A010051 n)) (+ 1 (* (A064989 n) n)) (A032742 n))) ;; Antti Karttunen, Jan 23 2017
(Python)
from sympy import isprime, prevprime, primefactors
def f(n): return 1 if n == 2 else prevprime(n)
def a(n): return n*f(n)+1 if isprime(n) else n//min(primefactors(n))
print([a(n) for n in range(2, 70)]) # Michael S. Branicky, Apr 17 2023
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Reinhard Zumkeller, Jul 07 2001
EXTENSIONS
More terms from Matthew Conroy, Jul 15 2001
Description clarified by Antti Karttunen, Jan 23 2017
STATUS
approved