This post, we look at a simple Math question (Brain Teaser), and we solve it by Python. We take a look at the LLM (Large Language Model): ChatGPT3.5, and ChatGPT4. With ChatGPT-Plus Subscription (Currently $20 per month + VAT), we can enable the Plugins for ChatGPT-4, thus, we also take a look at the ChatGPT-4 with the Wolfram Plugin.
The Math Question: Smallest Integer Greater Than 95,555 and Having 4 Identical Digits
What is the smallest integer greater than 95555, in which there will be 4 identical numbers? The answer is 95999
The Question (A bit Math, a bit Brain Teaser) is: What is the smallest integer greater than 95,555, in which there will be 4 identical numbers?
TLDR; The answer is 95999.
Python Solution
Let’s verify using the Computer Program. The following Python Code tries next number from 95,556 until it finds a number that contains 4 identical numbers:
1 2 3 4 5 6 7 8 9 | from collections import Counter x = 95555 while True: x += 1 counter = Counter(str(x)) if max(counter.values()) == 4: print(x) break |
from collections import Counter x = 95555 while True: x += 1 counter = Counter(str(x)) if max(counter.values()) == 4: print(x) break
The output is 95999.
ChatGPT-3.5 Attempting to Solve the Math Brain Teaser Question
The ChatGPT3.5 isn’t clever enough to figure this out, and it makes obvious mistakes but pretends it is correct.
ChatGPT-4 Needs some Hints
ChatGPT-4 is a little bit better, it finds 96666 the second attempt after I pointed out the mistake for its first answer 95666.
ChatGPT-4 Plus the Math Wolfram Plugin
ChatGPT-4 with Plugins enabled can solve the problem by querying the Math Wolfram Plugin with the following request.
REQUEST TO WOLFRAM
1 2 3 | { "input": "nextNumber = 95556; While[Count[IntegerDigits[nextNumber], _?(# == Max[IntegerDigits[nextNumber]] &)] != 4, nextNumber++]; nextNumber" } |
{ "input": "nextNumber = 95556; While[Count[IntegerDigits[nextNumber], _?(# == Max[IntegerDigits[nextNumber]] &)] != 4, nextNumber++]; nextNumber" }
RESPONSE FROM WOLFRAM
1 | "95999" |
"95999"
It solves the problem, but technically, it is not ChatGPT but Wolfram who solves the question.
ChatGPT Use Cases
- ChatGPT writes a Python Script to Interact with Grok LLM from x.ai (Free $25 Credit)
- ChatGPT Use Case for Software Engineer: Review Pull Requests (Code Reviews)
- How ChatGPT Solves a Math Puzzle?
- ChatGPT Designs a Health Check Tool in Node.Js to Run on Free VPS Instance
- ChatGPT-4 uses Math Wolfram Plugin to Solve a Math Brain Teaser Question
- ChatGPT Refactors/Rewrites the Code using Promise.All - Sending Requests in Parallel
- ChatGPT Use Case: A Good Personal AI Assistant to Help You Write Emails
- Programming Language Conversion Tool based on ChatGPT AI
- ChatGPT4: integrated with DALL.E: Generate a Merry Christmas theme girl in Red Dress
- Have you started using ChatGPT-4o?
ChatGPT - AGI (Artificial General Intelligence)
- Blog Traffic Declines after ChatGPT is Widely Adopted
- What is going to be the next trend in technology in the next 10 years?
- Asking ChatGPT the Price of a Bitcoin (Does ChatGPT Predict or Estimate?)
- On Waiting List of ChatGPT 4 API
- The System Design of Steem Blockchain (ChatGPT DApps) Bots
- Integrating ChatGPT Prompt AI to STEEM blockchain
- ChatGPT Gives a Correct Leetcode Solution (Rust: Binary Search Algorithm) after Several Attempts
- ChatGPT Fails to Solve the Sudoku
- OpenAI Text Classifier Fails to Detect ChatGPT Text
- Quantum Computing in Simple Terms (ChatGPT vs Notion AI)
- How ChatGPT Impacts UGC (User Generate Content)?
- The Young Prompt Engineers
Grok 3 AI
ChatGPT Fails to
- ChatGPT Fails to Read the Text from Image
- ChatGPT AI is not able to solve this Math Problem: Rhombus inside Sqaure
–EOF (The Ultimate Computing & Technology Blog) —
Last Post: TRON Blockchain: How to Send the USDT (TRC-20) Transacton using Python tronpy?
Next Post: Teaching Kids Programming - Algorithms to Compute the Minimum String Length After Removing Substrings (Brute Force + Stack)