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

Home > General
2023 (Posted on 2023-04-22) Difficulty: 4 of 5
The number representing the current year is both divisible by 7 and so is the sum of its digits. This feature allows me to take the liberty and to call it a SEPTEMVIRAL year, or shortly SY.

Now, the puzzle:
What span of 1000 years (from X to X+999) containing 2023, provides the highest quantity of SYs?

See The Solution Submitted by Ady TZIDON    
No Rating

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution computer solution Comment 1 of 1
clearvars,clc
mx=0;
for st=1924:2023
  r=st:st+999;
  f=find(mod(r,7)==0 & mod(sod(r),7)==0);
  ct=length(f);
  disp([st st+999 ct])
  if ct>mx 
    mx=ct;
  end
end

for st=1924:2023
  r=st:st+999;
  f=find(mod(r,7)==0 & mod(sod(r),7)==0);
  ct=length(f);
  if ct==mx
    fprintf('%5d%5d%5d\n',st, st+999 ,ct)
    fprintf('%5d',r(f));
    fprintf('\n\n')
  end
end

where

sod is

function sd = sod(n0) 
  for i=1:length(n0)
    n=n0(i);
    dgts=num2str(n) ;
    sd(i)=sum(dgts-48);
  end
end

which is dependent on the ASCII value of '0' being decimal 48.


The program finds the following counts for the given thousand years:

        1924        2923          21
        1925        2924          21
        1926        2925          21
        1927        2926          21
        1928        2927          21
        1929        2928          21
        1930        2929          21
        1931        2930          21
        1932        2931          21
        1933        2932          21
        1934        2933          21
        1935        2934          21
        1936        2935          21
        1937        2936          21
        1938        2937          21
        1939        2938          21
        1940        2939          21
        1941        2940          21
        1942        2941          21
        1943        2942          21
        1944        2943          21
        1945        2944          21
        1946        2945          21
        1947        2946          21
        1948        2947          21
        1949        2948          21
        1950        2949          21
        1951        2950          21
        1952        2951          21
        1953        2952          21
        1954        2953          21
        1955        2954          21
        1956        2955          21
        1957        2956          21
        1958        2957          21
        1959        2958          21
        1960        2959          21
        1961        2960          21
        1962        2961          21
        1963        2962          21
        1964        2963          21
        1965        2964          21
        1966        2965          21
        1967        2966          21
        1968        2967          21
        1969        2968          21
        1970        2969          21
        1971        2970          21
        1972        2971          21
        1973        2972          21
        1974        2973          21
        1975        2974          20
        1976        2975          20
        1977        2976          20
        1978        2977          20
        1979        2978          20
        1980        2979          20
        1981        2980          20
        1982        2981          20
        1983        2982          21
        1984        2983          21
        1985        2984          21
        1986        2985          21
        1987        2986          21
        1988        2987          21
        1989        2988          21
        1990        2989          22
        1991        2990          22
        1992        2991          22
        1993        2992          22
        1994        2993          22
        1995        2994          22
        1996        2995          22
        1997        2996          22
        1998        2997          22
        1999        2998          22
        2000        2999          22
        2001        3000          22
        2002        3001          22
        2003        3002          22
        2004        3003          22
        2005        3004          22
        2006        3005          22
        2007        3006          22
        2008        3007          22
        2009        3008          22
        2010        3009          22
        2011        3010          22
        2012        3011          22
        2013        3012          22
        2014        3013          22
        2015        3014          22
        2016        3015          22
        2017        3016          22
        2018        3017          22
        2019        3018          22
        2020        3019          22
        2021        3020          22
        2022        3021          22
        2023        3022          22
        
The largest count found was 22. All these thousand-year periods contain the same set of 22, which span 967 years:  
        
 1990 2989   22
 2023 2093 2156 2212 2219 2282 2289 2345 2401 2408 2471 2478 2534 2660 2667 2723 2793 2856 2912 2919 2982 2989
 1991 2990   22
 2023 2093 2156 2212 2219 2282 2289 2345 2401 2408 2471 2478 2534 2660 2667 2723 2793 2856 2912 2919 2982 2989
 1992 2991   22
 2023 2093 2156 2212 2219 2282 2289 2345 2401 2408 2471 2478 2534 2660 2667 2723 2793 2856 2912 2919 2982 2989
 1993 2992   22
 2023 2093 2156 2212 2219 2282 2289 2345 2401 2408 2471 2478 2534 2660 2667 2723 2793 2856 2912 2919 2982 2989
 1994 2993   22
 2023 2093 2156 2212 2219 2282 2289 2345 2401 2408 2471 2478 2534 2660 2667 2723 2793 2856 2912 2919 2982 2989
 1995 2994   22
 2023 2093 2156 2212 2219 2282 2289 2345 2401 2408 2471 2478 2534 2660 2667 2723 2793 2856 2912 2919 2982 2989
 1996 2995   22
 2023 2093 2156 2212 2219 2282 2289 2345 2401 2408 2471 2478 2534 2660 2667 2723 2793 2856 2912 2919 2982 2989
 1997 2996   22
 2023 2093 2156 2212 2219 2282 2289 2345 2401 2408 2471 2478 2534 2660 2667 2723 2793 2856 2912 2919 2982 2989
 1998 2997   22
 2023 2093 2156 2212 2219 2282 2289 2345 2401 2408 2471 2478 2534 2660 2667 2723 2793 2856 2912 2919 2982 2989
 1999 2998   22
 2023 2093 2156 2212 2219 2282 2289 2345 2401 2408 2471 2478 2534 2660 2667 2723 2793 2856 2912 2919 2982 2989
 2000 2999   22
 2023 2093 2156 2212 2219 2282 2289 2345 2401 2408 2471 2478 2534 2660 2667 2723 2793 2856 2912 2919 2982 2989
 2001 3000   22
 2023 2093 2156 2212 2219 2282 2289 2345 2401 2408 2471 2478 2534 2660 2667 2723 2793 2856 2912 2919 2982 2989
 2002 3001   22
 2023 2093 2156 2212 2219 2282 2289 2345 2401 2408 2471 2478 2534 2660 2667 2723 2793 2856 2912 2919 2982 2989
 2003 3002   22
 2023 2093 2156 2212 2219 2282 2289 2345 2401 2408 2471 2478 2534 2660 2667 2723 2793 2856 2912 2919 2982 2989
 2004 3003   22
 2023 2093 2156 2212 2219 2282 2289 2345 2401 2408 2471 2478 2534 2660 2667 2723 2793 2856 2912 2919 2982 2989
 2005 3004   22
 2023 2093 2156 2212 2219 2282 2289 2345 2401 2408 2471 2478 2534 2660 2667 2723 2793 2856 2912 2919 2982 2989
 2006 3005   22
 2023 2093 2156 2212 2219 2282 2289 2345 2401 2408 2471 2478 2534 2660 2667 2723 2793 2856 2912 2919 2982 2989
 2007 3006   22
 2023 2093 2156 2212 2219 2282 2289 2345 2401 2408 2471 2478 2534 2660 2667 2723 2793 2856 2912 2919 2982 2989
 2008 3007   22
 2023 2093 2156 2212 2219 2282 2289 2345 2401 2408 2471 2478 2534 2660 2667 2723 2793 2856 2912 2919 2982 2989
 2009 3008   22
 2023 2093 2156 2212 2219 2282 2289 2345 2401 2408 2471 2478 2534 2660 2667 2723 2793 2856 2912 2919 2982 2989
 2010 3009   22
 2023 2093 2156 2212 2219 2282 2289 2345 2401 2408 2471 2478 2534 2660 2667 2723 2793 2856 2912 2919 2982 2989
 2011 3010   22
 2023 2093 2156 2212 2219 2282 2289 2345 2401 2408 2471 2478 2534 2660 2667 2723 2793 2856 2912 2919 2982 2989
 2012 3011   22
 2023 2093 2156 2212 2219 2282 2289 2345 2401 2408 2471 2478 2534 2660 2667 2723 2793 2856 2912 2919 2982 2989
 2013 3012   22
 2023 2093 2156 2212 2219 2282 2289 2345 2401 2408 2471 2478 2534 2660 2667 2723 2793 2856 2912 2919 2982 2989
 2014 3013   22
 2023 2093 2156 2212 2219 2282 2289 2345 2401 2408 2471 2478 2534 2660 2667 2723 2793 2856 2912 2919 2982 2989
 2015 3014   22
 2023 2093 2156 2212 2219 2282 2289 2345 2401 2408 2471 2478 2534 2660 2667 2723 2793 2856 2912 2919 2982 2989
 2016 3015   22
 2023 2093 2156 2212 2219 2282 2289 2345 2401 2408 2471 2478 2534 2660 2667 2723 2793 2856 2912 2919 2982 2989
 2017 3016   22
 2023 2093 2156 2212 2219 2282 2289 2345 2401 2408 2471 2478 2534 2660 2667 2723 2793 2856 2912 2919 2982 2989
 2018 3017   22
 2023 2093 2156 2212 2219 2282 2289 2345 2401 2408 2471 2478 2534 2660 2667 2723 2793 2856 2912 2919 2982 2989
 2019 3018   22
 2023 2093 2156 2212 2219 2282 2289 2345 2401 2408 2471 2478 2534 2660 2667 2723 2793 2856 2912 2919 2982 2989
 2020 3019   22
 2023 2093 2156 2212 2219 2282 2289 2345 2401 2408 2471 2478 2534 2660 2667 2723 2793 2856 2912 2919 2982 2989
 2021 3020   22
 2023 2093 2156 2212 2219 2282 2289 2345 2401 2408 2471 2478 2534 2660 2667 2723 2793 2856 2912 2919 2982 2989
 2022 3021   22
 2023 2093 2156 2212 2219 2282 2289 2345 2401 2408 2471 2478 2534 2660 2667 2723 2793 2856 2912 2919 2982 2989
 2023 3022   22
 2023 2093 2156 2212 2219 2282 2289 2345 2401 2408 2471 2478 2534 2660 2667 2723 2793 2856 2912 2919 2982 2989
>> 

  Posted by Charlie on 2023-04-22 20:30:44
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