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.

A104635 Odd n such that 2*n+1 is prime.

Original entry on oeis.org

1, 3, 5, 9, 11, 15, 21, 23, 29, 33, 35, 39, 41, 51, 53, 63, 65, 69, 75, 81, 83, 89, 95, 99, 105, 111, 113, 119, 125, 131, 135, 141, 153, 155, 165, 173, 179, 183, 189, 191, 209, 215, 219, 221, 231, 233, 239, 243, 245, 249, 251, 261, 273, 281, 285, 293, 299
Offset: 1

Views

Author

Zak Seidov, Mar 18 2005

Keywords

Comments

Also: Numbers k such that 2k+1 is in A002145, i.e., a Gaussian prime. - M. F. Hasler, Feb 25 2011
Also: Number of quadratic residues modulo A002145(n). - M. F. Hasler, Feb 25 2011

Crossrefs

Programs

  • Magma
    [n: n in [1..500 by 2] | IsPrime(2*n+1)]; // Vincenzo Librandi, Aug 14 2018
  • Mathematica
    Select[Range[1,301,2],PrimeQ[2#+1]&] (* Harvey P. Dale, May 08 2012 *)
  • PARI
    forstep( k=1,250,2, isprime(2*k+1) && print1(k", ")) \\ M. F. Hasler, Feb 25 2011
    
  • PARI
    forprime( p=1,500, p%4==3 || next; print1(p\2", ")) \\ M. F. Hasler, Feb 25 2011
    

Formula

a(n) = floor(A002145(n)/2). - M. F. Hasler, Feb 25 2011

A282706 Smallest prime factor of A020549(n) = (n!)^2 + 1.

Original entry on oeis.org

2, 2, 5, 37, 577, 14401, 13, 101, 17, 131681894401, 13168189440001, 1593350922240001, 101, 38775788043632640001, 29, 1344169, 149, 9049, 37, 710341, 41, 61, 337, 509, 384956219213331276939737002152967117209600000001, 941
Offset: 0

Views

Author

N. J. A. Sloane, Feb 26 2017

Keywords

Comments

By construction, for n >= 2, a(n) == 1 (mod 4) and a(n) > n.
From Robert Israel, Mar 08 2017: (Start)
a(n) = A020549(n) for n in A046029.
a(n) <= 2*n+1 if n is in A104636.
The first member of A104636 for which a(n) < 2*n+1 is 48.
a(a(n)-n-1) = a(n). (End)

References

  • T. M. Apostol, Introduction to Analytic Number Theory, Springer-Verlag, 1976, page 147.

Crossrefs

Programs

  • Magma
    [2] cat [Min(PrimeFactors(Factorial(n)^2 + 1)):n in[1..25]]; // Vincenzo Librandi, Feb 28 2017
  • Maple
    f:= proc(n) local a;
      a:= min(map(proc(t) if t[1]::integer then t[1] fi end proc, ifactors((n!)^2+1,easy)[2]));
    if a = infinity then
       a:= traperror(timelimit(60, min(map(t -> t[1], ifactors((n!)^2+1)[2]))));
    fi;
      a
    end proc:
    map(f, [$0..36]); # Robert Israel, Mar 08 2017
  • Mathematica
    Join[{2}, Array[FactorInteger[(#!)^2 + 1][[1, 1]]&, {25}]] (* Vincenzo Librandi, Feb 28 2017 *)

Extensions

More terms from Vincenzo Librandi, Feb 28 2017

A211173 (2n)!^n (modulo 2n+1).

Original entry on oeis.org

0, 2, 1, 6, 0, 10, 1, 0, 1, 18, 0, 22, 0, 0, 1, 30, 0, 0, 1, 0, 1, 42, 0, 46, 0, 0, 1, 0, 0, 58, 1, 0, 0, 66, 0, 70, 1, 0, 0, 78, 0, 82, 0, 0, 1, 0, 0, 0, 1, 0, 1, 102, 0, 106, 1, 0, 1, 0, 0, 0, 0, 0, 0, 126, 0, 130, 0, 0, 1, 138, 0
Offset: 0

Views

Author

Larry Riddle (LRiddle(AT)AgnesScott.edu) and Robert G. Wilson v, Jan 31 2013

Keywords

Comments

a(n)= 0, 1 or 2n. In fact, a(n) = 0 iff n belongs to A047845, a(n) = 1 iff n belongs to A104636 and a(n) = 2n iff n belongs to A104635.

Crossrefs

Programs

  • Mathematica
    f[n_] := Mod[((2 n)!)^n, 2 n + 1]; Array[f, 70]
    Table[PowerMod[(2n)!,n,2n+1],{n,0,70}] (* Harvey P. Dale, Nov 02 2019 *)
  • PARI
    a(n)=if(isprime(2*n+1),if(n%2,2*n,1),0) \\ Charles R Greathouse IV, Feb 07 2013

Formula

a(n) = (2n)!^n (modulo 2n+1).

A237053 Smallest number k such that some subset of n+1..n+k can be summed and added to n to produce a prime.

Original entry on oeis.org

2, 1, 0, 0, 3, 0, 1, 0, 1, 1, 3, 0, 3, 0, 1, 1, 3, 0, 1, 0, 1, 1, 3, 0, 4, 3, 1, 5, 3, 0, 1, 0, 3, 1, 3, 1, 1, 0, 3, 1, 3, 0, 3, 0, 1, 3, 4, 0, 1, 3, 1, 1, 3, 0, 1, 3, 1, 5, 3, 0, 5, 0, 3, 1, 3, 1, 4, 0, 1, 1, 6, 0, 4, 0, 1, 1, 3, 3, 1, 0, 3, 1, 3, 0, 3, 3, 1, 5, 3, 0, 1, 3, 3, 3, 3, 1, 1
Offset: 0

Views

Author

Keywords

Comments

a(n) = 0 iff n is prime.
a(n) = 2 only for n=0; the only possible sums for k=2 are n+(n+2) = 2n+2, divisible by 2, and n+(n+1)+(n+2) = 3n+3, divisible by 3.
There are infinitely many 1's in the sequence; if p > 5 is a prime == 1 (mod 4), a((p-1)/2) = 1.
Conjecture: every nonnegative integer except 2 occurs infinitely often in the sequence.

Examples

			If n is prime, sum({n}) is prime, so we can take k = 0, whence n+1..n+0 is empty, so a(n) = 0.
6 is not prime, but 6+7 = 13 is prime, so a(6) = 1.
4 is not prime, and 4+5 is not prime, but 4+7 = 11 and 4+6+7 = 17 are prime; either of these suffices to make a(4) = 3.
		

Crossrefs

Programs

  • Maple
    b:= (n, i, t)-> isprime(n) or t>0 and
        (b(n, i+1, t-1) or b(n+i, i+1, t-1)):
    a:= proc(n) local k;
          for k from 0 while not b(n, n+1, k) do od; k
        end:
    seq(a(n), n=0..100);  # Alois P. Heinz, Feb 07 2014
  • Mathematica
    b[n_, i_, t_] := PrimeQ[n] || t > 0 && (b[n, i+1, t-1] || b[n+i, i+1, t-1]);
    a[n_] := Module[{k}, For[k = 0, !b[n, n+1, k], k++]; k];
    Table[a[n], {n, 0, 100}] (* Jean-François Alcover, Sep 04 2025, after Alois P. Heinz *)

A336257 a(n) = Catalan(n) mod (2*n+1).

Original entry on oeis.org

0, 1, 2, 5, 5, 9, 2, 9, 2, 17, 17, 21, 12, 22, 2, 29, 18, 30, 2, 30, 2, 41, 30, 45, 9, 21, 2, 54, 53, 57, 2, 28, 38, 65, 42, 69, 2, 64, 70, 77, 5, 81, 80, 33, 2, 14, 27, 45, 2, 36, 2, 101, 87, 105, 2, 78, 2, 34, 75, 6, 101, 45, 62, 125, 39, 129, 74, 60, 2, 137, 90
Offset: 0

Views

Author

Michel Marcus, Jul 15 2020

Keywords

Crossrefs

Programs

  • Maple
    a:= n-> binomial(2*n, n)/(n+1) mod (2*n+1):
    seq(a(n), n=0..80);  # Alois P. Heinz, Jul 16 2020
  • PARI
    C(n)=binomial(2*n, n)/(n+1);
    a(n) = C(n) % (2*n+1);
    
  • Python
    A336257_list, c = [0,1], 1
    for n in range(2,10001):
        c = c*(4*n-2)//(n+1)
        A336257_list.append(c % (2*n+1)) # Chai Wah Wu, Jul 16 2020

Formula

a(n) = 2 for n in A104636.
a(n) = 2*n-1 for n in A104635.
Showing 1-5 of 5 results.