I want to find prime $p$ in form of $p=32 x+1$
How can I ask *WolframAlpha* for such $x$ that will fulfil this equation?

EDIT: let's say that $100$ or $n$ solutions is enough for me

Fraccalo 06/12/2018 at 17:01.

With MMA, say you want to check the first "n" x values:

```
n = 100;
Select[{#, 32*# + 1} & /@ Range[n], PrimeQ[#[[2]]] &]
```

{{3, 97}, {6, 193}, {8, 257}, {11, 353}, {14, 449}, {18, 577}, {20, 641}, {21, 673}, {24, 769}, {29, 929}, {36, 1153}, {38, 1217}, {39, 1249}, {44, 1409}, {50, 1601}, {53, 1697}, {59, 1889}, {63, 2017}, {65, 2081}, {66, 2113}, {71, 2273}, {81, 2593}, {83, 2657}, {84, 2689}, {86, 2753}, {95, 3041}, {98, 3137}, {99, 3169}}

and this if you want both x and p to be primes:

```
n = 100;
Select[{#, 32*# + 1} & /@ Range[n], And @@ PrimeQ[#] &]
```

{{3, 97}, {11, 353}, {29, 929}, {53, 1697}, {59, 1889}, {71, 2273}, {83, 2657}}

Edit: note that I'm assuming x to be integer. For x being a real number, there are more solutions.

Edit 2: For having solution for a generic x, just change the code to:

```
n = 100;
Select[{#, 32*# + 1} & /@ Range[0, n, 1/32], PrimeQ[#[[2]]] &]
```

{{1/32, 2}, {1/16, 3}, {1/8, 5}, {3/16, 7}, {5/16, 11}, {3/8, 13}, {1/ 2, 17}, {9/16, 19}, {11/16, 23}, {7/8, 29}, {15/16, 31}, {9/8, 37}, {5/4, 41}, {21/16, 43}, {23/16, 47}, {13/8, 53}, {29/16, 59}, {15/8, 61}, {33/16, 67}, {35/16, 71}, {9/4, 73}, {39/16, 79}, {41/16, 83}, {11/4, 89}, {3, 97}, {25/8, 101}, {51/16, 103}, {53/16, 107}, {27/8, 109}, {7/2, 113}, {63/16, 127}, {65/16, 131}, {17/4, 137}, {69/16, 139}, {37/8, 149}, {75/16, 151}, {39/8, 157}, {81/16, 163}, {83/16, 167}, {43/8, 173}, {89/16, 179}, {45/8, 181}, {95/16, 191}, {6, 193}, {49/8, 197}, {99/16, 199}, {105/16, 211}, {111/16, 223}, {113/16, 227}, {57/8, 229}, {29/4, 233}, {119/ 16, 239}, {15/2, 241}, {125/16, 251}, {8, 257}, {131/16, 263}, {67/ 8, 269}, {135/16, 271}, {69/8, 277}, {35/4, 281}, {141/16, 283}, {73/8, 293}, {153/16, 307}, {155/16, 311}, {39/4, 313}, {79/8, 317}}

rhermans 06/12/2018 at 16:20.

There are as many solutions as prime numbers

If you `Solve`

for $x$

`Solve[32 x + 1 == p, x]`

`1/32 (-1 + p)`

For every prime $p$ there will be an $x = \frac{p-1}{32}$ that satisfies.

To see the firsts values you can use `ReplaceAll`

on `p`

with the first `100`

`Prime`

numbers, to get the first 100 values of $x$ that fulfill the equation

`1/32 (-1 + p) /. p -> Prime[Range[100]]`

Or we can generate a `Table`

of the first 20 pairs $(p,x)$ with nice `TableForm`

`TableHeadings`

```
TableForm[
Table[{p, (p-1)/32}, {p, Prime[Range[20]]}]
, TableHeadings -> {Automatic, {"p", "x"}}
]
```

These are the first 100 pairs $(p,x)$ fulfilling the equation for integer values for $x$

```
Block[{list = {}, p, x, counter = 1},
While[
Length[list] < 100,
p = Prime[counter];
x = (p - 1)/32;
If[IntegerQ[x], AppendTo[list, {p, x}]];
counter += 1;
];
list
]
```

`{{97, 3}, {193, 6}, {257, 8}, {353, 11}, {449, 14}, {577, 18}, {641, 20}, {673, 21}, {769, 24}, {929, 29}, {1153, 36}, {1217, 38}, {1249, 39}, {1409, 44}, {1601, 50}, {1697, 53}, {1889, 59}, {2017, 63}, {2081, 65}, {2113, 66}, {2273, 71}, {2593, 81}, {2657, 83}, {2689, 84}, {2753, 86}, {3041, 95}, {3137, 98}, {3169, 99}, {3329, 104}, {3361, 105}, {3457, 108}, {3617, 113}, {4001, 125}, {4129, 129}, {4289, 134}, {4481, 140}, {4513, 141}, {4673, 146}, {4801, 150}, {4993, 156}, {5153, 161}, {5281, 165}, {5441, 170}, {5569, 174}, {5857, 183}, {5953, 186}, {6113, 191}, {6337, 198}, {6529, 204}, {6689, 209}, {6977, 218}, {7297, 228}, {7393, 231}, {7457, 233}, {7489, 234}, {7649, 239}, {7681, 240}, {7841, 245}, {7873, 246}, {7937, 248}, {8161, 255}, {8353, 261}, {8513, 266}, {8609, 269}, {8641, 270}, {8737, 273}, {8929, 279}, {9281, 290}, {9377, 293}, {9473, 296}, {9601, 300}, {9697, 303}, {9857, 308}, {10177, 318}, {10273, 321}, {10337, 323}, {10369, 324}, {10433, 326}, {10529, 329}, {10657, 333}, {10753, 336}, {11329, 354}, {11393, 356}, {11489, 359}, {11617, 363}, {11681, 365}, {11777, 368}, {11969, 374}, {12097, 378}, {12161, 380}, {12289, 384}, {12577, 393}, {12641, 395}, {13121, 410}, {13217, 413}, {13249, 414}, {13313, 416}, {13441, 420}, {13537, 423}, {13633, 426}}`

user6014 06/12/2018 at 15:58.

If you have Mathematica, you can use the `FindInstance`

function, which by definition provides one (or many) solutions to a particular equation:

```
In[12]:= FindInstance[
32*x + 1 == p && Element[p, Primes], {x, p}, Integers]
Out[12]= {{x -> 183, p -> 5857}}
```

**Edit:** Replying to OP's edit, if you want 100 solutions you could use

`FindInstance[ 32*x + 1 == p && Element[p, Primes], {x, p}, Integers, 100]`

José Antonio Díaz Navas 06/12/2018 at 16:44.

Let $prime(k)$ the k-th prime number, then ask WolframAlpha:

`(prime(k)-1)/32 for k=1 to 100`

You can even see in the results what are integers (just increase k to 1000 for instance). For $k=100$, the first 100 primes, those integers x-values are only $3,6,8,11,\text{and }14$.

The same result as proposed by @rhermans, but not using MMA.

You can get the table $(prime(k), x)$ by inputting in W|A:

`Table {prime(k),(prime(k)-1)/32} for k=1 to 100`

- How to find solutions that yield of root of unity?
- How to figure out how to make WolframAlpha work predictably
- How can I find all values of $m$ such that my cubic equation has three different positive solutions?
- Faster Solve for Fermat 4n+1 conjecture
- How to search for patterns to find the positions of prime numbers
- Mixing Wolfram Language & WolframAlpha Queries - How robust is it?
- The inverse function of “Prime”
- How does WolframAlpha calculate closed form approximations of irrational numbers?
- Finding the value of some coefficients such that an equation is true
- First two n such that $1355297$ divides$10^{6n+5}-54n-46$ for $n>0$

- Why are we building larger land-based telescopes instead of launching larger ones into space?
- Should a parent delete a teen's social media account if it was handled badly?
- Don't confuse me with the one about chickens!
- Modelling nonnegative integer time series
- Can a 1 Watt heating element boil water?
- How to trigger explosive arrows?
- Can you use a "History" check a to remind players of events from previous sessions or their backstory?
- Funny and simple exam questions
- What does impossibility to return arrays actually mean in C?
- Why is River Song surprised when the Doctor doesn't recognize her?
- Writing a character who is an expert in something that I can't know
- What could people notice about someone who is two times as dense as a regular person?
- What kind of components in a computer power supply can explode loudly?
- The Unique Padlock PIN List!
- What is the polynomial functor for the Bag monad
- Mary's house is near to/next to the hair salon.
- How can Santa keep his lists when GDPR is around?
- Can I have two of the same planeswalkers on the field
- I prepared my CV in LaTeX and exported it to PDF. How to deal with a recruiter who insists on CV in Word format?
- What is the best way to transfer $100 into a family member's US bank account on a daily basis?
- In the American west—the world of cowboys and cowhands—was ammunition traded for alcoholic “shots” of a drink?
- Why would underground dwelling Drow have dark skin?
- Should a character get advantage on a roll for attacking someone with a spell from behind?
- Train travel in Russia between host cities during Football World Cup 2018