|
|
A165560
|
|
The arithmetic derivative of n, modulo 2.
|
|
18
|
|
|
0, 0, 1, 1, 0, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,1
|
|
LINKS
|
|
|
FORMULA
|
a(n) = (1-(-1)^n')/2.
|
|
MAPLE
|
with(numtheory);
P:=proc(i)
local f, n, p, pfs;
for n from 0 by 1 to i do
pfs:=ifactors(n)[2]; f:=n*add(op(2, p)/op(1, p), p=pfs);
print(1/2*(1-(-1)^f));
od;
end:
P(1000);
|
|
MATHEMATICA
|
d[0] = d[1] = 0; d[n_] := n*Total[f = FactorInteger[n]; f[[All, 2]]/f[[All, 1]] ]; a[n_] := Mod[d[n], 2]; Table[a[n], {n, 0, 104}] (* Jean-François Alcover, Apr 22 2015 *)
|
|
PROG
|
(Haskell)
(Python)
from sympy import factorint
def A165560(n): return int(n&3==2 or (n&1 and sum(factorint(n).values())&1)) # Chai Wah Wu, Nov 04 2022
(PARI) A165560(n) = if(n<=1, 0, my(f=factor(n)); (n*sum(i=1, #f~, f[i, 2]/f[i, 1]))%2); \\ Antti Karttunen, Nov 04 2022
|
|
CROSSREFS
|
Characteristic function of A235991, whose complement A235992 gives the positions of 0's.
|
|
KEYWORD
|
easy,nonn
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|