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.

A131232 a(n) is the number of positive integers < n that do not have 2 or more distinct prime divisors in common with n.

This page as a plain text file.
%I A131232 #15 Jun 21 2025 11:50:00
%S A131232 0,1,2,3,4,5,6,7,8,9,10,10,12,13,14,15,16,15,18,18,20,21,22,20,24,25,
%T A131232 26,26,28,22,30,31,32,33,34,30,36,37,38,36,40,32,42,42,42,45,46,40,48,
%U A131232 45,50,50,52,45,54,52,56,57,58,44,60,61,60,63,64,52,66,66,68,58,70,60,72
%N A131232 a(n) is the number of positive integers < n that do not have 2 or more distinct prime divisors in common with n.
%H A131232 Amiram Eldar, <a href="/A131232/b131232.txt">Table of n, a(n) for n = 1..10000</a>
%F A131232 a(n) = A131233(n) - A010055(n). - _Amiram Eldar_, Jun 21 2025
%e A131232 The distinct primes which divide 20 are 2 and 5. So a(20) is the number of positive integers < 20 which are not divisible by at least 2 distinct primes dividing 20; i.e. are not divisible by both 2 and 5. Among the first 19 positive integers only 10 is divisible by both 2 and 5. There are 18 other positive integers <= 19, so a(20) = 18.
%t A131232 a[n_] := Module[{p = FactorInteger[n][[;; , 1]]}, n * Times @@ (1-1/p) * (1 + Total[1/(p-1)]) - Boole[Length[p] == 1]]; a[1] = 0; Array[a, 100] (* _Amiram Eldar_, Jun 21 2025 *)
%o A131232 (PARI) a(n) = {my(p = factor(n)[,1]); n * vecprod(apply(x -> 1-1/x, p)) * (1 + vecsum(apply(x -> 1/(x-1), p))) - (#p < 2);} \\ _Amiram Eldar_, Jun 21 2025
%Y A131232 Cf. A010055, A131233.
%K A131232 nonn
%O A131232 1,3
%A A131232 _Leroy Quet_, Jun 20 2007
%E A131232 More terms from _Joshua Zucker_, Jul 18 2007