The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A328178 a(n) is the minimal value of the expression d XOR (n/d) where d runs through the divisors of n and XOR denotes the bitwise XOR operator. 3
0, 3, 2, 0, 4, 1, 6, 6, 0, 7, 10, 4, 12, 5, 6, 0, 16, 5, 18, 1, 4, 9, 22, 2, 0, 15, 10, 3, 28, 3, 30, 12, 8, 19, 2, 0, 36, 17, 14, 13, 40, 1, 42, 15, 12, 21, 46, 8, 0, 15, 18, 9, 52, 15, 14, 10, 16, 31, 58, 9, 60, 29, 14, 0, 8, 13, 66, 21, 20, 11, 70, 1, 72 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
LINKS
FORMULA
a(n) = 0 iff n is a square.
a(p) = p-1 for any odd prime number p.
EXAMPLE
For n = 12:
- we have the following values:
d 12/d d XOR (12/d)
-- ---- ------------
1 12 13
2 6 4
3 4 7
4 3 7
6 2 4
12 1 13
- hence a(12) = min({4, 7, 13}) = 4.
MAPLE
a:= n-> min(seq(Bits[Xor](d, n/d), d=numtheory[divisors](n))):
seq(a(n), n=1..100); # Alois P. Heinz, Oct 09 2019
MATHEMATICA
mvx[n_]:=Min[BitXor[#, n/#]&/@Divisors[n]]; Array[mvx, 80] (* Harvey P. Dale, Nov 04 2019 *)
PROG
(PARI) a(n) = vecmin(apply(d -> bitxor(d, n/d), divisors(n)))
CROSSREFS
See A328176 and A328177 for similar sequences.
Cf. A178910.
Sequence in context: A224825 A341413 A290794 * A127571 A194662 A143612
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Oct 06 2019
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified June 1 18:31 EDT 2024. Contains 373027 sequences. (Running on oeis4.)