A177331 Prime numbers p such that (p*2^k-1)/3 is composite for all even k or all odd k.
557, 743, 919, 1163, 3257, 3301, 4817, 5209, 5581, 6323, 6421, 6983, 7457, 7793
Offset: 1
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.
a(4) = 37 because the Collatz iteration of 37 is {37, 112, 56, 28, 14, 7, 22, 11, 34, 17, 52, 26, 13, 40, 20, 10, 5, 16, 8, 4, 2, 1}, which shows that 7 is the next prime after 37.
Table[p = Prime[n]; If[p == 3, q = 0, k = 1; While[q = (p*2^k - 1)/3; k < 10000 && ! PrimeQ[q], k++]]; q, {n, 15}]
3 is in the sequence because 3 = (5*2^1-1)/3 and both 3 and 5 are prime numbers; while 23 is not in the sequence because the only positive integer values (p,x) to give 23 are (35,1) and 35 is not prime.
mx = 590; Select[ Sort@ Flatten@ Table[(Prime[p]*2^x - 1)/3, {x, Log2[mx/3]}, {p, PrimePi[3 mx/2^x]}], PrimeQ] (* Robert G. Wilson v, Nov 01 2016 *)
lista(nn) = {forprime(p=2, nn, z = 3*p+1; x = valuation(z, 2); for (ex = 1, x, if (isprime(z/2^ex), print1(p, ", "); break;);););} \\ Michel Marcus, Sep 01 2016
Comments