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.

A123066 (Number of numbers <= n with an odd number of distinct prime factors) - (number of numbers <= n with an even number of distinct prime factors).

This page as a plain text file.
%I A123066 #26 Jan 01 2023 02:59:00
%S A123066 0,1,2,3,4,3,4,5,6,5,6,5,6,5,4,5,6,5,6,5,4,3,4,3,4,3,4,3,4,5,6,7,6,5,
%T A123066 4,3,4,3,2,1,2,3,4,3,2,1,2,1,2,1,0,-1,0,-1,-2,-3,-4,-5,-4,-3,-2,-3,-4,
%U A123066 -3,-4,-3,-2,-3,-4,-3,-2,-3,-2,-3,-4,-5,-6,-5,-4,-5,-4,-5,-4,-3,-4,-5,-6,-7,-6,-5,-6,-7,-8,-9,-10
%N A123066 (Number of numbers <= n with an odd number of distinct prime factors) - (number of numbers <= n with an even number of distinct prime factors).
%C A123066 Analog of A072203 for number of distinct factors. Conjecture that sequence changes sign infinitely often, although the next sign change is probably large.
%C A123066 The signs first change at n = 52 and then change again at n = 7954. - _Harvey P. Dale_, Jul 04 2012
%H A123066 G. C. Greubel, <a href="/A123066/b123066.txt">Table of n, a(n) for n = 1..5000</a>
%H A123066 H. Helfgott and A. Ubis, <a href="https://arxiv.org/abs/1812.08707">Primos, paridad y anĂ¡lisis</a>, arXiv:1812.08707 [math.NT], Dec. 2018.
%F A123066 a(n) = Sum_{k>=1} (-1)^(k-1) * A346617(n,k). - _Alois P. Heinz_, Aug 19 2021
%p A123066 a:= proc(n) option remember; `if`(n<2, 0, a(n-1)+
%p A123066       `if`(nops(ifactors(n)[2])::odd, 1, -1))
%p A123066     end:
%p A123066 seq(a(n), n=1..120);  # _Alois P. Heinz_, Dec 21 2018
%t A123066 dpf[n_] := Module[{df = PrimeNu[n]}, If[OddQ[df], 1, -1]]; Join[{0}, Accumulate[ Array[dpf, 100, 2]]] (* _Harvey P. Dale_, Jul 04 2012 *)
%o A123066 (Python)
%o A123066 from sympy import primenu
%o A123066 def A123066(n): return 1+sum(1 if primenu(i)&1 else -1 for i in range(1,n+1)) # _Chai Wah Wu_, Dec 31 2022
%Y A123066 Cf. A030230, A030231.
%Y A123066 Cf. A072203, A001221.
%Y A123066 Cf. A346617.
%K A123066 easy,look,sign
%O A123066 1,3
%A A123066 _Franklin T. Adams-Watters_, Sep 26 2006