cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A165560 The arithmetic derivative of n, modulo 2.

Original entry on oeis.org

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

Views

Author

Keywords

Crossrefs

Characteristic function of A235991, whose complement A235992 gives the positions of 0's.
Cf. A000035, A003415, A347870 [= a(sigma(n))], A353493, A353494, A353495, A358680 (one's complement), A359792.
Sum of A358771 and A358773.

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.
a(A235991(n)) = 1 and a(A235992(n)) = 0. - Reinhard Zumkeller, Mar 11 2014
a(n) = 1 - A358680(n) = A358680(n) - A359792(n) = A358771(n) + A358773(n). - Antti Karttunen, Jan 16 2023

Extensions

Entries checked by R. J. Mathar, Oct 07 2009