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.

A067874 Positive integers x satisfying x^2 - D*y^2 = 1 for a unique integer D.

Original entry on oeis.org

2, 4, 6, 12, 14, 16, 18, 20, 22, 30, 32, 34, 36, 38, 40, 42, 52, 54, 56, 58, 60, 66, 68, 70, 72, 78, 84, 86, 88, 90, 92, 94, 96, 102, 104, 106, 108, 110, 112, 114, 128, 130, 132, 138, 140, 142, 144, 150, 156, 158, 160, 162, 164, 166, 178, 180, 182, 184, 186, 192, 194, 196, 198
Offset: 1

Views

Author

Lekraj Beedassy, Feb 25 2002

Keywords

Comments

D is unique iff x^2 - 1 is squarefree, in which case it follows with necessity that D=x^2-1 and y=1.
All terms are even. A014574 is a subsequence.
Conjecture: All terms of A002110 > 1 are a subsequence. - Griffin N. Macris, Apr 11 2016
All n such that n+1 and n-1 are in A056911. - Robert Israel, Apr 12 2016
The asymptotic density of this sequence is Product_{p prime} (1 - 2/p^2) = 0.322634... (A065474). - Amiram Eldar, Feb 25 2021

Crossrefs

Cf. A002110, A005117, A014574, A056911, A065474, A226993, A272799, A280892, A379971 (characteristic function).
Subsequence of A379965.

Programs

  • Magma
    [n: n in [1..110] | IsSquarefree(n-1) and IsSquarefree(n+1)]; // Juri-Stepan Gerasimov, Jan 17 2017
    
  • Maple
    select(t -> numtheory:-issqrfree(t^2-1), [seq(n,n=2..1000,2)]); # Robert Israel, Apr 12 2016
  • Mathematica
    Select[Range[200], SquareFreeQ[#^2-1]&] (* Vladimir Joseph Stephan Orlovsky, Oct 26 2009 *)
  • Python
    from itertools import count, islice
    from sympy import factorint
    def A067874_gen(startvalue=2): # generator of terms >= startvalue
        return filter(lambda k:max(factorint(k-1).values(),default=1)==1 and max(factorint(k+1).values())==1, count(max(startvalue+(startvalue&1),2),2))
    A067874_list = list(islice(A067874_gen(),20)) # Chai Wah Wu, Apr 24 2024

Formula

a(n) = 2*A272799(n). - Juri-Stepan Gerasimov, Jan 17 2017

Extensions

Corrected and extended by Max Alekseyev, Apr 26 2009
Further edited by Max Alekseyev, Apr 28 2009

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.