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.

Previous Showing 81-90 of 104 results. Next

A378619 Distance between n and the greatest squarefree number <= n.

Original entry on oeis.org

0, 0, 0, 1, 0, 0, 0, 1, 2, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 2, 0, 1, 2, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 2, 0, 0, 1, 2, 3, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 2, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 2, 0, 0, 0, 1, 2, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 2, 3, 0, 0, 0, 1, 0
Offset: 1

Views

Author

Gus Wiseman, Dec 12 2024

Keywords

Crossrefs

Positions of 0 are A005117.
Positions of first appearances are A020755 - 1.
Positions of 1 are A053806.
Subtracting each term from n gives A070321.
The opposite version is A081221.
Restriction to the primes is A240473, opposite A240474.
A013929 lists the nonsquarefree numbers, differences A078147.
A061398 counts squarefree numbers between primes, zeros A068360.
A061399 counts nonsquarefree numbers between primes, zeros A068361.

Programs

  • Mathematica
    Table[n-NestWhile[#-1&,n,!SquareFreeQ[#]&],{n,100}]
  • PARI
    A378619(n) = forstep(k=n,1,-1,if(issquarefree(k), return(n-k))); \\ Antti Karttunen, Jan 29 2025
  • Python
    from itertools import count
    from sympy import factorint
    def A378619(n): return n-next(m for m in count(n,-1) if max(factorint(m).values(),default=0)<=1) # Chai Wah Wu, Dec 14 2024
    

Formula

a(n) = n - A070321(n).

Extensions

Data section extended to a(105) by Antti Karttunen, Jan 29 2025

A072358 Number of cubefree numbers <= n which are not squarefree.

Original entry on oeis.org

0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 3, 3, 3, 3, 3, 3, 4, 4, 5, 5, 5, 5, 5, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 9, 10, 10, 10, 10, 11, 12, 12, 13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 17, 18, 18, 18, 18, 18, 18, 18, 18, 19
Offset: 1

Views

Author

Reinhard Zumkeller, Jul 18 2002

Keywords

Crossrefs

Programs

  • Haskell
    a072358 n = a072358_list !! (n-1)
    a072358_list = scanl1 (+) $
       zipWith (*) a212793_list $ map (1 -) a008966_list
    -- Reinhard Zumkeller, May 27 2012
    
  • Mathematica
    Accumulate @ Table[Boole[Max @ FactorInteger[n][[;; , 2]] == 2], {n, 1, 100}] (* Amiram Eldar, Feb 16 2021 *)
  • Python
    from math import isqrt
    from sympy import mobius, integer_nthroot
    def A072358(n): return sum(mobius(k)*(n//k**3-n//k**2) for k in range(1, integer_nthroot(n,3)[0]+1))-sum(mobius(k)*(n//k**2) for k in range(integer_nthroot(n,3)[0]+1,isqrt(n)+1)) # Chai Wah Wu, Aug 12 2024

Formula

a(n) = A060431(n) - A013928(n+1).
a(n) = Sum_{k=1..n} (A212793(k) * (1 - A008966(k))). - Reinhard Zumkeller, May 27 2012
a(n) ~ c * n, where c = 1/zeta(3) - 1/zeta(2) = A088453 - A059956 = 0.22398... - Amiram Eldar, Feb 16 2021

A072490 Number of squarefree numbers (excluding 1) less than n.

Original entry on oeis.org

0, 0, 1, 2, 2, 3, 4, 5, 5, 5, 6, 7, 7, 8, 9, 10, 10, 11, 11, 12, 12, 13, 14, 15, 15, 15, 16, 16, 16, 17, 18, 19, 19, 20, 21, 22, 22, 23, 24, 25, 25, 26, 27, 28, 28, 28, 29, 30, 30, 30, 30, 31, 31, 32, 32, 33, 33, 34, 35, 36, 36, 37, 38, 38, 38, 39
Offset: 1

Views

Author

Amarnath Murthy, Jul 14 2002

Keywords

Examples

			a(10) = 5 as the squarefree numbers less than 10 are 2,3,5,6 and 7.
		

Crossrefs

Programs

  • PARI
    a(n) = sum(k=2, n-1, issquarefree(k)); \\ Michel Marcus, Sep 15 2019
    
  • Python
    from math import isqrt
    from sympy import mobius
    def A072490(n): return int(sum(mobius(k)*((n-1)//k**2) for k in range(1, isqrt(n-1)+1)))-1 if n>1 else 0 # Chai Wah Wu, Aug 19 2024

Formula

a(n) = A013928(n) - 1, n > 1.
G.f.: (x/(1 - x)) * Sum_{k>=2} mu(k)^2*x^k. - Ilya Gutkovskiy, Sep 14 2019

Extensions

Name clarified and more terms from Ilya Gutkovskiy, Sep 14 2019

A072778 Number of powers of squarefree numbers <= n.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 11, 12, 13, 14, 15, 16, 16, 17, 17, 18, 19, 20, 20, 21, 22, 23, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 34, 35, 36, 37, 37, 37, 38, 39, 39, 40, 40, 41, 41, 42, 42, 43, 43, 44, 45, 46, 46, 47, 48, 48, 49, 50, 51, 52, 52, 53, 54, 55, 55
Offset: 1

Views

Author

Reinhard Zumkeller, Jul 10 2002

Keywords

Crossrefs

Programs

  • Python
    from math import isqrt
    from sympy import mobius, integer_nthroot
    def A072778(n):
        def f(x): return int(sum(mobius(k)*(x//k**2) for k in range(1, isqrt(x)+1)))
        return 2-(m:=n.bit_length())+sum(f(integer_nthroot(n,k)[0]) for k in range(1,m)) # Chai Wah Wu, Aug 19 2024

A072980 Numerator of b(n) = Sum_{k'<=n} 1/k', where k' denotes the squarefree numbers.

Original entry on oeis.org

1, 3, 11, 11, 61, 11, 82, 82, 82, 171, 1951, 1951, 26133, 13424, 41273, 41273, 716656, 716656, 13871719, 13871719, 4700888, 9548741, 222854273, 222854273, 222854273, 112857219, 112857219, 112857219, 3310041496, 20075905417
Offset: 1

Views

Author

Benoit Cloitre, Aug 21 2002

Keywords

Comments

b(n) was used by Niven in the 70's for an alternative proof of the divergence of the sum of reciprocal of primes.

Examples

			Fractions begin with 1, 3/2, 11/6, 11/6, 61/30, 11/5, 82/35, 82/35, 82/35, 171/70, 1951/770, 1951/770, ...
		

Crossrefs

Cf. A005117, A013928, A072983 (denominators), A354417.

Programs

  • Mathematica
    Accumulate[Table[If[SquareFreeQ[n], 1, 0]/n, {n, 1, 50}]] // Numerator (* Amiram Eldar, Apr 22 2025 *)
  • PARI
    a(n) = numerator(sum(k=1, n, issquarefree(k)/k)); \\ Michel Marcus, Nov 28 2013

Formula

a(n) = A354417(A013928(n+1)). - Amiram Eldar, Apr 22 2025

A072983 Denominator of b(n) = Sum_{k'<=n} 1/k', where k' denotes the squarefree numbers.

Original entry on oeis.org

1, 2, 6, 6, 30, 5, 35, 35, 35, 70, 770, 770, 10010, 5005, 15015, 15015, 255255, 255255, 4849845, 4849845, 1616615, 3233230, 74364290, 74364290, 74364290, 37182145, 37182145, 37182145, 1078282205, 6469693230, 200560490130, 200560490130
Offset: 1

Views

Author

Benoit Cloitre, Aug 21 2002

Keywords

Comments

b(n) was used by Niven in the 1970's for an alternative proof of the divergence of the sum of reciprocals of the primes.

Crossrefs

Cf. A005117, A013928, A072980 (numerators), A354418.

Programs

  • Mathematica
    Accumulate[Table[If[SquareFreeQ[n], 1, 0]/n, {n, 1, 50}]] // Denominator (* Amiram Eldar, Apr 22 2025 *)
  • PARI
    a(n)=denominator(sum(k=1,n,issquarefree(k)/k))

Formula

a(n) = A354418(A013928(n+1)). - Amiram Eldar, Apr 22 2025

A160764 a(n) = n-th squarefree number minus round(n*zeta(2)).

Original entry on oeis.org

-1, -1, -2, -2, -2, -3, -2, -2, -2, -2, -3, -3, -2, -2, -3, -3, -2, -1, -1, -2, -2, -2, -3, -2, -3, -4, -3, -4, -5, -3, -4, -2, -1, -1, -1, -1, -2, -2, -2, -1, -1, -2, -2, -2, -3, -3, -3, -2, -3, -3, -2, -3, -2, -3, -3, -3, -3, -2, -3, -4, -3, -1, -2, -2, -2, -3, -3, -3, -4
Offset: 1

Views

Author

Daniel Forgues, May 26 2009

Keywords

Comments

Race between the n-th squarefree number and round(n*zeta(2)).

Crossrefs

Cf. A005117 Squarefree numbers.
Cf. A013929 Nonsquarefree numbers.
Cf. A013928 Number of squarefree numbers < n.
Cf. A158819 Number of squarefree numbers <= n minus round(n/zeta(2)).

Formula

Since zeta(2) = Sum_{i>=1}, 1/(i^2) = (Pi^2)/6, we get:
a(n) = A005117(n) - n * Sum_{i>=1}, 1/(i^2) = O(sqrt(n));
a(n) = A005117(n) - n * (Pi^2)/6 = O(sqrt(n)).

A238646 Number of primes p < n such that the number of squarefree numbers among 1, ..., n-p is prime.

Original entry on oeis.org

0, 0, 0, 1, 2, 2, 2, 2, 3, 1, 2, 1, 3, 1, 3, 1, 4, 2, 3, 2, 5, 4, 5, 1, 3, 3, 4, 2, 5, 3, 4, 5, 8, 3, 5, 1, 5, 5, 7, 3, 5, 2, 6, 3, 6, 6, 9, 4, 8, 7, 7, 6, 7, 4, 6, 7, 8, 5, 6, 4, 7, 8, 9, 6, 6, 6, 9, 5, 7, 4, 8, 6, 10, 6, 5, 8, 11, 7, 10, 6
Offset: 1

Views

Author

Zhi-Wei Sun, Mar 02 2014

Keywords

Comments

Conjecture: a(n) > 0 for all n > 3, and a(n) = 1 only for n = 4, 10, 12, 14, 16, 24, 36.
This is analog of the conjecture in A237705 for squarefree numbers.
We have verified the conjecture for n up to 60000.

Examples

			a(10) = 1 since 7 and 3 are both prime, and there are exactly 3 squarefree numbers among 1, ..., 10-7.
a(36) = 1 since 17 and 13 are both prime, and there are exactly 13 squarefree numbers among 1, ..., 36-17 (namely, 1, 2, 3, 5, 6, 7, 10, 11, 13, 14, 15, 17, 19).
		

Crossrefs

Programs

  • Mathematica
    s[n_]:=Sum[If[SquareFreeQ[k],1,0],{k,1,n}]
    a[n_]:=Sum[If[PrimeQ[s[n-Prime[k]]],1,0],{k,1,PrimePi[n-1]}]
    Table[a[n],{n,1,80}]

A245268 Sum of binomial(n,k) over squarefree k.

Original entry on oeis.org

1, 3, 7, 14, 26, 48, 92, 184, 375, 758, 1497, 2884, 5461, 10286, 19507, 37584, 73866, 147987, 301075, 618794, 1278116, 2640993, 5439593, 11138764, 22640100, 45644797, 91293390, 181301470, 358024924, 704359427, 1383415456, 2718141072, 5351701032, 10570658330
Offset: 1

Views

Author

Eric M. Schmidt, Jul 15 2014

Keywords

Crossrefs

Programs

  • Mathematica
    a[n_] := Sum[Binomial[n, k], {k, Select[Range[n], SquareFreeQ]}]; Array[a, 34] (* Amiram Eldar, May 25 2025 *)
  • PARI
    a(n) = sum(k=1, n, if (issquarefree(k), binomial(n,k), 0)); \\ Michel Marcus, Jul 16 2014
  • Sage
    def A235268(n) : return sum(binomial(n,k) for k in range(1,n+1) if is_squarefree(k))
    

Formula

a(n) ~ 2^n/zeta(2). [Take p = 1/2 in Nymann and Leahey.]

A245269 Sum of binomial(n,k) over cubefree k.

Original entry on oeis.org

1, 3, 7, 15, 31, 63, 127, 254, 502, 978, 1882, 3600, 6904, 13380, 26332, 52664, 106744, 218232, 447736, 917760, 1873312, 3799920, 7653136, 15306272, 30429856, 60234528, 118956831, 234885092, 464595690, 921868388, 1836393687, 3672648928, 7369572624, 14821243232
Offset: 1

Views

Author

Eric M. Schmidt, Jul 15 2014

Keywords

Crossrefs

Programs

  • Mathematica
    cubeFreeQ[n_] := AllTrue[FactorInteger[n][[;; , 2]], # < 3 &]; a[n_] := Sum[Binomial[n, k], {k, Select[Range[n], cubeFreeQ]}]; Array[a, 34] (* Amiram Eldar, May 25 2025 *)
  • Sage
    def A245269(n) : return sum(binomial(n,k) for k in range(1,n+1) if all(m <= 2 for (p,m) in factor(k)))

Formula

a(n) ~ 2^n/zeta(3). [Take p = 1/2 in Nymann and Leahey.]
Previous Showing 81-90 of 104 results. Next