20211206, 10:05  #1 
Dec 2021
1_{8} Posts 
Help me please solve this equation with pari gp
find all primes not exceeding 10 ^ 8, in the ternary notation of which the number of twos is equal to the total number of zeros and ones
it should be 187914 
20211206, 11:21  #2 
Sep 2002
Database er0rr
29·137 Posts 
Code:
c=0;forprime(p=3,10^8,V=digits(p,3);W=[0,0,0];for(v=1,#V,W[V[v]+1]++);if(W[3]==W[2]+W[1],c++));c 187914 Last fiddled with by paulunderwood on 20211206 at 11:28 
20211206, 17:07  #3 
Bamboozled!
"๐บ๐๐ท๐ท๐ญ"
May 2003
Down not across
2·5,557 Posts 
Please be careful. Hypocaffeinaemia can be dangerous and lead to serious consequences.
https://dilbert.com/strip/19980607 
20211206, 18:08  #4 
"Serge"
Mar 2008
Phi(4,2^7658614+1)/2
10010111010010_{2} Posts 
This looks like a homework (and wrong forum), and now the homework is ruined.
S/he will simply turn it in and get credit that s/he doesn't deserve. 
20211206, 18:31  #5 
Sep 2002
Database er0rr
F85_{16} Posts 

20211206, 18:34  #6 
If I May
"Chris Halsall"
Sep 2002
Barbados
27C5_{16} Posts 

20211206, 19:29  #7 
"Serge"
Mar 2008
Phi(4,2^7658614+1)/2
9682_{10} Posts 
One shall be ashamed of credit that they didn't deserve.

20211206, 20:09  #8 
"Ed Hall"
Dec 2009
Adirondack Mtns
1000001010001_{2} Posts 
This was my first thought, but did PaulU actually give the answer wanted? The OP seemed (to me) to ask for a list of those primes, rather than a count There is still work to do on the OP's part to study how to get the listing of primes.

20211207, 01:23  #9 
"Serge"
Mar 2008
Phi(4,2^7658614+1)/2
2·47·103 Posts 
That's like when a college student is required to run a mile, and instead asks you to give them a lift to 10 feet from the finish line. "I will still have to run 10 feet, right?"

20211207, 03:14  #10 
"Ed Hall"
Dec 2009
Adirondack Mtns
1000001010001_{2} Posts 

20211207, 04:07  #11 
"Serge"
Mar 2008
Phi(4,2^7658614+1)/2
25D2_{16} Posts 

Thread Tools  
Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
How to solve this equation with pari gp ...  rockzur  PARI/GP  13  20200816 11:02 
How to solve: k(b^m)z=n*d. ?  JM Montolio A  Miscellaneous Math  18  20180309 15:32 
Solve for mod function  flouran  Miscellaneous Math  23  20090104 20:03 
An Equation to Solve  davar55  Puzzles  3  20081009 00:35 
Solve this equation  davar55  Puzzles  52  20070626 21:41 