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.
%I A048640 #15 Dec 23 2024 01:50:24 %S A048640 1,2,4,8,6,16,10,32,64,18,12,128,256,20,34,512,66,1024,14,2048,36,130, %T A048640 24,4096,258,68,8192,22,16384,514,32768,132,65536,40,260,1026,131072, %U A048640 262144,2050,72,38,524288,516,26,1048576,2097152,4098,48,70,4194304 %N A048640 Binary encoding of the squarefree numbers, A005117. %H A048640 Michael De Vlieger, <a href="/A048640/b048640.txt">Table of n, a(n) for n = 1..10000</a> %F A048640 a(n) = 2^i1+2^i2+...+2^iz, where A005117(n) = p_i1*p_i2*p_i3*...*p_iz (p_i stands for the i-th prime, where the first prime is 2). %e A048640 10 = 2*5 = p_1*p_3 -> 2^1+2^3 = 2+8 = 10. %t A048640 Total[2^PrimePi@ # &@ Map[First, FactorInteger@ #]] & /@ Select[Range@ 80, SquareFreeQ] (* _Michael De Vlieger_, Oct 01 2015 *) %o A048640 (PARI) lista(nn) = {for (n=1, nn, if (issquarefree(n), if (n==1, x = n, f = factor(n); x = sum(k=1, #f~, 2^primepi(f[k,1]))); print1(x, ", ");););} \\ _Michel Marcus_, Oct 01 2015 %o A048640 (Python) %o A048640 from math import isqrt %o A048640 from sympy import mobius, primepi, primefactors %o A048640 def A048640(n): %o A048640 if n == 1: return 1 %o A048640 def f(x): return int(n-sum(mobius(k)*(x//k**2) for k in range(2, isqrt(x)+1))) %o A048640 m, k = n, f(n) %o A048640 while m != k: m, k = k, f(k) %o A048640 return sum(1<<primepi(p) for p in primefactors(m)) # _Chai Wah Wu_, Dec 23 2024 %Y A048640 Cf. A048639. %K A048640 nonn %O A048640 1,2 %A A048640 _Antti Karttunen_, Jul 14 1999