A303554 Union of the prime powers (p^k, p prime, k >= 0) and numbers that are the product of 2 or more distinct primes.
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 14, 15, 16, 17, 19, 21, 22, 23, 25, 26, 27, 29, 30, 31, 32, 33, 34, 35, 37, 38, 39, 41, 42, 43, 46, 47, 49, 51, 53, 55, 57, 58, 59, 61, 62, 64, 65, 66, 67, 69, 70, 71, 73, 74, 77, 78, 79, 81, 82, 83, 85, 86, 87, 89, 91, 93, 94, 95, 97, 101, 102, 103, 105, 106, 107, 109, 110
Offset: 1
Keywords
Examples
42 is in the sequence because 42 = 2*3*7 (3 distinct prime factors). 81 is in the sequence because 81 = 3^4 (4 prime factors, 1 distinct).
Links
- Michael De Vlieger, Table of n, a(n) for n = 1..10000
- Eric Weisstein's World of Mathematics, Prime Power
- Eric Weisstein's World of Mathematics, Squarefree
Crossrefs
Programs
-
Mathematica
Select[Range[110], PrimePowerQ[#] || SquareFreeQ[#] &] Select[Range[110], PrimeNu[#] == 1 || PrimeNu[#] == PrimeOmega[#] &]
-
Python
from math import isqrt from sympy import primepi, integer_nthroot, mobius def A303554(n): def f(x): return int(n+x-sum(primepi(integer_nthroot(x,k)[0]) for k in range(2,x.bit_length()))-sum(mobius(k)*(x//k**2) for k in range(1, isqrt(x)+1))) m, k = n, f(n) while m != k: m, k = k, f(k) return m # Chai Wah Wu, Aug 19 2024