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.

A125973 Smallest k such that k^n + k^(n-1) - 1 is prime.

Original entry on oeis.org

2, 2, 2, 2, 2, 3, 2, 2, 14, 4, 7, 2, 38, 6, 7, 3, 4, 10, 2, 9, 74, 6, 10, 7, 4, 61, 20, 4, 5, 9, 6, 16, 6, 8, 2, 9, 4, 10, 2, 48, 44, 163, 9, 2, 95, 3, 27, 70, 6, 26, 57, 9, 6, 8, 207, 2, 27, 15, 45, 7, 69, 199, 55, 16, 2, 5, 12, 43, 137, 39, 9, 57, 5, 20, 4, 115, 2, 103, 45, 15, 20, 109
Offset: 1

Views

Author

Artur Jasinski, Dec 14 2006

Keywords

Comments

The polynomial x^n + x^(n-1) - 1 is irreducible over the rationals (see Ljunggren link), so the Bunyakovsky conjecture implies that a(n) always exists. - Robert Israel, Nov 16 2016

Examples

			Consider n = 6. k^6 + k^5 - 1 evaluates to 1, 95, 971 for k = 1, 2, 3. Only the last of these numbers is prime, hence a(6) = 3.
		

Crossrefs

Cf. A091997 (n such that a(n)=2).

Programs

  • Maple
    f:= proc(n) local k;
    for k from 2 do if isprime(k^n+k^(n-1)-1) then return k fi od
    end proc:
    map(f, [$1..100]); # Robert Israel, Nov 16 2016
  • Mathematica
    a[n_] := For[k = 2, True, k++, If[PrimeQ[k^n + k^(n-1) - 1], Return[k]]];
    Array[a, 100] (* Jean-François Alcover, Feb 26 2019 *)
  • PARI
    {m=82;for(n=1,m,k=1;while(!isprime(k^n+k^(n-1)-1),k++);print1(k,","))} \\ Klaus Brockhaus, Dec 17 2006

Extensions

Edited and extended by Klaus Brockhaus, Dec 17 2006

A175541 A007505 in binary.

Original entry on oeis.org

10, 101, 1011, 10111, 101111, 10111111, 101111111, 1011111111111, 10111111111111111111, 101111111111111111111111111111111111, 1011111111111111111111111111111111111111
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Jun 24 2010

Keywords

Comments

Primes of the form 10, 101, 1011, 10111,..

Examples

			a(12)=101111111111111111111111111111111111111111111.
		

Programs

  • Mathematica
    FromDigits/@Select[Table[PadRight[{1,0},n,1],{n,0,50}], PrimeQ[ FromDigits[ #,2]]&] (* Harvey P. Dale, Nov 12 2011 *)

Formula

Showing 1-2 of 2 results.