A306352 a(n) is the least k >= 0 such that all the positive divisors of n have a distinct value under the mapping d -> d AND k (where AND denotes the bitwise AND operator).
0, 1, 2, 3, 4, 7, 2, 7, 10, 13, 2, 15, 4, 5, 6, 15, 16, 31, 2, 29, 6, 7, 2, 31, 12, 9, 10, 11, 4, 15, 2, 31, 42, 49, 6, 63, 4, 7, 6, 63, 8, 15, 2, 14, 14, 5, 2, 63, 18, 29, 18, 21, 4, 31, 6, 23, 18, 9, 2, 31, 4, 5, 14, 63, 76, 127, 2, 115, 6, 15, 2, 127, 8, 13
Offset: 1
Examples
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.
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)))).
Programs
-
PARI
a(n) = my (d=divisors(n)); for (m=0, oo, if (#Set(apply(v -> bitand(v, m), d))==#d, return (m)))
Comments