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.

Previous Showing 31-40 of 144 results. Next

A097363 Positive integers n such that 2n-13 is prime.

Original entry on oeis.org

8, 9, 10, 12, 13, 15, 16, 18, 21, 22, 25, 27, 28, 30, 33, 36, 37, 40, 42, 43, 46, 48, 51, 55, 57, 58, 60, 61, 63, 70, 72, 75, 76, 81, 82, 85, 88, 90, 93, 96, 97, 102, 103, 105, 106, 112, 118, 120, 121, 123, 126, 127, 132, 135, 138, 141, 142, 145, 147, 148, 153, 160, 162
Offset: 1

Views

Author

Douglas Winston (douglas.winston(AT)srupc.com), Sep 18 2004

Keywords

Crossrefs

Numbers n such that 2n+k is prime: A005097 (k=1), A067076 (k=3), A089038 (k=5), A105760 (k=7), A155722 (k=9), A101448 (k=11), A153081 (k=13), A089559 (k=15), A173059 (k=17), A153143 (k=19).
Numbers n such that 2n-k is prime: A006254 (k=1), A098090 (k=3), A089253 (k=5), A089192 (k=7), A097069 (k=9), A097338 (k=11), this sequence (k=13), A097480 (k=15), A098605 (k=17), A097932 (k=19).

Programs

Formula

Half of p+13 where p is a prime greater than 2.

A269254 To find a(n), define a sequence by s(k) = n*s(k-1) - s(k-2), with s(0) = 1, s(1) = n + 1; then a(n) is the smallest index k such that s(k) is prime, or -1 if no such k exists.

Original entry on oeis.org

1, 1, 2, 1, 2, 1, -1, 2, 2, 1, 2, 1, 2, -1, 2, 1, 3, 1, 2, 2, 2, 1, -1, 2, 6, 2, 3, 1, 3, 1, 2, 9, 9, -1, 2, 1, 6, 2, 2, 1, 2, 1, 5, 2, 2, 1, -1, 2, 5, 2, 9, 1, 2, 2, 2, 2, 6, 1, 2, 1, 14, -1, 5, 2, 2, 1, 5, 2, 3, 1, 6, 1, 8, 3, 6, 2, 3, 1, -1, 3, 18, 1, 2, 3, 2, 2, 3, 1, 2, 9, 3, 5, 2, 2, 96, 1, 3, -1, 5, 1, 2, 1, 2, 15, 14, 1, 44, 1, 3, -1
Offset: 1

Views

Author

Arkadiusz Wesolowski, Jul 09 2016

Keywords

Comments

The s(k) sequences can be viewed in A294099, where they appear as rows. - Peter Munn, Aug 31 2020
For n >= 3, a(n) is that positive integer k yielding the smallest prime of the form (x^y - 1/x^y)/(x - 1/x), where x = (sqrt(n+2) +- sqrt(n-2))/2 and y = 2*k + 1, or -1 if no such k exists.
Every positive term belongs to A005097.
When n=7, the sequence {s(k)} is A033890, which is Fibonacci(4i+2), and since x|y <=> F_x|F_y, and 2i+1|4i+2, A033890 is never prime, and so a(7)=-1. For the other -1 terms below 100, see the theorem below and the Klee link - N. J. A. Sloane, Oct 20 2017 and Oct 22 2017
Theorem (Brad Klee): For all n > 2, a(n^2 - 2) = -1. See Klee link for a proof. - L. Edson Jeffery, Oct 22 2017
Theorem (Based on work of Hans Havermann, L. Edson Jeffery, Brad Klee, Don Reble, Bob Selcoe, and N. J. A. Sloane) a(110) = -1. [For proof see link. - N. J. A. Sloane, Oct 23 2017]
From Bob Selcoe, Oct 24 2017, edited by N. J. A. Sloane, Oct 27 2017: (Start)
Suppose n = m^2 - 2, where m >= 3, and let j = m-2, with j >= 1.
For this value of n, the sequence s(k) satisfies s(k) = (c(k) + d(k))*(c(k) - d(k)), where c(0) = 1, d(0) = 0; and for k >= 1: c(k) = (j+2)*c(k-1) - d(k-1), and d(k) = c(k-1). So (as Brad Klee already proved) a(n) = -1 .
We have s(0) = 1 and s(1) = n+1 = j^2 + 4j + 3. In general, the coefficients of s(k) when expanded in powers of j are given by the (4k+2)-th row of A011973 (the triangle of coefficients of Fibonacci polynomials) in reverse order. For example, s(2) = j^4 + 8j^3 + 21j^2 + 20j + 5, s(3) = j^6 + 12j^5 + 55j^4 + 120j^3 + 126j^2 + 56j + 7, etc.
Perhaps the above comments could be generalized to apply to a(110) or to other n for which a(n) = -1?
(End)
For detailed theory, see [Hone]. - L. Edson Jeffery, Feb 09 2018

Examples

			Let b(k) be the recursive sequence defined by the initial conditions b(0) = 1, b(1) = 16, and the recursive equation b(k) = 15*b(k-1) - b(k-2). a(15) = 2 because b(2) = 239 is the smallest prime in b(k).
Let c(k) be the recursive sequence defined by the initial conditions c(0) = 1, c(1) = 18, and the recursive equation c(k) = 17*c(k-1) - c(k-2). a(17) = 3 because c(3) = 5167 is the smallest prime in c(k).
		

Crossrefs

Programs

  • Magma
    lst:=[]; for n in [1..85] do if n gt 2 and IsSquare(n+2) then Append(~lst, -1); else a:=n+1; c:=1; t:=1; if IsPrime(a) then Append(~lst, t); else repeat b:=n*a-c; c:=a; a:=b; t+:=1; until IsPrime(a); Append(~lst, t); end if; end if; end for; lst;
    
  • Mathematica
    kmax = 100;
    a[1] = a[2] = 1;
    a[n_ /; IntegerQ[Sqrt[n+2]]] = -1;
    a[n_] := Module[{s}, s[0] = 1; s[1] = n+1; s[k_] := s[k] = n s[k-1] - s[k-2]; For[k=1, k <= kmax, k++, If[PrimeQ[s[k]], Return[k]]]; Print["For n = ", n, ", k = ", k, " exceeds the limit kmax = ", kmax]; -1];
    Array[a, 110] (* Jean-François Alcover, Aug 05 2018 *)
  • PARI
    allocatemem(2^30);
    default(primelimit,(2^31)+(2^30));
    s(n,k) = if(0==k,1,if(1==k,(1+n),((n*s(n,k-1)) - s(n,k-2))));
    A269254(n) = { my(k=1); if((n>2)&&issquare(2+n),-1,while(!isprime(s(n,k)),k++);(k)); }; \\ Antti Karttunen, Oct 20 2017

Formula

If n is prime then a(n-1) = 1.

Extensions

a(86)-a(94) from Antti Karttunen, Oct 20 2017
a(95)-a(109) appended by L. Edson Jeffery, Oct 22 2017

A104275 Numbers k such that 2k-1 is not prime.

Original entry on oeis.org

1, 5, 8, 11, 13, 14, 17, 18, 20, 23, 25, 26, 28, 29, 32, 33, 35, 38, 39, 41, 43, 44, 46, 47, 48, 50, 53, 56, 58, 59, 60, 61, 62, 63, 65, 67, 68, 71, 72, 73, 74, 77, 78, 80, 81, 83, 85, 86, 88, 89, 92, 93, 94, 95, 98, 101, 102, 103, 104, 105, 107, 108, 109, 110, 111, 113
Offset: 1

Views

Author

Alexandre Wajnberg, Apr 17 2005

Keywords

Comments

Same as A053726 except for the first term of this sequence.
Numbers k such that A064216(k) is not prime. - Antti Karttunen, Apr 17 2015
Union of 1 and terms of the form (u+1)*(v+1) + u*v with 1 <= u <= v. - Ralf Steiner, Nov 17 2021

Examples

			a(1) = 1 because 2*1-1=1, not prime.
a(2) = 5 because 2*5-1=9, not prime (2, 3 and 4 give 3, 5 and 7 which are primes).
From _Vincenzo Librandi_, Jan 15 2013: (Start)
As a triangular array (apart from term 1):
   5;
   8,  13;
  11,  18,  25;
  14,  23,  32,  41;
  17,  28,  39,  50,  61;
  20,  33,  46,  59,  72,  85;
  23,  38,  53,  68,  83,  98, 113;
  26,  43,  60,  77,  94, 111, 128, 145;
  29,  48,  67,  86, 105, 124, 143, 162, 181;
  32,  53,  74,  95, 116, 137, 158, 179, 200, 221; etc.
which is obtained by (2*h*k + k + h + 1) with h >= k >= 1. (End)
The above array, which contains the same terms as A053726 but in different order and with some duplicates, has its own entry A144650. - _Antti Karttunen_, Apr 17 2015
		

Crossrefs

Cf. A006254 (complement), A246371 (a subsequence).

Programs

  • Magma
    [n: n in [1..220]| not IsPrime(2*n-1)]; // Vincenzo Librandi, Jan 28 2011
    
  • Maple
    remove(t -> isprime(2*t-1), [$1..1000]); # Robert Israel, Apr 17 2015
  • Mathematica
    Select[Range[115], !PrimeQ[2#-1] &] (* Robert G. Wilson v, Apr 18 2005 *)
  • PARI
    select( {is_A104275(n)=!isprime(n*2-1)}, [1..115]) \\ M. F. Hasler, Aug 02 2022
    
  • Python
    from sympy import isprime
    def ok(n): return not isprime(2*n-1)
    print(list(filter(ok, range(1, 114)))) # Michael S. Branicky, May 08 2021
    
  • Python
    from sympy import primepi
    def A104275(n):
        if n <= 2: return ((n-1)<<2)+1
        m, k = n-1, (r:=primepi(n-1)) + n - 1 + (n-1>>1)
        while m != k:
            m, k = k, (r:=primepi(k)) + n - 1 + (k>>1)
        return r+n-1 # Chai Wah Wu, Aug 02 2024
    
  • SageMath
    [n for n in (1..250) if not is_prime(2*n-1)] # G. C. Greubel, Oct 17 2023
  • Scheme
    (define (A104275 n) (if (= 1 n) 1 (A053726 (- n 1)))) ;; More code in A053726. - Antti Karttunen, Apr 17 2015
    

Formula

a(n) = A047845(n-1) + 1.
For n > 1, a(n) = A053726(n-1) = n + A008508(n-1). - Antti Karttunen, Apr 17 2015
a(n) = (A014076(n)+1)/2. - Robert Israel, Apr 17 2015

Extensions

More terms from Robert G. Wilson v, Apr 18 2005

A102781 Number of positive even numbers less than the n-th prime.

Original entry on oeis.org

0, 1, 2, 3, 5, 6, 8, 9, 11, 14, 15, 18, 20, 21, 23, 26, 29, 30, 33, 35, 36, 39, 41, 44, 48, 50, 51, 53, 54, 56, 63, 65, 68, 69, 74, 75, 78, 81, 83, 86, 89, 90, 95, 96, 98, 99, 105, 111, 113, 114, 116, 119, 120, 125, 128, 131, 134, 135, 138, 140, 141, 146, 153, 155, 156
Offset: 1

Views

Author

Cino Hilliard, Feb 25 2005

Keywords

Comments

Same as A005097 ((odd primes - 1)/2) with a leading zero. - Lambert Klasen, Nov 06 2005

Crossrefs

Cf. A005097. - R. J. Mathar, May 18 2009
Equals (A000040-1)/2, integer part (0) for the first term. - M. F. Hasler, Dec 13 2019

Programs

  • Mathematica
    Table[Prime[n] - Floor[Prime[n]/2] - 1, {n, 65}] (* Robert G. Wilson v *)
  • PARI
    c(n,r) = { local(p); forprime(p=r,n, print1(floor(primorial(p)/ primorial(p-r)/primorial(r)+.0)",") ) } primorial(n) = \ The product primes <= n using the pari primelimit. { local(p1,x); if(n==0||n==1, return(2)); p1=1; forprime(x=2,n,p1*=x); return(p1) }
    
  • PARI
    apply( A102781(n)=(prime(n)-1)\2, [1..99]) \\ M. F. Hasler, Dec 13 2019
    
  • Python
    from sympy import prime
    def A102781(n): return prime(n)-1>>1 # Chai Wah Wu, Oct 13 2024

Formula

Integer part of p#/((p-2)#*2#), where p=prime(n) and i# is the primorial function A034386(i). - Cino Hilliard, Feb 25 2005
n# = product of primes <= n. 0# = 1# = 2. [This is not a standard convention!] n#/(n-r)#/r# is analogous to the number of binomial coefficients A007318 = C(n, r) = n!/(n-r)!/r! where factorial ! is replaced by primorial #.
a(n) = prime_n - floor((prime_n)/2) - 1. - Giovanni Teofilatto, Nov 05 2005
a(n) = [A034386(prime(n))/(2*A034386(prime(n)-2))], n>2. - R. J. Mathar, May 18 2009
a(n) = [(prime(n)-1)/2] where the integer part [.] needs be taken only for n=1. - M. F. Hasler, Dec 13 2019

Extensions

Simpler definition from Giovanni Teofilatto, Nov 05 2005
Edited by N. J. A. Sloane Jul 05 2009 at the suggestion of R. J. Mathar

A123998 Numbers k such that 2k+1 and 4k+1 are primes.

Original entry on oeis.org

1, 3, 9, 15, 18, 39, 48, 69, 78, 99, 105, 114, 135, 153, 165, 168, 183, 189, 219, 249, 273, 288, 300, 303, 309, 330, 345, 363, 405, 414, 438, 468, 483, 498, 504, 534, 585, 618, 639, 648, 699, 714, 729, 765, 804, 813, 828, 879, 933, 1005, 1014, 1044, 1065, 1068
Offset: 1

Views

Author

Artur Jasinski, Oct 31 2006

Keywords

Comments

Note that if n == 1 (mod 3) then 2n+1 is not prime (except n=1); and if n == 2 (mod 3) then 4n+1 is not prime. Therefore n must be a multiple of 3, except for n=1. - Max Alekseyev, Nov 02 2006

Crossrefs

Programs

  • Magma
    [n: n in [0..1100] |IsPrime(2*n+1) and IsPrime(4*n+1)]; // Vincenzo Librandi, Apr 17 2013
    
  • Mathematica
    Select[Range[1100], And @@ PrimeQ /@ ({2, 4}*# + 1) &] (* Ray Chandler, Nov 20 2006 *)
  • PARI
    is(k) = isprime(2*k+1) && isprime(4*k+1); \\ Jinyuan Wang, Aug 04 2019

Extensions

Extended by Ray Chandler, Nov 20 2006

A016017 Smallest k such that 1/k can be written as a sum of exactly 2 unit fractions in n ways.

Original entry on oeis.org

1, 2, 4, 8, 6, 32, 64, 12, 256, 512, 24, 2048, 36, 30, 16384, 32768, 96, 72, 262144, 192, 1048576, 2097152, 60, 8388608, 216, 768, 67108864, 288, 1536, 536870912, 1073741824, 120, 576, 8589934592, 6144, 34359738368, 68719476736, 180, 864
Offset: 1

Views

Author

Keywords

Comments

From Jianing Song, Aug 30 2021: (Start)
a(n) is the smallest number whose square has exactly 2n-1 divisors.
a(n) is the earliest occurrence of 2n-1 in A048691. (End)

Examples

			a(1)=1 and a(2)=2 because 1/2 = 1/3 + 1/6 = 1/4 + 1/4.
a(3)=4 because 1/4 = 1/5 + 1/20 = 1/6 + 1/12 = 1/8 + 1/8.
a(4)=8 because 1/8 = 1/9 + 1/72 = 1/10 + 1/40 = 1/12 + 1/24 = 1/16 + 1/16.
a(5)=6 because 1/6 = 1/7 + 1/42 = 1/8 + 1/24 = 1/9 + 1/18 = 1/10 + 1/15 = 1/12 + 1/12.
		

Crossrefs

Identical to A071571 shifted right.

Programs

  • Mathematica
    f[j_, n_] := (Times @@ (j(Last /@ FactorInteger[n]) + 1) + j - 1)/j; t = Table[0, {50}]; Do[a = f[2, n]; If[a < 51 && t[[a]] == 0, t[[a]] = n; Print[{a, n}]], {n, 2^30}] (* Robert G. Wilson v, Aug 03 2005 *)
  • PARI
    a(n) = {k = 1; while (numdiv(k^2) != (2*n-1), k++); return (k); }; \\ Amiram Eldar, Jan 07 2019 after Michel Marcus at A071571

Formula

a(n+1) <= 2^n.
From Labos Elemer, May 22 2001: (Start)
a(n) = sqrt(A061283(n)).
a(n) = sqrt(Min{k| A000005(k)=2n-1}).
a((p+1)/2) = 2^((p-1)/2) = 2^A005097(i) if p is the i-th odd prime. [Corrected by Jianing Song, Aug 30 2021] (End)
a(n) is the least k such that (tau(k^2) + 1)/2 = n. - Vladeta Jovovic, Aug 01 2001

Extensions

Entry revised by N. J. A. Sloane, Aug 14 2005
Offset corrected by David W. Wilson, Dec 27 2018

A071576 a(n) = least k such that 2ik + 1 is prime for all 1 <= i <= n.

Original entry on oeis.org

1, 1, 1, 165, 5415, 12705, 256410, 256410, 6480303060, 217245863835, 946622690475, 35511547806735, 439116128090640, 5714676453270219435
Offset: 1

Views

Author

Benoit Cloitre, May 31 2002

Keywords

Crossrefs

Programs

  • Mathematica
    k = 1; Do[ While[p = Table[2*i*k + 1, {i, 1, n}]; Union[ PrimeQ[p]] != {True}, k++ ]; Print[k], {n, 1, 15}] (* Robert G. Wilson v *)
  • PARI
    for(n=1,6,s=1; while(sum(i=1,n,isprime(2*s*i+1))
    				

Extensions

Extended by Robert G. Wilson v, Jun 06 2002
a(9) from Ryan Propper, Jun 20 2005
a(10)-a(13) from Don Reble, Nov 05 2006
a(14) from Giovanni Resta, Apr 01 2017

A084712 Smallest prime of the form (2n)^k + 1, or 0 if no such number exists.

Original entry on oeis.org

3, 5, 7, 0, 11, 13, 197, 17, 19, 401, 23, 577, 677, 29, 31, 0, 1336337, 37
Offset: 1

Views

Author

Amarnath Murthy, Jun 10 2003

Keywords

Comments

It has not been proved that a(19), a(25), a(31), a(34), a(43) and a(46) are 0; if these values do exist, they have > 4000 digits. The other zeros are definite. - David Wasserman, Jan 03 2005
a((p-1)/2) = p for primes p > 2, or a(n) = 2n+1 for n = (p-1)/2. All other positive a(n) belong to A002496 = primes of form m^2 + 1. Corresponding positive exponents k are powers of 2. They are listed in A079706. - Alexander Adamchuk, Sep 17 2006
Because k must be a power of 2, numbers of the form (2n)^k+1 are called generalized Fermat numbers with base 2n. These numbers, like the regular Fermat numbers, are seldom prime. I checked n=19, 25, 31, 34, 43, 46 with k up to 2^16 without finding any primes. - T. D. Noe, May 13 2008
Comments from N. J. A. Sloane, Jan 27 2024: (Start)
As pointed out by Max Alekseyev, the previous version violated the OEIS rules, since a(19) has not been confirmed. I therefore removed the terms starting at a(19).
The previous DATA line read:
3, 5, 7, 0, 11, 13, 197, 17, 19, 401, 23, 577, 677, 29, 31, 0, 1336337, 37, 0, 41, 43, 197352587024076973231046657, 47, 5308417, 0, 53, 2917, 3137, 59, 61, 0, 0, 67, 0, 71, 73, 5477, 1238846438084943599707227160577, 79, 40960001, 83, 7057, 0, 89
The old b-file has been changed to an a-file.
(End)

Examples

			a(7) = 197 = 14^2 + 1 as 14 + 1 = 15 is not a prime.
		

Crossrefs

Programs

  • Mathematica
    Table[k=1; While[p=1+(2n)^k; k<1024 && !PrimeQ[p], k=2k]; If[k==1024, 0, p], {n,44}] (* T. D. Noe, May 13 2008 *)

Extensions

More terms from David Wasserman, Jan 03 2005
Edited by N. J. A. Sloane, Jan 27 2024 at the suggestion of Max Alekseyev

A098006 (p-1)/2 - phi(p-1) as p runs through the odd primes.

Original entry on oeis.org

0, 0, 1, 1, 2, 0, 3, 1, 2, 7, 6, 4, 9, 1, 2, 1, 14, 13, 11, 12, 15, 1, 4, 16, 10, 19, 1, 18, 8, 27, 17, 4, 25, 2, 35, 30, 27, 1, 2, 1, 42, 23, 32, 14, 39, 57, 39, 1, 42, 4, 23, 56, 25, 0, 1, 2, 63, 50, 44, 49, 2, 57, 35, 60, 2, 85, 72, 1, 62, 16, 1, 63, 66, 81, 1, 2, 78, 40, 76, 29, 114, 47
Offset: 2

Views

Author

N. J. A. Sloane, Sep 08 2004

Keywords

Comments

In the Luca-Walsh paper it is shown that there are infinitely many numbers not in this sequence. See A098047.
a(n)=0 for Fermat primes (A019434). a(n)=1 for safe primes (A005385). a(n)=2 for A090866. The least prime p for which (p-1)/2-phi(p-1)=n or 0 if there is no such prime is given by A134765(n). Sequence A134854(k) gives the least prime for which a(n)=2^(k-1). For k not a power of 2, it can be shown that if k is in this sequence, then it appears for a prime p <= 1+k^2. - T. D. Noe, Nov 13 2007

References

  • J. Browkin and A. Schinzel, On integers not of the form n-phi(n), Colloq. Math., 68 (1995), 55-58.
  • F. Luca and P. G. Walsh, On the number of nonquadratic residues which are not primitive roots, Colloq. Math., 100 (2004), 91-93.

Crossrefs

Cf. A000010, A051953, A098047, A176095 (p runs through the odd numbers).

Programs

  • Haskell
    a098006 n = a005097 (n-1) - a000010 (a006093 n)
    -- Reinhard Zumkeller, Mar 26 2013
    
  • Magma
    [(NthPrime(n)-1)/2 - EulerPhi(NthPrime(n)-1): n in [2..100]]; // Vincenzo Librandi, Jan 10 2017
  • Maple
    A098006 := proc(n)
        local p;
        p := ithprime(n+1) ;
        (p-1)/2-numtheory[phi](p-1) ;
    end proc:
    seq(A098006(n),n=1..30) ; # R. J. Mathar, Jan 09 2017
  • Mathematica
    Table[(Prime[n] - 1)/2 - EulerPhi[Prime[n] - 1], {n, 2, 85}] (* Robert G. Wilson v, Sep 09 2004 *)
    Table[(n-1)/2-EulerPhi[n-1],{n,Prime[Range[2,100]]}] (* Harvey P. Dale, Oct 23 2016 *)
  • PARI
    forprime(p=3,1e3,print1(p\2-eulerphi(p-1)", ")) \\ Charles R Greathouse IV, Feb 04 2013
    

Formula

a(n) = A005097(n-1) - A000010(A006093(n)); a(A159611(n)) = 0. - Reinhard Zumkeller, Mar 26 2013

A124417 a(n) = least k such that 2^i*k+1 is prime for 1<=i<=n.

Original entry on oeis.org

1, 1, 9, 765, 765, 8325, 8325, 7757430, 428547690, 102764221560, 694561346985, 108428872433310, 379041973928475, 34628781572140470, 34628781572140470
Offset: 1

Views

Author

Artur Jasinski, Nov 02 2006

Keywords

Crossrefs

Programs

  • Mathematica
    k = 1; Do[If[n < 3, inc = 1,If[n == 3, inc = 3, inc = 15];];If[Mod[k, inc] > 0, k = k + inc - Mod[k, inc]];While[Nand @@ PrimeQ[Table[2^j, {j, n}]*k + 1], k += inc]; Print[k], {n, 1, 15}] (* Ray Chandler, Nov 21 2006 *)

Extensions

Edited by Ray Chandler, Nov 21 2006
a(10) from Farideh Firoozbakht, Nov 25 2006
a(11)-a(15) from Giovanni Resta, Apr 24 2019
Previous Showing 31-40 of 144 results. Next