OFFSET
1,3
COMMENTS
This sequence has similarities with A167234.
Will every nonnegative integer appear in the sequence?
LINKS
Rémy Sigrist, Table of n, a(n) for n = 1..10000
Rémy Sigrist, Colored logarithmic scatterplot of the sequence for n = 1..2^19 (where the color is function of floor(n / 2^A070939(a(n)))).
FORMULA
EXAMPLE
For n = 15:
- the divisors of 15 are: 1, 3, 5 and 15,
- their values under the mapping d -> d AND k for k = 0..6 are:
k\d| 1 3 5 15
---+-------------
0| 0 0 0 0
1| 1 1 1 1
2| 0 2 0 2
3| 1 3 1 3
4| 0 0 4 4
5| 1 1 5 5
6| 0 2 4 6
- the first row with 4 distinct values corresponds to k = 6,
- hence a(15) = 6.
PROG
(PARI) a(n) = my (d=divisors(n)); for (m=0, oo, if (#Set(apply(v -> bitand(v, m), d))==#d, return (m)))
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Feb 09 2019
STATUS
approved