|
|
A308439
|
|
a(n) is the smallest prime factor of 1 + the product of primes indexed by the binary digits of n.
|
|
1
|
|
|
3, 2, 7, 2, 11, 2, 31, 2, 3, 2, 43, 2, 71, 2, 211, 2, 23, 2, 67, 2, 3, 2, 331, 2, 5, 2, 463, 2, 3, 2, 2311, 2, 3, 2, 79, 2, 131, 2, 17, 2, 3, 2, 547, 2, 911, 2, 2731, 2, 7, 2, 859, 2, 3, 2, 7, 2, 2003, 2, 6007, 2, 3, 2, 59, 2, 5, 2, 103, 2, 3, 2, 7, 2, 239
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
LINKS
|
|
|
FORMULA
|
|
|
EXAMPLE
|
a(1) = a(01_2) = 2^1 * 3^0 + 1 = 3;
a(2) = a(10_2) = 2^0 * 3^1 + 1 = 2^2 = 2;
a(3) = a(11_2) = 2^1 * 3^1 + 1 = 7.
|
|
PROG
|
(PARI) a(n) = {my(b = binary(n), x = 1 + prod(k=1, #b, prime(#b-k+1)^b[k])); factor(x)[1, 1]; } \\ Michel Marcus, Jun 02 2019
(Python)
from functools import reduce
from operator import mul
from sympy import prime, primefactors
return min(primefactors(1 + reduce(mul, (prime(i+1) for i, j in enumerate(bin(n)[:1:-1]) if j == '1')))) # Chai Wah Wu, Jun 03 2019
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|