A371188 Indices of the squarefree numbers in the sequence of cubefree numbers.
1, 2, 3, 5, 6, 7, 9, 10, 12, 13, 14, 15, 17, 19, 20, 21, 23, 25, 26, 27, 28, 29, 30, 32, 33, 34, 35, 36, 37, 40, 41, 44, 46, 47, 48, 49, 50, 52, 53, 55, 56, 57, 59, 60, 61, 62, 63, 66, 67, 68, 69, 70, 72, 73, 74, 75, 77, 79, 80, 81, 82, 86, 87, 88, 89, 90, 91
Offset: 1
Examples
The first 5 cubefree numbers are 1, 2, 3, 4, and 5. The 1st, 2nd, 3rd, and 5th, 1, 2, 3, and 5, are squarefree. Therefore, the first 4 terms of this sequence are 1, 2, 3, and 5.
Links
- Amiram Eldar, Table of n, a(n) for n = 1..10000
Programs
-
Mathematica
freeQ[n_, k_] := AllTrue[FactorInteger[n], Last[#] < k &]; Position[Select[Range[200], freeQ[#, 3] &], _?(freeQ[#1, 2] &), Heads -> False] // Flatten
-
PARI
isfree(n, k) = n == 1 || vecmax(factor(n)[, 2]) < k; lista(kmax) = {my(c = 0); for(k = 1, kmax, if(isfree(k, 3), c++; if(isfree(k, 2), print1(c, ", "))));}
Comments