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 21-27 of 27 results.

A126017 Smallest prime of the form k^n + k^(n-1) - 1.

Original entry on oeis.org

2, 5, 11, 23, 47, 971, 191, 383, 22136835839, 1310719, 2259801991, 6143, 353563778431304822783, 91424858111, 5425784582791, 57395627, 21474836479, 1099999999999999999, 786431, 13508517176729920889, 1818426107493966837974532393806148403199, 153558654482644991
Offset: 1

Views

Author

Artur Jasinski, Dec 14 2006

Keywords

Comments

Primes arising in A125973.

Examples

			Consider n = 10. k^n + k^(n-1) - 1 evaluates to 1, 1535, 78731, 1310719 for k = 1, ..., 4. Only the last of these numbers, 4^10+4^9-1 = 1310719, is prime, hence a(10) = 1310719.
		

Crossrefs

Programs

  • Mathematica
    Table[k=0;Until[PrimeQ[p=k^n+k^(n-1)-1],k++];p,{n,22}] (* James C. McMahon, Dec 23 2024 *)
  • PARI
    {for(n=1,20,k=1;while(!isprime(a=k^n+k^(n-1)-1),k++);print1(a,","))} \\ Klaus Brockhaus, Dec 17 2006

Extensions

Edited and extended by Klaus Brockhaus, Dec 17 2006
a(21)-a(22) from James C. McMahon, Dec 23 2024

A182438 Numbers n such that neither n^2+n-1 nor n^2-n-1 is prime.

Original entry on oeis.org

1, 18, 23, 33, 34, 37, 43, 52, 58, 62, 63, 72, 73, 74, 75, 78, 79, 80, 81, 82, 88, 91, 92, 98, 99, 105, 106, 107, 108, 109, 110, 111, 112, 113, 117, 118, 119, 122, 123, 124, 128, 129, 133, 136, 137, 143, 147, 151, 152, 157, 162, 166, 167, 168, 173
Offset: 1

Views

Author

Alex Ratushnyak, Apr 28 2012

Keywords

Examples

			18^2+18-1=341 is not prime, and 18^2-18-1=305 is not prime, so 18 is in the sequence.
		

Crossrefs

Programs

  • Magma
    [n: n in [1..180] | not IsPrime(n^2+n-1) and not IsPrime(n^2-n-1)]; // Vincenzo Librandi, Jan 19 2013
    
  • Mathematica
    Select[Range[500], !PrimeQ[#^2 + # - 1] && !PrimeQ[#^2 - # - 1] &] (* Vincenzo Librandi, Jan 19 2013 *)
    Select[Range[200],NoneTrue[#^2+{#-1,-#-1},PrimeQ]&] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, May 04 2018 *)
  • PARI
    is(n)=!isprime(n^2+n-1) && !isprime(n^2-n-1) \\ Charles R Greathouse IV, Jun 13 2017

Formula

a(n) ~ n. - Charles R Greathouse IV, Jun 13 2017

A289357 Least number k such that n^2 + n - k is prime.

Original entry on oeis.org

0, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 5, 1, 11, 1, 1, 13, 5, 1, 1, 1, 3, 5, 1, 3, 1, 5, 1, 7, 1, 1, 5, 5, 3, 1, 5, 7, 1, 1, 3, 1, 5, 3, 1, 1, 1, 5, 1, 3, 1, 5, 3, 1, 1, 1, 1, 5, 9, 1, 1, 3, 17, 5, 1, 1, 1, 7, 1, 13, 1, 5, 19, 3, 19, 7, 1, 19, 11, 3, 7, 5, 3, 1, 11, 1
Offset: 1

Views

Author

Gionata Neri, Jul 03 2017

Keywords

Comments

a(A045546(n)) = 1.

Crossrefs

Cf. A002378, A045546, A049711, A161550 (resulting primes).

Programs

  • Maple
    0, seq(n^2 + n - prevprime(n^2+n), n=2..100); # Robert Israel, Jul 03 2017
  • Mathematica
    Table[k = 0; While[! PrimeQ[n^2 + n - k], k++]; k, {n, 85}] (* Michael De Vlieger, Jul 04 2017 *)
  • PARI
    for(n=1,85,k={my(k=0);while(!isprime(n^2+n-k),k++);k;};print1(k", "))

Formula

a(n) = A049711(A002378(n)). - Robert Israel, Jul 03 2017

A291689 Numbers n such that n^2 +- n +- 1 are all composite.

Original entry on oeis.org

23, 37, 43, 52, 73, 74, 82, 88, 92, 98, 107, 108, 109, 113, 122, 123, 124, 128, 129, 133, 136, 137, 152, 157, 166, 178, 179, 183, 198, 201, 202, 205, 208, 211, 212, 213, 214, 217, 222, 223, 224, 227, 228, 229, 235, 238, 239, 243, 250, 251, 252, 253, 254, 255, 256, 257, 261, 262, 270, 271, 274
Offset: 1

Views

Author

Robert Israel, Aug 29 2017

Keywords

Comments

Numbers n such that A291654(n)=1.
Complement of union of A002328, A002384, A045546 and A055494.

Examples

			a(1)=23 is in the sequence because 23^2 - 23 - 1 = 505, 23^2 - 23 + 1 = 507, 23^2 + 23 - 1 = 551, 23^2 + 23 + 1 = 553 are all composite.
		

Crossrefs

Programs

  • Maple
    select(t -> not ormap(isprime, {t^2+t+1,t^2+t-1,t^2-t+1,t^2-t-1}), [$1..1000]);
  • Mathematica
    Select[Range@ 300, Function[t, AllTrue[t^2 + Map[Total[{t, 1} #] &, Tuples[{1, -1}, 2]], ! PrimeQ@ # &]]] (* Michael De Vlieger, Aug 29 2017 *)
  • PARI
    is(n)=my(n2=n^2); !isprime(n2+n+1) && !isprime(n2+n-1) && !isprime(n2-n+1) && !isprime(n2-n-1) \\ Charles R Greathouse IV, Aug 30 2017

Formula

a(n) ~ n. - Charles R Greathouse IV, Aug 30 2017

A328525 Numbers k such that (k-1)*k*(k+1) = (k-1)*(1+u) = k*(1+v) = (k+1)*(1+w) with primes u, v, w.

Original entry on oeis.org

3, 5, 9, 21, 55, 131, 145, 155, 231, 259, 265, 449, 495, 561, 595, 1045, 1051, 1365, 1409, 1491, 1549, 1849, 1989, 2001, 2101, 2469, 2785, 3365, 3621, 3641, 3669, 3845, 3911, 4285, 4951, 5181, 5465, 6049, 6699, 7189, 7229, 8219, 8629, 9175, 9521, 9539, 9631, 9729
Offset: 1

Views

Author

Frank Ellermann, Feb 24 2020

Keywords

Examples

			3 is a term because 2*3*4 = 2*(1+11) = 3*(1+7) = 4*(1+5) with primes 11, 7, 5.
9 is a term because 8*9*10 = 8*(1+89) = 9*(1+79) = 10*(1+71) with primes 89, 79, 71.
		

Crossrefs

Cf. A000040.
Intersection of A002328, A028870 and A045546.

Programs

  • Maple
    q:= k-> andmap(isprime, (t-> [t-1, t-k, t+k])(k^2-1)):
    select(q, [$1..10000])[];  # Alois P. Heinz, Feb 25 2020
  • Mathematica
    Select[Range[2, 10^4], AllTrue[{(# - 1)*#, #*(# + 1), (# + 1)*(# - 1)} - 1, PrimeQ] &] (* Amiram Eldar, Feb 24 2020 *)
  • PARI
    isok(k) = isprime(k*(k+1)-1) && isprime((k+1)*(k-1)-1) && isprime(k*(k-1)-1); \\ Michel Marcus, Feb 25 2020
  • Rexx
    S = 3
    do N = 5 to 595 by 2
       if NOPRIME( N*N +N -1 ) then  iterate N
       if NOPRIME( N*N    -2 ) then  iterate N
       if NOPRIME( N*N -N -1 ) then  iterate N
       S = S || ',' N
    end N
    say S
    

Extensions

More terms from Amiram Eldar, Feb 24 2020

A248079 Least number k such that k^n + k - 1 is prime, or 0 if no such k exists.

Original entry on oeis.org

2, 2, 3, 2, 0, 4, 6, 2, 4, 3, 0, 17, 36, 3, 3, 2, 0, 6, 9, 43, 27, 9, 0, 3, 154, 3, 34, 54, 0, 24, 24, 6, 226, 23, 0, 3, 70, 36, 13, 51, 0, 4, 13, 9, 10, 68, 0, 18, 10, 45, 154, 85, 0, 23, 6, 10, 37, 8, 0, 30, 331, 9, 3, 40, 0, 11, 61, 8, 10, 35, 0, 61, 76, 54, 426, 9, 0, 84, 87, 13, 46
Offset: 1

Views

Author

Derek Orr, Sep 30 2014

Keywords

Comments

If n == 5 mod 6 (A016969), k^n + k - 1 is always divisible by k^2 - k + 1. Thus it will never be prime.

Crossrefs

Programs

  • Mathematica
    lnk[n_]:=Module[{k=2},While[CompositeQ[k^n+k-1],k++];k]; Table[If[Mod[n,6] == 5,0,lnk[n]],{n,90}] (* Harvey P. Dale, Oct 24 2021 *)
  • PARI
    a(n)=if(n==Mod(5,6),return(0));k=1;while(!isprime(k^n+k-1),k++);k
    vector(100,n,a(n))

A265670 Numbers n such that n^5 + n^4 + n^3 + n^2 + n - 1 is prime.

Original entry on oeis.org

2, 8, 10, 12, 16, 18, 22, 24, 28, 32, 42, 50, 60, 68, 70, 78, 88, 104, 108, 118, 132, 138, 206, 238, 240, 242, 270, 282, 300, 306, 312, 318, 338, 372, 376, 382, 390, 394, 398, 418, 440, 452, 464, 512, 522, 532, 534, 548, 566, 586, 594, 626, 630, 636, 640, 650
Offset: 1

Views

Author

Vincenzo Librandi, Dec 13 2015

Keywords

Comments

All terms are even. - Altug Alkan, Dec 13 2015

Examples

			2 is in the sequence because 2^5 + 2^4 + 2^3 + 2^2 + 2 - 1 = 61 is prime.
		

Crossrefs

Programs

  • Magma
    [n: n in [0..700] | IsPrime(s) where s is n^5+n^4+n^3+n^2+n-1];
    
  • Mathematica
    Select[Range[700], PrimeQ[Total[#^Range[1, 5, 1]] - 1] &]
  • PARI
    print1(2, ", "); forcomposite(n=1, 1e4, if(ispseudoprime(n^5 + n^4 + n^3 + n^2 + n - 1), print1(n, ", "))) \\ Altug Alkan, Dec 13 2015
Previous Showing 21-27 of 27 results.