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.

Showing 1-8 of 8 results.

A076259 Gaps between squarefree numbers: a(n) = A005117(n+1) - A005117(n).

Original entry on oeis.org

1, 1, 2, 1, 1, 3, 1, 2, 1, 1, 2, 2, 2, 1, 1, 3, 3, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 3, 1, 4, 2, 2, 2, 1, 1, 2, 1, 3, 1, 1, 2, 1, 1, 2, 1, 3, 1, 1, 3, 1, 2, 1, 1, 2, 2, 2, 1, 1, 2, 4, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 3, 1, 3, 1, 4, 2, 1, 1, 2, 1, 3, 1, 1, 2, 1, 1, 2, 1, 3, 2, 3, 1, 2, 1, 1, 2, 2, 2, 1, 1, 3, 3, 1
Offset: 1

Views

Author

Reinhard Zumkeller, Oct 03 2002

Keywords

Comments

This sequence is unbounded, as a simple consequence of the Chinese remainder theorem. - Thomas Ordowski, Jul 22 2015
Conjecture: lim sup_{n->oo} a(n)/log(A005117(n)) = 1/2. - Thomas Ordowski, Jul 23 2015 [Note: this conjecture is equivalent to lim sup a(n)/log n = 1/2. - Charles R Greathouse IV, Dec 05 2024]
a(n) = 1 infinitely often since the density of the squarefree numbers, 6/Pi^2, is greater than 1/2. In particular, at least 2 - Pi^2/6 = 35.5...% of the terms are 1. - Charles R Greathouse IV, Jul 23 2015
From Amiram Eldar, Mar 09 2021: (Start)
The asymptotic density of the occurrences of 1 in this sequence is density(A007674)/density(A005117) = A065474/A059956 = 0.530711... (A065469).
The asymptotic density of the occurrences of 2 in this sequence is (density(A069977)-density(A007675))/density(A005117) = (A065474-A206256)/A059956 = 0.324294... (End)

Examples

			As 24 = 3*2^3 and 25 = 5^2, the next squarefree number greater A005117(16) = 23 is A005117(17) = 26, therefore a(16) = 26-23 = 3.
		

Crossrefs

Programs

  • Haskell
    a076259 n = a076259_list !! (n-1)
    a076259_list = zipWith (-) (tail a005117_list) a005117_list
    -- Reinhard Zumkeller, Aug 03 2012
    
  • Maple
    A076259 := proc(n) A005117(n+1)-A005117(n) ; end proc: # R. J. Mathar, Jan 09 2013
  • Mathematica
    Select[Range[200], SquareFreeQ] // Differences (* Jean-François Alcover, Mar 10 2019 *)
  • PARI
    t=1; for(n=2,1e3, if(issquarefree(n), print1(n-t", "); t=n)) \\ Charles R Greathouse IV, Jul 23 2015
    
  • Python
    from math import isqrt
    from sympy import mobius
    def A076259(n):
        def f(x): return n+x-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)
        r, k = n+1, f(n+1)+1
        while r != k:
            r, k = k, f(k)+1
        return int(r-m) # Chai Wah Wu, Aug 15 2024

Formula

Asymptotic mean: lim_{n->oo} (1/n) Sum_{k=1..n} a(k) = Pi^2/6 (A013661). - Amiram Eldar, Oct 21 2020
a(n) < n^(1/5) for large enough n by a result of Pandey. (The constant Pi^2/6 can be absorbed by any eta > 0.) - Charles R Greathouse IV, Dec 04 2024

A076479 a(n) = mu(rad(n)), where mu is the Moebius-function (A008683) and rad is the radical or squarefree kernel (A007947).

Original entry on oeis.org

1, -1, -1, -1, -1, 1, -1, -1, -1, 1, -1, 1, -1, 1, 1, -1, -1, 1, -1, 1, 1, 1, -1, 1, -1, 1, -1, 1, -1, -1, -1, -1, 1, 1, 1, 1, -1, 1, 1, 1, -1, -1, -1, 1, 1, 1, -1, 1, -1, 1, 1, 1, -1, 1, 1, 1, 1, 1, -1, -1, -1, 1, 1, -1, 1, -1, -1, 1, 1, -1, -1, 1, -1, 1, 1, 1, 1, -1, -1, 1, -1, 1, -1, -1, 1, 1, 1
Offset: 1

Views

Author

Reinhard Zumkeller, Oct 14 2002

Keywords

Comments

Multiplicative: a(1) = 1, a(n) for n >=2 is sign of parity of number of distinct primes dividing n. a(p) = -1, a(pq) = 1, a(pq...z) = (-1)^k, a(p^k) = -1, where p,q,.. z are distinct primes and k natural numbers. - Jaroslav Krizek, Mar 17 2009
a(n) is the unitary Moebius function, i.e., the inverse of the constant 1 function under the unitary convolution defined by (f X g)(n)= sum of f(d)g(n/d), where the sum is over the unitary divisors d of n (divisors d of n such that gcd(d,n/d)=1). - Laszlo Toth, Oct 08 2009

Crossrefs

Programs

  • Haskell
    a076479 = a008683 . a007947  -- Reinhard Zumkeller, Jun 01 2013
    
  • Magma
    [(-1)^(#PrimeDivisors(n)): n in [1..100]]; // Vincenzo Librandi, Dec 31 2018
    
  • Maple
    A076479 := proc(n)
        (-1)^A001221(n) ;
    end proc:
    seq(A076479(n),n=1..80) ; # R. J. Mathar, Nov 02 2016
  • Mathematica
    Table[(-1)^PrimeNu[n], {n,50}] (* Enrique Pérez Herrero, Jan 17 2013 *)
  • PARI
    N=66;
    mu=vector(N); mu[1]=1;
    { for (n=2,N,
        s = 0;
        fordiv (n,d,
            if (gcd(d,n/d)!=1, next() ); /* unitary divisors only */
            s += mu[d];
        );
        mu[n] = -s;
    ); };
    mu /* Joerg Arndt, May 13 2011 */
    /* omitting the line if ( gcd(...)) gives the usual Moebius function */
    
  • PARI
    a(n)=(-1)^omega(n) \\ Charles R Greathouse IV, Aug 02 2013
    
  • Python
    from math import prod
    from sympy.ntheory import mobius, primefactors
    def A076479(n): return mobius(prod(primefactors(n))) # Chai Wah Wu, Sep 24 2021

Formula

a(n) = A008683(A007947(n)).
a(n) = (-1)^A001221(n). Multiplicative with a(p^e) = -1. - Vladeta Jovovic, Dec 03 2002
a(n) = sign(A180403(n)). - Mats Granvik, Oct 08 2010
Sum_{n>=1} a(n)*phi(n)/n^3 = A065463 with phi()=A000010() [Cohen, Lemma 3.5]. - R. J. Mathar, Apr 11 2011
Dirichlet convolution of A000012 with A226177 (signed variant of A074823 with one factor mu(n) removed). - R. J. Mathar, Apr 19 2011
Sum_{n>=1} a(n)/n^2 = A065469. - R. J. Mathar, Apr 19 2011
a(n) = Sum_{d|n} mu(d)*tau_2(d) = Sum_{d|n} A008683(d)*A000005(d) . - Enrique Pérez Herrero, Jan 17 2013
a(A030230(n)) = -1; a(A030231(n)) = +1. - Reinhard Zumkeller, Jun 01 2013
Dirichlet g.f.: zeta(s) * Product_{p prime} (1 - 2p^(-s)). - Álvar Ibeas, Dec 30 2018
Sum_{n>=1} a(n)/n = 0 (van de Lune and Dressler, 1975). - Amiram Eldar, Mar 05 2021
From Richard L. Ollerton, May 07 2021: (Start)
For n>1, Sum_{k=1..n} a(gcd(n,k))*phi(gcd(n,k))*rad(gcd(n,k))/gcd(n,k) = 0.
For n>1, Sum_{k=1..n} a(n/gcd(n,k))*phi(gcd(n,k))*rad(n/gcd(n,k))*gcd(n,k) = 0. (End)
a(n) = Sum_{d1|n} Sum_{d2|n} mu(d1*d2). - Ridouane Oudra, May 25 2023

A084920 a(n) = (prime(n)-1)*(prime(n)+1).

Original entry on oeis.org

3, 8, 24, 48, 120, 168, 288, 360, 528, 840, 960, 1368, 1680, 1848, 2208, 2808, 3480, 3720, 4488, 5040, 5328, 6240, 6888, 7920, 9408, 10200, 10608, 11448, 11880, 12768, 16128, 17160, 18768, 19320, 22200, 22800, 24648, 26568, 27888, 29928
Offset: 1

Views

Author

Reinhard Zumkeller, Jun 11 2003

Keywords

Comments

Squares of primes minus 1. - Wesley Ivan Hurt, Oct 11 2013
Integers k for which there exist exactly two positive integers b such that (k+1)/(b+1) is an integer. - Benedict W. J. Irwin, Jul 26 2016

Crossrefs

Programs

Formula

a(n) = A006093(n) * A008864(n);
a(n) = A084921(n)*2, for n > 1; a(n) = A084922(n)*6, for n > 2.
Product_{n > 0} a(n)/A066872(n) = 2/5. a(n) = A001248(n) - 1. - R. J. Mathar, Feb 01 2009
a(n) = prime(n)^2 - 1 = A001248(n) - 1. - Vladimir Joseph Stephan Orlovsky, Oct 17 2009
a(n) ~ n^2*log(n)^2. - Ilya Gutkovskiy, Jul 28 2016
a(n) = (1/2) * Sum_{|k|<=2*sqrt(p)} k^2*H(4*p-k^2) where H() is the Hurwitz class number and p is n-th prime. - Seiichi Manyama, Dec 31 2017
a(n) = 24 * A024702(n) for n > 2. - Jianing Song, Apr 28 2019
Sum_{n>=1} 1/a(n) = A154945. - Amiram Eldar, Nov 09 2020
From Amiram Eldar, Nov 07 2022: (Start)
Product_{n>=1} (1 + 1/a(n)) = Pi^2/6 (A013661).
Product_{n>=1} (1 - 1/a(n)) = A065469. (End)

A375927 Numbers k such that A005117(k+1) - A005117(k) = 1. In other words, the k-th squarefree number is 1 less than the next.

Original entry on oeis.org

1, 2, 4, 5, 7, 9, 10, 14, 15, 18, 19, 21, 22, 24, 25, 27, 28, 30, 35, 36, 38, 40, 41, 43, 44, 46, 48, 49, 51, 53, 54, 58, 59, 62, 63, 65, 66, 68, 69, 71, 72, 74, 76, 79, 80, 82, 84, 85, 87, 88, 90, 94, 96, 97, 101, 102, 105, 107, 108, 110, 111, 113, 114, 116
Offset: 1

Views

Author

Gus Wiseman, Sep 12 2024

Keywords

Comments

The asymptotic density of this sequence is Product_{p prime} (1 - 1/(p^2-1)) = 0.53071182... (A065469). - Amiram Eldar, Sep 15 2024

Examples

			The squarefree numbers are 1, 2, 3, 5, 6, 7, 10, 11, 13, 14, 15, 17, 19, 21, 22, 23, 26, 29, 30, ... which first increase by one after terms 1, 2, 4, 5, ...
		

Crossrefs

Positions of 1's in A076259.
For prime-powers (A246655) we have A375734.
First differences are A373127.
For nonsquarefree instead of squarefree we have A375709.
For nonprime numbers we have A375926, differences A373403.
For composite numbers we have A375929.
The complement is A375930, differences A120992.
A005117 lists the squarefree numbers, first differences A076259.
A013929 lists the nonsquarefree numbers, first differences A078147.
A053797 gives lengths of runs of nonsquarefree numbers, firsts A373199.
A375707 counts squarefree numbers between consecutive nonsquarefree numbers.

Programs

  • Mathematica
    Join@@Position[Differences[Select[Range[100],SquareFreeQ[#]&]],1]
  • PARI
    lista(kmax) = {my(is1 = 1, is2, c = 1); for(k = 2, kmax, is2 = issquarefree(k); if(is2, c++); if(is1 && is2, print1(c-1, ", ")); is1 = is2);} \\ Amiram Eldar, Sep 15 2024

A368249 a(n) = A002378(A005117(n)-1).

Original entry on oeis.org

0, 2, 6, 20, 30, 42, 90, 110, 156, 182, 210, 272, 342, 420, 462, 506, 650, 812, 870, 930, 1056, 1122, 1190, 1332, 1406, 1482, 1640, 1722, 1806, 2070, 2162, 2550, 2756, 2970, 3192, 3306, 3422, 3660, 3782, 4160, 4290, 4422, 4692, 4830, 4970, 5256, 5402, 5852, 6006
Offset: 1

Views

Author

Amiram Eldar, Dec 19 2023

Keywords

Comments

The squarefree oblong numbers (A229882) are all terms of this sequence, and their relative asymptotic density in it is A065474/A059956 = 0.530711... (A065469).

Crossrefs

Programs

  • Mathematica
    Table[n*(n - 1), {n, Select[Range[100], SquareFreeQ]}]
  • PARI
    lista(kmax) = forsquarefree(k=1, kmax, print1(k[1]*(k[1]-1), ", "));
    
  • Python
    from math import isqrt
    from sympy import mobius
    def A368249(n):
        def f(x): return int(n-sum(mobius(k)*(x//k**2) for k in range(2, isqrt(x)+1)))
        m, k = n, f(n)
        while m != k: m, k = k, f(k)
        return m*(m-1) # Chai Wah Wu, Dec 23 2024

Formula

Sum_{n>=2} 1/a(n) = Sum_{k>=2} (zeta(k)/zeta(2*k) - 1) = 0.848633... (A368250).

A306408 a(n) = Sum_{d|n} (-1)^omega(n/d) * d.

Original entry on oeis.org

1, 1, 2, 1, 4, 2, 6, 1, 5, 4, 10, 2, 12, 6, 8, 1, 16, 5, 18, 4, 12, 10, 22, 2, 19, 12, 14, 6, 28, 8, 30, 1, 20, 16, 24, 5, 36, 18, 24, 4, 40, 12, 42, 10, 20, 22, 46, 2, 41, 19, 32, 12, 52, 14, 40, 6, 36, 28, 58, 8, 60, 30, 30, 1, 48, 20, 66, 16, 44, 24, 70, 5, 72
Offset: 1

Views

Author

Daniel Suteu, Apr 05 2019

Keywords

Comments

If n is squarefree (A005117), then a(n) = A000010(n) where A000010 is the Euler totient function.

Crossrefs

Programs

  • Maple
    with(numtheory): omega := n -> nops(factorset(n)):
    seq(add((-1)^omega(n/d)*d, d in divisors(n)), n=1..100); # Ridouane Oudra, Nov 24 2019
  • Mathematica
    f[p_, e_] := p^e - (p^e - 1)/(p - 1); a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, May 01 2020 *)
  • PARI
    a(n) = sumdiv(n, d, (-1)^omega(n/d) * d);
    
  • PARI
    a(n) = my(f=factor(n)); prod(k=1, #f~, f[k,1]^f[k,2] - (f[k,1]^f[k,2] - 1)/(f[k,1]-1));

Formula

a(n) = n * Sum_{d|n} A076479(d)/d.
Sum_{k=1..n} a(k) ~ A065469 * n*(n+1)/2.
Multiplicative with a(p^e) = p^e - (p^e - 1)/(p-1).
a(n) = Sum_{d|n} mu(d)*tau(d)*sigma(n/d). - Ridouane Oudra, Nov 24 2019
a(n) = Sum_{d|n} A058026(d). - Amiram Eldar, May 01 2020

A375930 Numbers k such that A005117(k+1) - A005117(k) > 1. In other words, the k-th squarefree number is more than 1 less than the next.

Original entry on oeis.org

3, 6, 8, 11, 12, 13, 16, 17, 20, 23, 26, 29, 31, 32, 33, 34, 37, 39, 42, 45, 47, 50, 52, 55, 56, 57, 60, 61, 64, 67, 70, 73, 75, 77, 78, 81, 83, 86, 89, 91, 92, 93, 95, 98, 99, 100, 103, 104, 106, 109, 112, 115, 117, 120, 121, 122, 125, 127, 130, 133, 136, 139
Offset: 1

Views

Author

Gus Wiseman, Sep 12 2024

Keywords

Comments

The asymptotic density of this sequence is 1 - Product_{p prime} (1 - 1/(p^2-1)) = 1 - A065469 = 0.46928817... . - Amiram Eldar, Sep 15 2024

Examples

			The squarefree numbers are 1, 2, 3, 5, 6, 7, 10, 11, 13, 14, 15, 17, 19, 21, 22, 23, 26, 29, 30, ... which first increase by more than one after positions 3, 6, 8, 11, ...
		

Crossrefs

For nonprime numbers: A014689, complement A375926, differences A373403.
For composite numbers: A065890 shifted, complement A375929.
Positions of terms > 1 in A076259.
First differences are A120992, complement A373127.
The complement is A375927.
A005117 lists the squarefree numbers, first differences A076259.
A013929 lists the nonsquarefree numbers, first differences A078147.
A053797 gives lengths of runs of nonsquarefree numbers, firsts A373199.

Programs

  • Mathematica
    Join@@Position[Differences[Select[Range[100],SquareFreeQ[#]&]],_?(#>1&)]
  • PARI
    lista(kmax) = {my(is1 = 1, is2, c = 1); for(k = 2, kmax, is2 = issquarefree(k); if(is2, c++); if(is1 && !is2, print1(c, ", ")); is1 = is2);} \\ Amiram Eldar, Sep 15 2024

A072101 Continued fraction expansion of Product_{p prime} (1 - 1/(p^2-1)).

Original entry on oeis.org

0, 1, 1, 7, 1, 1, 1, 3, 1, 1, 7, 1, 15, 1, 1, 5, 1, 1, 6, 1, 1, 12, 2, 1, 52, 6, 3, 2, 1, 7, 1, 1, 4, 2, 1, 5, 1, 1, 1, 7, 2, 1, 5, 1, 13, 3, 1, 1, 4161, 1, 1, 1, 9, 4, 6, 1, 12, 2, 9, 3, 1, 4, 3, 1, 6, 3, 2, 1, 3, 4, 2, 2, 3, 93, 3, 1, 10, 1, 2, 1, 7, 4, 4, 2, 1, 1, 2, 2, 10, 1, 1, 2, 3, 3, 1, 1, 3, 1
Offset: 0

Views

Author

Robert G. Wilson v, Jun 18 2002

Keywords

Crossrefs

Cf. A065469.

Programs

  • Mathematica
    (* c= the value at the link above; *) ContinuedFraction[c, 100]
  • PARI
    contfrac(prodeulerrat(1 - 1/(p^2-1))) \\ Amiram Eldar, Mar 13 2021
Showing 1-8 of 8 results.