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

Home > Numbers
Subtractive years (Posted on 2012-12-12) Difficulty: 3 of 5
A year is called a Subtractive year when the absolute difference between the number formed by the first two digits and the number formed by the last two digits is equal to the number formed by the middle two digits.

For example, considering the year 3482, we observe that the absolute difference between 34 and 82 is 48, which is the number formed by the middle two digits, so that 3482 is a subtractive year. Likewise for the year 4220, the absolute difference between 42 and 20 is 22, so that 4220 is also a subtractive year.

(i) Determine the total number of subtractive years from years 1000 to 9999 inclusively.

(ii) What are the respective first and last subtractive years from years 2000 to 2999 inclusively?

(iii) What are the respective first and last subtractive years in the period covered under (i)?

No Solution Yet Submitted by K Sengupta    
No Rating

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution computer solution | Comment 3 of 6 |

CLS
FOR y = 1000 TO 9999
   a = y \ 100: c = y MOD 100
   b = (y \ 10) MOD 100
   IF ABS(a - c) = b THEN
     PRINT y; : ct = ct + 1
   END IF
NEXT y
PRINT
PRINT ct

finds

1011  1101  1123  1235  1347  1459  1460  1572  1684  1796  2019  2022  2110
2134  2202  2246  2358  2471  2583  2695  3028  3033  3145  3211  3257  3303
3369  3370  3482  3594  4037  4044  4129  4156  4220  4268  4312  4381  4404
4493  5046  5055  5138  5167  5279  5280  5321  5392  5413  5505  6055  6066
6147  6178  6239  6291  6330  6422  6514  6606  7064  7077  7156  7189  7190
7248  7431  7523  7615  7707  8073  8088  8165  8257  8349  8440  8532  8624
8716  8808  9082  9099  9174  9266  9358  9541  9633  9725  9817  9909

as the years and showing 90 as the count, answering part (i).

2019 and 2695 are the first and last in the 2000's.

1011 and 9909 are the first and last overall.


  Posted by Charlie on 2012-12-12 12:44:13
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 (21)
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