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.

A260757 Least k > 0 such that M(n)^2 - 2k is prime, where M(n) = 2^n - 1 = A000225(n).

This page as a plain text file.
%I A260757 #18 Jul 28 2020 08:54:20
%S A260757 1,2,1,1,1,4,1,1,7,10,1,10,1,10,5,1,14,24,1,1,13,1,16,3,82,1,19,1,23,
%T A260757 94,64,58,7,6,14,3,46,22,5,13,107,69,38,90,59,75,104,25,4,10,14,4,44,
%U A260757 10,5,1,77,81,85,94,71,9,14,111,13,27,20,9,37,6,5,4,62,12,38,4,37
%N A260757 Least k > 0 such that M(n)^2 - 2k is prime, where M(n) = 2^n - 1 = A000225(n).
%C A260757 For n = 0 and n = 1, no k > 0 can yield a positive prime, the given values are the smallest to yield the opposite of a positive prime: M(0)^2 - 2*1 = 0 - 2 = -2 and M(1)^2 - 2*2 = 1 - 4 = -3.
%H A260757 Robert Israel, <a href="/A260757/b260757.txt">Table of n, a(n) for n = 0..1000</a>
%F A260757 a(n) = 1 for n=0 or n in A091515.
%e A260757 For n = 2, M(2) = 2^2 - 1 = 3 and 3*3 - 2k = 7 is a prime for k=1, thus a(2) = 1.
%e A260757 For n = 3, M(3) = 2^3 - 1 = 7 and 7*7 - 2k = 47 is a prime for k=1, thus a(3) = 1.
%e A260757 For n = 4, M(4) = 2^4 - 1 = 15 and 15*15 - 2k = 223 is a prime for k=1, thus a(4) = 1.
%e A260757 For n = 5, M(5) = 2^5 - 1 = 31 and 31*31 - 2k = 953 is prime for k=4 and no smaller k, thus a(5) = 4.
%p A260757 f:= proc(n) local r;
%p A260757   r:= (2^n-1)^2;
%p A260757   (r - prevprime(r))/2
%p A260757 end proc:
%p A260757 f(0):=1: f(1):= 2:
%p A260757 map(f, [$0..100]); # _Robert Israel_, Apr 02 2020
%t A260757 f[n_] := Module[{r = (2^n - 1)^2}, (r - NextPrime[r, -1])/2 ];
%t A260757 f[0] = 1; f[1] = 2;
%t A260757 f /@ Range[0, 100] (* _Jean-François Alcover_, Jul 28 2020, after _Robert Israel_ *)
%o A260757 (PARI) a(n)={n>1&&for(k=1,9e9,ispseudoprime((2^n-1)^2-2*k)&&return(k));n+1}
%Y A260757 Cf. A091515 (a(n)=1 for n > 0), A260758.
%K A260757 nonn
%O A260757 0,2
%A A260757 _M. F. Hasler_, Jul 30 2015