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-2 of 2 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

A272799 Numbers k such that 2*k - 1 and 2*k + 1 are squarefree.

Original entry on oeis.org

1, 2, 3, 6, 7, 8, 9, 10, 11, 15, 16, 17, 18, 19, 20, 21, 26, 27, 28, 29, 30, 33, 34, 35, 36, 39, 42, 43, 44, 45, 46, 47, 48, 51, 52, 53, 54, 55, 56, 57, 64, 65, 66, 69, 70, 71, 72, 75, 78, 79, 80, 81, 82, 83, 89, 90, 91, 92, 93, 96, 97, 98, 99, 100, 101, 102, 105, 106, 107, 108, 109, 110
Offset: 1

Views

Author

Juri-Stepan Gerasimov, May 06 2016

Keywords

Comments

The asymptotic density of this sequence is 2 * Product_{p prime} (1 - 2/p^2) = 2 * A065474 = 0.645268... . - Amiram Eldar, Feb 10 2021

Examples

			a(1) = 1 because 2*1 - 1 = 1 is squarefree and 2*1 + 1 = 3 is squarefree.
		

Crossrefs

Programs

  • Magma
    [n: n in [1..110] | IsSquarefree(2*n-1) and IsSquarefree(2*n+1)];
    
  • Maple
    Res:=  NULL: count:= 0: state:= 1;
    for n from 1 while count < 100 do
      if numtheory:-issqrfree(2*n+1) then
        if state = 1 then Res:= Res, n; count:= count+1;
        else
          state:= 1;
        fi
      else
        state:= 0;
      fi
    od:
    Res; # Robert Israel, Apr 15 2019
  • Mathematica
    Select[Range[12^4], And[Or[# == 1, GCD @@ FactorInteger[#][[All, 2]] > 1], SquareFreeQ[# - 1], SquareFreeQ[# + 1]] &] (* Michael De Vlieger, May 08 2016 *)
  • PARI
    is(n)=issquarefree(2*n-1) && issquarefree(2*n+1) \\ Charles R Greathouse IV, May 15 2016
    
  • Python
    from itertools import count, islice
    from sympy import factorint
    def A272799_gen(startvalue=1): # generator of terms >= startvalue
        return filter(lambda k:max(factorint((k<<1)-1).values(),default=1)==1 and max(factorint((k<<1)+1).values())==1, count(max(startvalue,1)))
    A272799_list = list(islice(A272799_gen(),20)) # Chai Wah Wu, Apr 24 2024

Formula

a(n) = (A069977(n)+1)/2. - Charles R Greathouse IV, May 15 2016
Showing 1-2 of 2 results.