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.

A152414 a(n) = least positive k such that k*2^n*(2^n-1) - 1 or k*2^n*(2^n-1) + 1 is prime.

This page as a plain text file.
%I A152414 #21 Jul 04 2025 01:28:50
%S A152414 1,1,2,1,1,3,3,6,1,1,4,2,5,3,9,8,4,1,3,4,36,5,2,4,10,4,18,3,21,9,6,1,
%T A152414 6,8,12,2,51,1,2,2,21,6,6,12,1,5,5,3,10,1,11,53,9,4,3,2,1,5,12,10,9,8,
%U A152414 5,9,7,6,62,29,16,51,12,3,30,56,2,23,70,3,23
%N A152414 a(n) = least positive k such that k*2^n*(2^n-1) - 1 or k*2^n*(2^n-1) + 1 is prime.
%C A152414 All values in the b-file are verified and primes certified using PFGW from Primeform group.
%H A152414 Pierre CAMI, <a href="/A152414/b152414.txt">Table of n, a(n) for n=1..4000</a>
%F A152414 From _Pierre CAMI_, Dec 04 2008: (Start)
%F A152414 Lim_{n->oo} ( (Sum_{i=1..n} a(i)) / (n*(n+1)/2) ) = 1/4.
%F A152414 Lim_{n->oo} ( (Sum_{i=1..n} a(2*i)) / (n*(n+1)) ) = log(2)/4.
%F A152414 Lim_{n->oo} ( (Sum_{i=0..n} a(2*i+1)) / (n*(n+2)) ) = 1/2 - log(2)/4. (End)
%e A152414 For n = 1, 1*2^1*(2^1-1)+1 = 3 is prime, so a(1) = 1.
%e A152414 For n = 2, 1*2^2*(2^2-1)-1 = 11 is prime, as well as 1*2^2*(2^2-1)+1 = 13, so a(2) = 1.
%e A152414 For n = 3, k = 2 is the least k satisfying the condition: 2*2^3*(2^3-1)+1 = 113 is prime, so a(3) = 2.
%t A152414 A152414[n_] := Module[{k = 0}, While[NoneTrue[++k*# + {-1, 1}, PrimeQ]] & [4^n-2^n]; k];
%t A152414 Array[A152414, 100] (* _Paolo Xausa_, Jun 30 2025 *)
%o A152414 (PARI) a(n) = {k = 1; while (! (isprime(k*2^n*(2^n-1)+1) || isprime(k*2^n*(2^n-1)-1)), k++); return (k);} \\ _Michel Marcus_, Mar 07 2013
%Y A152414 Cf. A153091.
%K A152414 nonn
%O A152414 1,3
%A A152414 _Pierre CAMI_, Dec 03 2008