OFFSET
0,6
COMMENTS
This sequence is unbounded.
LINKS
Rémy Sigrist, Table of n, a(n) for n = 0..16384
FORMULA
EXAMPLE
The first terms, alongside the binary representations of n and of the corresponding prime numbers, are:
n a(n) bin(n) {bin(p)}
-- ---- ------ --------------------
0 0 0 {}
1 0 1 {}
2 1 10 {10}
3 1 11 {11}
4 1 100 {10}
5 3 101 {10, 11, 101}
6 2 110 {10, 11}
7 2 111 {11, 111}
8 1 1000 {10}
9 3 1001 {10, 11, 101}
10 3 1010 {10, 11, 101}
11 5 1011 {10, 11, 101, 111, 1011}
12 2 1100 {10, 11}
MAPLE
b:= proc(n) option remember; `if`(n=0, {0},
map(x-> [x, 2*x+r][], b(iquo(n, 2, 'r'))))
end:
a:= n-> nops(select(isprime, b(n))):
seq(a(n), n=0..84); # Alois P. Heinz, Jan 26 2022
PROG
(PARI) a(n, base=2) = { my (b=digits(n, base), s=[0]); for (k=1, #b, s = setunion(s, apply(o -> base*o+b[k], s))); #select(isprime, s) }
CROSSREFS
KEYWORD
AUTHOR
Rémy Sigrist, Nov 23 2019
STATUS
approved