All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Numbers
Four equal digits (Posted on 2021-07-20) Difficulty: 3 of 5
Find all possible integer values of n such that 12n2 + 12n + 11 is a 4-digit number with equal digits.

No Solution Yet Submitted by Danish Ahmed Khan    
No Rating

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution computer solution | Comment 1 of 5
clearvars, clc
v1=0; v2=0; n1=1; n2=-1;
while v1<10000 || v2<100000
   v1=12*n1^2+12*n1+11;
   if v1>999 && v1<10000
      v=num2str(v1);
      good=true;
      for i=2:4
         if v(i)~=v(i-1)
            good=false;
            break
         end
      end
      if good
         disp([n1 v1]) 
      end
   end
   n1=n1+1;
   v2=12*n2^2+12*n2+11;
   if v2>999 && v2<10000
      v=num2str(v2);
      good=true;
      for i=2:4
         if v(i)~=v(i-1)
            good=false;
            break
         end
      end
      if good
         disp([n2 v2]) 
      end
   end
   n2=n2-1;
end

finds


           n    12n^2 + 12n + 11
          21        5555
         -22        5555

  Posted by Charlie on 2021-07-20 13:25:16
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (9)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information