login
A061398
Number of squarefree integers between prime(n) and prime(n+1).
74
0, 0, 1, 1, 0, 2, 0, 2, 1, 1, 3, 2, 1, 1, 1, 3, 0, 3, 2, 0, 3, 1, 3, 4, 0, 1, 2, 0, 2, 6, 2, 2, 1, 5, 0, 2, 3, 2, 1, 3, 0, 6, 0, 2, 0, 7, 8, 1, 0, 2, 3, 0, 3, 3, 3, 3, 0, 2, 1, 1, 5, 7, 2, 0, 1, 9, 2, 4, 0, 0, 4, 3, 2, 2, 2, 2, 5, 2, 4, 6, 0, 5, 0, 4, 1, 3, 4, 1, 1, 2, 6, 4, 1, 4, 2, 2, 7, 0, 8, 4, 4, 3, 2, 1, 2
OFFSET
1,6
LINKS
FORMULA
a(n) = A013928(A000040(n+1)) - A013928(A000040(n)) - 1. - Robert Israel, Jan 06 2017
a(n) = A373198(n) - 1. - Gus Wiseman, Nov 06 2024
EXAMPLE
Between 113 and 127 the 6 squarefree numbers are 114, 115, 118, 119, 122, 123, so a(30)=6.
From Gus Wiseman, Nov 06 2024: (Start)
The a(n) squarefree numbers for n = 1..16:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
---------------------------------------------------------------
. . 6 10 . 14 . 21 26 30 33 38 42 46 51 55
15 22 34 39 57
35 58
(End)
MAPLE
p:= 2:
for n from 1 to 200 do
q:= nextprime(p);
A[n]:= nops(select(numtheory:-issqrfree, [$p+1..q-1]));
p:= q;
od:
seq(A[i], i=1..200); # Robert Israel, Jan 06 2017
MATHEMATICA
a[n_] := Count[Range[Prime[n]+1, Prime[n+1]-1], _?SquareFreeQ];
Array[a, 100] (* Jean-François Alcover, Feb 28 2019 *)
Count[Range[#[[1]]+1, #[[2]]-1], _?(SquareFreeQ[#]&)]&/@Partition[ Prime[ Range[120]], 2, 1] (* Harvey P. Dale, Oct 14 2021 *)
PROG
(PARI) { n=0; q=2; forprime (p=3, prime(1001), a=0; for (i=q+1, p-1, a+=issquarefree(i)); write("b061398.txt", n++, " ", a); q=p ) } \\ Harry J. Smith, Jul 22 2009
(PARI) a(n) = my(pp=prime(n)+1); sum(k=pp, nextprime(pp)-1, issquarefree(k)); \\ Michel Marcus, Feb 28 2019
(Python)
from math import isqrt
from sympy import mobius, prime, nextprime
def A061398(n):
p = prime(n)
q = nextprime(p)
r = isqrt(p-1)+1
return sum(mobius(k)*((q-1)//k**2) for k in range(r, isqrt(q-1)+1))+sum(mobius(k)*((q-1)//k**2-(p-1)//k**2) for k in range(1, r))-1 # Chai Wah Wu, Jun 01 2024
CROSSREFS
Cf. A179211. [Reinhard Zumkeller, Jul 05 2010]
Counting all composite numbers (not just squarefree) gives A046933.
The version for nonsquarefree numbers is A061399.
Zeros are A068360.
The version for prime-powers is A080101.
Partial sums are A337030.
The version for non-prime-powers is A368748.
Excluding prime(n+1) from the range gives A373198.
Ones are A377430.
Positives are A377431.
The version for perfect-powers is A377432.
The version for non-perfect-powers is A377433 + 2.
For squarefree numbers (A005117) between primes:
- length is A061398 (this sequence)
- min is A112926
- max is A112925
- sum is A373197
For squarefree numbers between powers of two:
- length is A077643 (except initial terms), partial sums A143658
- min is A372683, difference A373125, indices A372540, firsts of A372475
- max is A372889, difference A373126
- sum is A373123
For primes between powers of two:
- length is A036378
- min is A104080 or A014210, indices A372684 (firsts of A035100)
- max is A014234, difference A013603
- sum is A293697 (except initial terms)
Sequence in context: A055651 A175929 A079627 * A080232 A008482 A037012
KEYWORD
nonn,changed
AUTHOR
Labos Elemer, Jun 07 2001
STATUS
approved