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.

A048639 Binary encoding of A006881, numbers with two distinct prime divisors.

This page as a plain text file.
%I A048639 #19 Feb 22 2025 01:22:52
%S A048639 3,5,9,6,10,17,33,18,65,12,129,34,257,66,20,130,513,1025,36,258,2049,
%T A048639 24,4097,68,8193,514,40,1026,16385,132,32769,2050,260,65537,72,131073,
%U A048639 4098,8194,136,262145,16386,524289,48,516,1048577,1028,2097153,32770
%N A048639 Binary encoding of A006881, numbers with two distinct prime divisors.
%H A048639 Michael De Vlieger, <a href="/A048639/b048639.txt">Table of n, a(n) for n = 1..10000</a>
%F A048639 a(n) = 2^(i-1) + 2^(j-1), where A006881(n) = p_i*p_j (p_i and p_j stand for the i-th and j-th primes respectively, where the first prime is 2).
%p A048639 encode_A006881 := proc(upto_n) local b,i; b := [ ]; for i from 1 to upto_n do if((0 <> mobius(i)) and (4 = tau(i))) then b := [ op(b), bef(i) ]; fi; od: RETURN(b); end; # see A048623 for bef
%t A048639 Total[2^PrimePi@ # &@ (Map[First, FactorInteger@ #] - 1)] & /@ Select[Range@ 160, SquareFreeQ@ # && PrimeOmega@ # == 2 &] (* _Michael De Vlieger_, Oct 01 2015 *)
%o A048639 (PARI) lista(nn) = {for (n=1, nn, if (issquarefree(n) && bigomega(n)==2, f = factor(n); x = sum(k=1, #f~, 2^(primepi(f[k,1])-1)); print1(x, ", ");););} \\ _Michel Marcus_, Oct 01 2015
%o A048639 (Python)
%o A048639 from math import isqrt
%o A048639 from sympy import primepi, primerange, primefactors
%o A048639 def A048639(n):
%o A048639     def f(x): return int(n+x+(t:=primepi(s:=isqrt(x)))+(t*(t-1)>>1)-sum(primepi(x//k) for k in primerange(1, s+1)))
%o A048639     m, k = n, f(n)
%o A048639     while m != k: m, k = k, f(k)
%o A048639     return sum(1<<primepi(p)-1 for p in primefactors(m)) # _Chai Wah Wu_, Feb 22 2025
%Y A048639 Permutation of A018900. Cf. A048640, A048623.
%K A048639 nonn
%O A048639 1,1
%A A048639 _Antti Karttunen_, Jul 14 1999