A165560 The arithmetic derivative of n, modulo 2.
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
Offset: 0
Links
- Reinhard Zumkeller, Table of n, a(n) for n = 0..10000
- Index entries for characteristic functions
Crossrefs
Programs
-
Haskell
a165560 = flip mod 2 . a003415 -- Reinhard Zumkeller, Mar 11 2014
-
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 *)
-
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
-
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
Formula
a(n) = A003415(n) mod 2.
a(n) = (1-(-1)^n')/2.
Extensions
Entries checked by R. J. Mathar, Oct 07 2009