login
A238642
a(n) = n if n+1 is prime; otherwise, a(n) = n * (smallest prime factor of n+1).
2
1, 2, 6, 4, 10, 6, 14, 24, 18, 10, 22, 12, 26, 42, 30, 16, 34, 18, 38, 60, 42, 22, 46, 120, 50, 78, 54, 28, 58, 30, 62, 96, 66, 170, 70, 36, 74, 114, 78, 40, 82, 42, 86, 132, 90, 46, 94, 336, 98, 150, 102, 52, 106, 270, 110, 168, 114, 58, 118, 60, 122
OFFSET
1,2
LINKS
EXAMPLE
a(8) = 24 because the smallest prime factor of 9 is 3 and 8*3 = 24.
MAPLE
with(numtheory):
a:= n-> n*`if`(isprime(n+1), 1, min(factorset(n+1)[])):
seq(a(n), n=1..100); # Alois P. Heinz, Mar 03 2014
PROG
(Sage)
q=100 #change q for more terms
[n if is_prime(n+1) else n*min(prime_divisors(n+1)) for n in [1..q]] # Tom Edgar, Mar 03 2014
CROSSREFS
Sequence in context: A227389 A015906 A066043 * A145019 A066678 A306645
KEYWORD
nonn
AUTHOR
J. Lowell, Mar 01 2014
EXTENSIONS
More terms from Tom Edgar, Mar 03 2014
STATUS
approved