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-5 of 5 results.

A184774 Primes of the form floor(k*sqrt(2)).

Original entry on oeis.org

2, 5, 7, 11, 19, 29, 31, 41, 43, 53, 59, 67, 73, 79, 83, 89, 97, 101, 103, 107, 113, 127, 131, 137, 149, 151, 173, 179, 181, 193, 197, 199, 223, 227, 229, 233, 239, 241, 251, 257, 263, 271, 277, 281, 311, 313, 337, 347, 349, 353, 359, 367, 373, 379, 383, 397
Offset: 1

Views

Author

Clark Kimberling, Jan 21 2011

Keywords

Comments

Let N={1,2,...}, L={floor(n*sqrt(2)): n in N} and U={2n+L(n): n in N}. Every prime is in L or U, since the union of the (disjoint) sets L and U is N.
The conjecture formerly posted here, that "if r is an irrational number and 1
Note that every prime not in L is in U={floor(n*s)}, where s=r/(r-1). That is, Beatty sequences partition the primes into two infinite classes.
The conjecture generalized: if r is a positive irrational number and h is a real number, then each of the sets {floor(n*r+h)}, {round(n*r+h)}, and {ceiling(n*r+h)} contains infinitely many primes. Can the method in Vinogradov be extended to cover these cases?
[Update regarding the conjecture from Clark Kimberling, Jan 03 2011.]

Examples

			The sequence L(n)=floor(n*sqrt(2)) begins with 1, 2, 4, 5, 7, 8, 9, 11, 12, 14, 15, 16, 18, 19,..., which includes primes L(2)=2, L(4)=5, L(5)=7,...
		

Crossrefs

Cf. A001951 (Beatty sequence of sqrt(2)), A001952 (Beatty sequence of 2+sqrt(2)), A184775, A184776, A184777, A184778, A184779.

Programs

  • Magma
    [Floor(n*Sqrt(2)): n in [1..400] | IsPrime(Floor(n*Sqrt(2)))]; // Vincenzo Librandi, Apr 30 2015
    
  • Mathematica
    r=2^(1/2); s=r/(r-1);
    a[n_]:=Floor [n*r];  (* A001951 *)
    b[n_]:=Floor [n*s];  (* A001952 *)
    Table[a[n],{n,1,120}]
    t1={}; Do[If[PrimeQ[a[n]], AppendTo[t1,a[n]]], {n,1,600}]; t1
    t2={}; Do[If[PrimeQ[a[n]], AppendTo[t2,n]], {n,1,600}]; t2
    t3={}; Do[If[MemberQ[t1, Prime[n]], AppendTo[t3,n]],{n,1,300}]; t3
    t4={}; Do[If[PrimeQ[b[n]], AppendTo[t4,b[n]]],{n,1,600}]; t4
    t5={}; Do[If[PrimeQ[b[n]], AppendTo[t5,n]],{n,1,600}]; t5
    t6={}; Do[If[MemberQ[t4, Prime[n]], AppendTo[t6,n]],{n,1,300}]; t6
    (* the lists t1,t2,t3,t4,t5,t6 match the sequences
    A184774, A184775, A184776, A184777, A184778, A184779 *)
    Select[Floor[Range[500]Sqrt[2]],PrimeQ] (* Harvey P. Dale, Jan 05 2019 *)
  • PARI
    is(n)=my(k=sqrtint(n^2\2)+1); sqrtint(2*k^2)==n && isprime(n) \\ Charles R Greathouse IV, Apr 29 2015
    
  • Python
    from math import isqrt
    from itertools import count, islice
    from sympy import isprime
    def A184774_gen(): # generator of terms
        return filter(isprime,(isqrt(k**2<<1) for k in count(1)))
    A184774_list = list(islice(A184774_gen(),25)) # Chai Wah Wu, Jul 28 2022

Formula

a(n) ~ sqrt(2)*n log n. - Charles R Greathouse IV, Apr 29 2015

A184778 Numbers k such that 2k + floor(k*sqrt(2)) is prime.

Original entry on oeis.org

1, 4, 5, 7, 11, 14, 18, 21, 32, 41, 46, 48, 49, 56, 62, 79, 83, 86, 90, 93, 97, 114, 120, 123, 127, 130, 134, 137, 144, 165, 169, 172, 178, 181, 185, 188, 213, 220, 222, 223, 237, 243, 246, 250, 253, 257, 260, 267, 288, 302, 308, 311, 325, 329, 343, 346, 352, 360, 366, 369, 376
Offset: 1

Author

Clark Kimberling, Jan 21 2011

Keywords

Examples

			See A184774.
		

Crossrefs

Programs

  • Mathematica
    r=2^(1/2); s=r/(r-1);
    a[n_]:=Floor [n*r];  (* A001951 *)
    b[n_]:=Floor [n*s];  (* A001952 *)
    Table[a[n],{n,1,120}]
    t1={}; Do[If[PrimeQ[a[n]], AppendTo[t1,a[n]]], {n,1,600}]; t1
    t2={}; Do[If[PrimeQ[a[n]], AppendTo[t2,n]], {n,1,600}]; t2
    t3={}; Do[If[MemberQ[t1, Prime[n]], AppendTo[t3,n]],{n,1,300}]; t3
    t4={}; Do[If[PrimeQ[b[n]], AppendTo[t4,b[n]]],{n,1,600}]; t4
    t5={}; Do[If[PrimeQ[b[n]], AppendTo[t5,n]],{n,1,600}]; t5
    t6={}; Do[If[MemberQ[t4, Prime[n]], AppendTo[t6,n]],{n,1,300}]; t6
    (* the lists t1,t2,t3,t4,t5,t6 match the sequences
    A184774, A184775, A184776 ,A184777, A184778, A184779 *)
  • PARI
    is(n)=isprime(sqrtint(2*n^2)+2*n) \\ Charles R Greathouse IV, May 22 2017
    
  • Python
    from itertools import count, islice
    from math import isqrt
    from sympy import isprime
    def A184778_gen(): # generator of terms
        return filter(lambda k:isprime((k<<1)+isqrt(k**2<<1)), count(1))
    A184778_list = list(islice(A184778_gen(),25)) # Chai Wah Wu, Jul 28 2022

A184775 Numbers k such that floor(k*sqrt(2)) is prime.

Original entry on oeis.org

2, 4, 5, 8, 14, 21, 22, 29, 31, 38, 42, 48, 52, 56, 59, 63, 69, 72, 73, 76, 80, 90, 93, 97, 106, 107, 123, 127, 128, 137, 140, 141, 158, 161, 162, 165, 169, 171, 178, 182, 186, 192, 196, 199, 220, 222, 239, 246, 247, 250, 254, 260, 264, 268, 271, 281, 284, 298, 305, 311, 318
Offset: 1

Author

Clark Kimberling, Jan 21 2011

Keywords

Comments

Chua, Park, & Smith prove a general result that implies that, for any m, there is a constant C(m) such that a(n+m) - a(n) < C(m) infinitely often. - Charles R Greathouse IV, Jul 01 2022

Examples

			See A184774.
		

Crossrefs

Programs

  • Mathematica
    r=2^(1/2); s=r/(r-1);
    a[n_]:=Floor [n*r];  (* A001951 *)
    b[n_]:=Floor [n*s];  (* A001952 *)
    Table[a[n],{n,1,120}]
    t1={}; Do[If[PrimeQ[a[n]], AppendTo[t1,a[n]]], {n,1,600}]; t1
    t2={}; Do[If[PrimeQ[a[n]], AppendTo[t2,n]], {n,1,600}]; t2
    t3={}; Do[If[MemberQ[t1, Prime[n]], AppendTo[t3,n]],{n,1,300}]; t3
    t4={}; Do[If[PrimeQ[b[n]], AppendTo[t4,b[n]]],{n,1,600}]; t4
    t5={}; Do[If[PrimeQ[b[n]], AppendTo[t5,n]],{n,1,600}]; t5
    t6={}; Do[If[MemberQ[t4, Prime[n]], AppendTo[t6,n]],{n,1,300}]; t6
    (* the lists t1,t2,t3,t4,t5,t6 match the sequences
    A184774, A184775, A184776 ,A184777, A184778, A184779 *)
  • PARI
    isok(n) = isprime(floor(n*sqrt(2))); \\ Michel Marcus, Apr 10 2018
    
  • PARI
    is(n)=isprime(sqrtint(2*n^2)) \\ Charles R Greathouse IV, Jul 01 2022
    
  • Python
    from itertools import count, islice
    from math import isqrt
    from sympy import isprime
    def A184775_gen(): # generator of terms
        return filter(lambda k:isprime(isqrt(k**2<<1)), count(1))
    A184775_list = list(islice(A184775_gen(),25)) # Chai Wah Wu, Jul 28 2022

A184776 Numbers m such that prime(m) is of the form floor(k*sqrt(2)); complement of A184779.

Original entry on oeis.org

1, 3, 4, 5, 8, 10, 11, 13, 14, 16, 17, 19, 21, 22, 23, 24, 25, 26, 27, 28, 30, 31, 32, 33, 35, 36, 40, 41, 42, 44, 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 58, 59, 60, 64, 65, 68, 69, 70, 71, 72, 73, 74, 75, 76, 78, 79, 82, 83, 85, 87, 89, 90, 92, 93, 95, 96, 97, 98, 99, 100, 101, 102, 104, 105, 108, 109, 110, 112, 114, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 130, 131, 132, 136, 137, 138, 139, 141, 142, 143, 144
Offset: 1

Author

Clark Kimberling, Jan 21 2011

Keywords

Examples

			See A184774.
		

Crossrefs

Programs

  • Mathematica
    r=2^(1/2); s=r/(r-1);
    a[n_]:=Floor [n*r];  (* A001951 *)
    b[n_]:=Floor [n*s];  (* A001952 *)
    Table[a[n],{n,1,120}]
    t1={}; Do[If[PrimeQ[a[n]], AppendTo[t1,a[n]]], {n,1,600}]; t1
    t2={}; Do[If[PrimeQ[a[n]], AppendTo[t2,n]], {n,1,600}]; t2
    t3={}; Do[If[MemberQ[t1, Prime[n]], AppendTo[t3,n]],{n,1,300}]; t3
    t4={}; Do[If[PrimeQ[b[n]], AppendTo[t4,b[n]]],{n,1,600}]; t4
    t5={}; Do[If[PrimeQ[b[n]], AppendTo[t5,n]],{n,1,600}]; t5
    t6={}; Do[If[MemberQ[t4, Prime[n]], AppendTo[t6,n]],{n,1,300}]; t6
    (* the lists t1,t2,t3,t4,t5,t6 match the sequences
    A184774, A184775, A184776 ,A184777, A184778, A184779 *)
  • Python
    from itertools import count, islice
    from math import isqrt
    from sympy import primepi, isprime
    def A184776_gen(): # generator of terms
        return map(primepi,filter(isprime,(isqrt(k**2<<1) for k in count(1))))
    A184776_list = list(islice(A184776_gen(),25)) # Chai Wah Wu, Jul 28 2022

A184779 Numbers m such that prime(m) is of the form 2k + floor(k*sqrt(2)); complement of A184776.

Original entry on oeis.org

2, 6, 7, 9, 12, 15, 18, 20, 29, 34, 37, 38, 39, 43, 47, 57, 61, 62, 63, 66, 67, 77, 80, 81, 84, 86, 88, 91, 94, 103, 106, 107, 111, 113, 115, 116, 129, 133, 134, 135, 140, 145, 146, 147, 150, 151, 154, 156, 166, 173, 177, 178, 186, 188, 193, 194, 197, 201, 204, 205, 208
Offset: 1

Author

Clark Kimberling, Jan 21 2011

Keywords

Examples

			See A184774.
		

Crossrefs

Programs

  • Mathematica
    r=2^(1/2); s=r/(r-1);
    a[n_]:=Floor [n*r];  (* A001951 *)
    b[n_]:=Floor [n*s];  (* A001952 *)
    Table[a[n],{n,1,120}]
    t1={}; Do[If[PrimeQ[a[n]], AppendTo[t1,a[n]]], {n,1,600}]; t1
    t2={}; Do[If[PrimeQ[a[n]], AppendTo[t2,n]], {n,1,600}]; t2
    t3={}; Do[If[MemberQ[t1, Prime[n]], AppendTo[t3,n]],{n,1,300}]; t3
    t4={}; Do[If[PrimeQ[b[n]], AppendTo[t4,b[n]]],{n,1,600}]; t4
    t5={}; Do[If[PrimeQ[b[n]], AppendTo[t5,n]],{n,1,600}]; t5
    t6={}; Do[If[MemberQ[t4, Prime[n]], AppendTo[t6,n]],{n,1,300}]; t6
    (* the lists t1,t2,t3,t4,t5,t6 match the sequences
    A184774, A184775, A184776 ,A184777, A184778, A184779 *)
  • Python
    from math import isqrt
    from itertools import count, islice
    from sympy import isprime, primepi
    def A184779_gen(): # generator of terms
        return map(primepi,filter(isprime,((k<<1)+isqrt(k**2<<1) for k in count(1))))
    A184779_list = list(islice(A184779_gen(),25)) # Chai Wah Wu, Jul 28 2022
Showing 1-5 of 5 results.