[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"detail-sidebar-cat-0-en-105":3,"doc-seo-698595-105":59,"doc-detail-698595-en":130,"doc-similar-698595":162},{"code":4,"msg":5,"data":6},0,"success",[7,13,18,23,28,33,38,43,48,51,55],{"id":8,"doc_module":4,"doc_module_name":9,"category_name":10,"show_sort_weight":11,"slug":12},1,"Document","Story & Novel",90,"story-novel",{"id":14,"doc_module":4,"doc_module_name":9,"category_name":15,"show_sort_weight":16,"slug":17},2,"Literature",80,"literature",{"id":19,"doc_module":4,"doc_module_name":9,"category_name":20,"show_sort_weight":21,"slug":22},4,"Exam",70,"exam",{"id":24,"doc_module":4,"doc_module_name":9,"category_name":25,"show_sort_weight":26,"slug":27},5,"Comic",60,"comic",{"id":29,"doc_module":4,"doc_module_name":9,"category_name":30,"show_sort_weight":31,"slug":32},6,"Technology",50,"technology",{"id":34,"doc_module":4,"doc_module_name":9,"category_name":35,"show_sort_weight":36,"slug":37},7,"Healthcare",40,"healthcare",{"id":39,"doc_module":4,"doc_module_name":9,"category_name":40,"show_sort_weight":41,"slug":42},8,"Research & Report",30,"research-report",{"id":44,"doc_module":4,"doc_module_name":9,"category_name":45,"show_sort_weight":46,"slug":47},9,"Religion & Spirituality",20,"religion-spirituality",{"id":46,"doc_module":4,"doc_module_name":9,"category_name":49,"show_sort_weight":46,"slug":50},"World Cup","world-cup",{"id":52,"doc_module":4,"doc_module_name":9,"category_name":53,"show_sort_weight":52,"slug":54},10,"Lifestyle","lifestyle",{"id":56,"doc_module":4,"doc_module_name":9,"category_name":57,"show_sort_weight":24,"slug":58},19,"General","general",{"code":4,"msg":60,"data":61},"ok",{"site_id":62,"language":63,"slug":64,"title":65,"keywords":66,"description":67,"schema_data":68,"social_meta":123,"head_meta":125,"extra_data":127,"updated_unix":129},105,"en","using-simple-linear-models-with-truncation-to-determine-the-gregorian-day-of-the-week","Using Simple Linear Models with Truncation to Determine the Gregorian Day of the Week","","The paper presents an algorithm to compute the day of the week for any Gregorian date using simple linear models with truncation. The method avoids lookup tables and does not require relabeling days, weeks, months, or years. It encodes the date and calculates the number of elapsed days since the Gregorian epoch on 1582-10-15, accounts for leap years via a truncated linear regression adjustment, then takes the result modulo 7 to obtain the weekday.",{"@graph":69,"@context":122},[70,84,105],{"@type":71,"itemListElement":72},"BreadcrumbList",[73,77,79,82],{"item":74,"name":75,"@type":76,"position":8},"https://docshare.wps.com","Home","ListItem",{"item":78,"name":9,"@type":76,"position":14},"https://docshare.wps.com/document/",{"item":80,"name":40,"@type":76,"position":81},"https://docshare.wps.com/document/research-report/",3,{"item":83,"name":65,"@type":76,"position":19},"https://docshare.wps.com/document/using-simple-linear-models-with-truncation-to-determine-the-gregorian-day-of-the-week/698595/",{"url":83,"name":65,"@type":85,"image":86,"author":91,"headline":65,"publisher":94,"fileFormat":97,"inLanguage":63,"description":67,"dateModified":98,"datePublished":99,"encodingFormat":97,"isAccessibleForFree":100,"interactionStatistic":101},"DigitalDocument",{"url":87,"@type":88,"width":89,"height":90},"https://docshare.wps.com/thumbnails/using-simple-linear-models-with-truncation-to-determine-the-gregorian-day-of-the-week/698595.png","ImageObject",300,407,{"name":92,"@type":93},"Obex","Person",{"url":74,"name":95,"@type":96},"DocShare","Organization","application/pdf","2026-11-17","2026-11-12",true,{"@type":102,"interactionType":103,"userInteractionCount":14},"InteractionCounter",{"@type":104},"ViewAction",{"@type":106,"mainEntity":107},"FAQPage",[108,114,118],{"name":109,"@type":110,"acceptedAnswer":111},"How does the algorithm determine the day of the week for a given Gregorian date?","Question",{"text":112,"@type":113},"It computes the number of days elapsed since the Gregorian epoch (1582-10-15), adjusts for leap years using truncated linear regression, then adds the epoch weekday and takes the total modulo 7.","Answer",{"name":115,"@type":110,"acceptedAnswer":116},"Does the algorithm rely on memorizing lookup tables for calendar values?",{"text":117,"@type":113},"No. It encodes any needed computation tables through simple linear regression with truncation rather than requiring direct table recall.",{"name":119,"@type":110,"acceptedAnswer":120},"What is the role of leap-year handling in the method?",{"text":121,"@type":113},"Leap years are counted through a function derived using linear regression with truncation, intended to correct errors in the underlying linear model so calculations remain accurate across centuries.","https://schema.org",{"og:url":83,"og:type":124,"og:title":65,"og:site_name":95,"og:description":67},"article",{"robots":126,"canonical":83},"index,follow",{"doc_id":128,"site_id":62},698595,1794453544,{"code":4,"msg":5,"data":131},{"doc_id":128,"user_id":132,"nickname":92,"user_avatar":133,"doc_module":4,"category_id":39,"category_name":40,"doc_title":65,"doc_description":67,"doc_content":134,"file_id":135,"file_url":136,"file_type":137,"file_size":138,"view_count":14,"is_deleted":4,"is_public":8,"is_downloadable":8,"audit_status":8,"page_count":139,"language":140,"language_code":63,"site_id":62,"html_lang":63,"table_of_contents":141,"faqs":142,"seo_title":143,"seo_description":67,"update_tm":129,"read_time":144,"preview_page_count":19,"preview_urls":145},5909898192665,"https://ap-avatar.wpscdn.com/davatar_29158cc5080c5b710cf443261637dec0","arXiv :2511 .00082v2 [math .GM] 4 Nov 2025  \nUsing Simple Linear Models with Truncation to Determine the Gregorian Day of the Week  \nBryce Iversen∗  \nAugust 24, 2025  \nAbstract  \nThe Gregorian calendar—ﬁrst established for daily use on Friday, October 15th, 1582 by Pope Gregory XIII in Catholic countries—is presently the most pervasive calendar in the world. As such, algorithms for performing various calendrical computations in accurate, performant, and easily implementable ways are extremely useful in ﬁelds like software engineering. In this paper, we present a novel algorithm for determining the day of the week for any date in the Gregorian calendar. Of note, our algorithm does not rely on remembering tables of values. Instead, we encode tables needed for computation using simple linear regression with truncation to adjust for any errors present in our linear models in such a way that notables have to be recalled. In addition, our algorithm does not require a relabeling of days, weeks, months, or years to values other than their intuitive representations. The algorithm works by taking a date in the Gregorian calendar, calculating the number of days (accounting for leap years using simple linear regression with truncation) that have elapsed since the epoch of the Gregorian calendar in 1582 from the speciﬁed date and adding this number modulo 7 to the epoch’s day of the week thus, obtaining the day of the week for the requested date in numeric form.  \nKeywords and phrases: simple linear regression, truncated linear model, perpetual calendar, gregorian, day of the week  \n2020 Mathematics Subject Classiﬁcation: 00A08  \n1 Introduction  \nCalculating the day of the week in the Gregorian calendar is fraught with error. A year has 365 days—except during a leap year when it has 366 . A month can have anywhere between 28 and 31 days with February having 28 days except on leap years when it has 29 days instead. A leap year occurs on years divisible by four–except for years divisible by 100 (centurial years) but those centurial years can become centurial leap years if they are also divisible by 400 . Why is  \n∗ Sonoma State University and University of Illinois, Urbana-Champaign  \nthe Gregorian calendar such a mess? Put simply, these leap year adjustments ensure the calendar year does not fall out of sync with the solar year as centuries pass. Unfortunately, leap years and the varying length of months makes a mess out of calendrical calculations. What makes predicting the day of the week tricky is that there are 5 levels of temporal granularity that all must be properly addressed: centuries (for accurately calculating leap years), years, months, weeks, and days. Thankfully, weeks are always 7 days long and there are always exactly 12 months in a year.  \nTo ease the confusion of the Gregorian calendar, we adopt several conventions. Calendars are to be described according to ISO 8601 [1] . This means, we assume weeks start on Monday and end on Sunday. More speciﬁcally, we assign the following numerical values to the days of the week to denote their order and make them usable in computations: Monday = 0, Tuesday = 1, Wednesday = 2, Thursday = 3, Friday = 4, Saturday = 5, and Sunday = 6 .1 Similarly, we assign the months of the year numerical values for the same reasons as above: January = 1, February = 2, March = 3, April = 4, May = 5, June = 6, July = 7, August = 8, September = 9, October = 10, November = 11, December = 12 . The epoch, or the beginning of the Gregorian calendar, was Friday, October 15th, 1582 . Where henceforth, this date may be encoded unambigiously as 1582-10-15—the four-digit, left-padded year separated by a hyphen followed by the two-digit, left-padded month broken by another hyphen and then trailed by the two-digit, left-padded day.  \n2 Methods  \nThe algorithm described in this paper was originally discovered, implemented, and tested in the C programming language. All dates from 1582-10-15 to 9999- 12-31 were computed","cbCaihTfD8UP0IDx","https://ap.wps.com/l/cbCaihTfD8UP0IDx","pdf",176038,15,"English","# Abstract\n# Introduction\n# Methods\n# The Formula","[{\"question\":\"How does the algorithm determine the day of the week for a given Gregorian date?\",\"answer\":\"It computes the number of days elapsed since the Gregorian epoch (1582-10-15), adjusts for leap years using truncated linear regression, then adds the epoch weekday and takes the total modulo 7.\"},{\"question\":\"Does the algorithm rely on memorizing lookup tables for calendar values?\",\"answer\":\"No. It encodes any needed computation tables through simple linear regression with truncation rather than requiring direct table recall.\"},{\"question\":\"What is the role of leap-year handling in the method?\",\"answer\":\"Leap years are counted through a function derived using linear regression with truncation, intended to correct errors in the underlying linear model so calculations remain accurate across centuries.\"}]","Using Simple Linear Models with Truncation to Determine the Gregorian Day of the Week | PDF",38,[146,150,154,158],{"page_no":8,"url":147,"width":148,"height":149},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-12/e33ffa9d5d96369a77fa5fc06c2c7151.webp",983,1272,{"page_no":14,"url":151,"width":152,"height":153},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-12/ee2cb97342727fac580f3c010c5f2b38.webp",982,1270,{"page_no":81,"url":155,"width":156,"height":157},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-12/f3c7f225ff4d91b7aa5f72d39a55d4a5.webp",981,1269,{"page_no":19,"url":159,"width":160,"height":161},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-12/79b1319d83fa64e6731190ae44fce5c9.webp",980,1268,{"list":163,"token":66},[164,170,176,183,190,196,202,209,216,223],{"doc_id":165,"doc_title":166,"file_type":137,"home_preview_img_url":167,"slug":168,"view_count":14,"category_name":40,"create_tm":169},698590,"Julian Date Calendar - Perpetual for Leap Years Only","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230010364815/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796207519&Signature=VtqXJ308HyLGcMxno6s7tbTuq2A%3D","julian-date-calendar-perpetual-for-leap-years-only",1794453485,{"doc_id":171,"doc_title":172,"file_type":137,"home_preview_img_url":173,"slug":174,"view_count":34,"category_name":40,"create_tm":175},341155,"The constitutively active form of a key cholesterol synthesis enzyme is lipid droplet-localized and upregulated in endometrial cancer tissues - Research Article","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229910521730/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796207519&Signature=tZteUr2RCo7017M8zKPwa1%2BvnQQ%3D","the-constitutively-active-form-of-a-key-cholesterol-synthesis-enzyme-is-lipid-droplet-localized-and-upregulated-in-endometrial-cancer-tissues-research-article",1790040583,{"doc_id":177,"doc_title":178,"file_type":137,"home_preview_img_url":179,"slug":180,"view_count":181,"category_name":40,"create_tm":182},85534,"Bilateral Trade Under Heavy-Tailed Valuations: Minimax Regret with Infinite Variance","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229809273619/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796207519&Signature=%2FWeoAoThuR6hMPx%2F3uWUWUtTN9Y%3D","bilateral-trade-under-heavy-tailed-valuations-minimax-regret-with-infinite-variance",27,1784204268,{"doc_id":184,"doc_title":185,"file_type":137,"home_preview_img_url":186,"slug":187,"view_count":188,"category_name":40,"create_tm":189},81580,"On the Suboptimality of Linear Codes for Binary Distributed Hypothesis Testing","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229808627765/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796207519&Signature=BeqcXzTbB9A%2B7UiHMtxuY1R2xqg%3D","on-the-suboptimality-of-linear-codes-for-binary-distributed-hypothesis-testing",23,1784174467,{"doc_id":191,"doc_title":192,"file_type":137,"home_preview_img_url":193,"slug":194,"view_count":44,"category_name":40,"create_tm":195},528446,"Validating Two-Stage Course Placement Systems When Data Are Truncated","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229942180213/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796207519&Signature=BKki36jVXfLidj4OlSiEJSX1zow%3D","validating-two-stage-course-placement-systems-when-data-are-truncated",1791518832,{"doc_id":197,"doc_title":198,"file_type":137,"home_preview_img_url":199,"slug":200,"view_count":29,"category_name":40,"create_tm":201},529706,"The Effects of Data Truncation on Estimated Validity Indices for Course Placement - Research Report","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229942028659/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796207519&Signature=wcsnvErjWwlJjT8YVht0SBI%2B00Q%3D","the-effects-of-data-truncation-on-estimated-validity-indices-for-course-placement-research-report",1791521780,{"doc_id":203,"doc_title":204,"file_type":137,"home_preview_img_url":205,"slug":206,"view_count":207,"category_name":40,"create_tm":208},85021,"A Sparse and Truncated State Vector Simulator for Peaked Circuits","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229809234242/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796207519&Signature=Qth4LKOKPhJUg%2BDVIZSCW4Fow%2B8%3D","a-sparse-and-truncated-state-vector-simulator-for-peaked-circuits",22,1784200359,{"doc_id":210,"doc_title":211,"file_type":137,"home_preview_img_url":212,"slug":213,"view_count":214,"category_name":40,"create_tm":215},86074,"DP-Splat Bayesian Nonparametric Complexity Control for Gaussian Splatting","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229809376544/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796207519&Signature=HMgI0ChmKQ7SLEO1xjB050Uk%2Fbs%3D","dp-splat-bayesian-nonparametric-complexity-control-for-gaussian-splatting",28,1784208354,{"doc_id":217,"doc_title":218,"file_type":137,"home_preview_img_url":219,"slug":220,"view_count":221,"category_name":40,"create_tm":222},273468,"Counting Documents Is Not Counting Text - Unit Bias in Web-PDF Corpus Statistics","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229899939742/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796207519&Signature=9L0JksKrnRlqN5rJqWahhPyClLw%3D","counting-documents-is-not-counting-text-unit-bias-in-web-pdf-corpus-statistics",16,1789471560,{"doc_id":224,"doc_title":225,"file_type":137,"home_preview_img_url":226,"slug":227,"view_count":19,"category_name":40,"create_tm":228},698594,"Conway and his Doomsday algorithm","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230010366555/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796207519&Signature=BXEtlR3fy3S8n0Pw7e790I8sXTA%3D","conway-and-his-doomsday-algorithm",1794453543]