|
|
A344767
|
|
Möbius transform of A011772.
|
|
6
|
|
|
1, 2, 1, 4, 3, -1, 5, 8, 6, -2, 9, 1, 11, -1, 0, 16, 15, -1, 17, 7, -1, -1, 21, -1, 20, -2, 18, -4, 27, 11, 29, 32, 0, -2, 5, -5, 35, -1, -1, -8, 39, 14, 41, 17, -2, -1, 45, 1, 42, 0, 0, 23, 51, 1, -3, 33, -1, -2, 57, -12, 59, -1, 15, 64, 10, 0, 65, -4, 0, 7, 69, 48, 71, -2, -1, 33, 6, 1, 77, 33, 54, -2, 81, 27, 15, -1, 0
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
LINKS
|
|
|
FORMULA
|
|
|
PROG
|
(Python 3.8+)
from itertools import combinations
from math import prod
from sympy import factorint, divisors
from sympy.ntheory.modular import crt
from sympy.ntheory import mobius
plist = [p**q for p, q in factorint(2*n).items()]
return 2*n-1 if len(plist) == 1 else min(min(crt([m, 2*n//m], [0, -1])[0], crt([2*n//m, m], [0, -1])[0]) for m in (prod(d) for l in range(1, len(plist)//2+1) for d in combinations(plist, l)))
|
|
CROSSREFS
|
|
|
KEYWORD
|
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|