login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

A331469
a(n) is the greatest value of the form p_1 + ... + p_k where p_1, ..., p_k are powers of primes and such that the concatenation of the binary representations of p_1, ..., p_k equals the binary representation of n.
1
1, 2, 3, 4, 5, 3, 7, 8, 9, 4, 11, 5, 13, 5, 8, 16, 17, 6, 19, 6, 7, 7, 23, 9, 25, 5, 27, 7, 29, 9, 31, 32, 17, 10, 18, 8, 37, 11, 20, 10, 41, 6, 43, 9, 15, 13, 47, 17, 49, 7, 26, 7, 53, 15, 28, 11, 26, 7, 59, 11, 61, 10, 32, 64, 33, 18, 67, 12, 13, 19, 71, 12
OFFSET
1,2
COMMENTS
We can always split the binary representation of a number into powers of 2, so the sequence is well defined.
FORMULA
a(n) >= A162439(n).
a(n) <= n with equality iff n is a power of a prime.
EXAMPLE
For n = 22:
- the binary representation of 22 is "10110",
- we can split it into "10" and "1" and "10" (2^1 and 2^0 and 2^1),
- or into "101" and "10" (5^2 and 2^1),
- hence a(22) = max(5, 7) = 7.
PROG
(PARI) See Links section.
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Jan 17 2020
STATUS
approved