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

 Subtractive years (Posted on 2012-12-12)
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.)
 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  21102134  2202  2246  2358  2471  2583  2695  3028  3033  3145  3211  3257  33033369  3370  3482  3594  4037  4044  4129  4156  4220  4268  4312  4381  44044493  5046  5055  5138  5167  5279  5280  5321  5392  5413  5505  6055  60666147  6178  6239  6291  6330  6422  6514  6606  7064  7077  7156  7189  71907248  7431  7523  7615  7707  8073  8088  8165  8257  8349  8440  8532  86248716  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

 Search: Search body:
Forums (0)