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.

A260821 Least positive integer k for which n*2^(2^k) + 1 is composite.

Original entry on oeis.org

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

Views

Author

Marco RipĂ , Jul 31 2015

Keywords

Comments

a(n) = 1 for nonzero n in A045751. - Michel Marcus, Aug 01 2015

Examples

			a(7)=3 because 7*2^2 + 1 = 29 is prime and 7*2^(2^2) + 1 = 113 is also prime, while 7*2^(2^3) + 1 = 11*163.
		

Crossrefs

Programs

  • Mathematica
    A260821[n_] := Module[{k = 0}, While[PrimeQ[n*2^(2^++k) + 1]]; k];
    Array[A260821, 100] (* Paolo Xausa, Jan 31 2024 *)
  • PARI
    a(n) = {k = 1; while (isprime(n*2^2^k+1), k++); k;} \\ Michel Marcus, Aug 01 2015

Extensions

More terms from Michel Marcus, Aug 01 2015