[seqfan] Re: The mysterious Layman sequences

Alex Hall alex.mojaki at gmail.com
Thu May 13 23:07:31 CEST 2021


I've checked the first 10,000 terms, the conjecture holds.

Your formula for c has a denominator that's too big by a factor of 10^5.
0.36704 is 31*37/(5^5), which is not that complicated. 5 seems to be very
important in this case, so if I look for 5s I see that 31 is 2^5 - 1 and 37
is 2^5 + 5. 5 also apparently appears in the number of iterations needed to
make the sequence converge for a given number of terms, but I can't prove
or explain that. Nevertheless I couldn't see any explanations for how
Layman calculated any of these ratios.

Here is my Python code:

k_num = 31 * 37
k_den = 5 ** 5

seq = [1, 1]
num_terms = 10000

# In experiments in an earlier version of this code,
# with N as various multiples of 1000,
# it took exactly (5 * N / 2 - 4) iterations
# for the first N-1 terms to converge.
# I don't know why.
# The below is based on that, just without the -4,
# especially since I want to have N terms, not N-1.
num_iterations = 5 * num_terms // 2

for i in range(num_iterations):
    new = []
    for a, b in zip(seq, seq[1:]):
        new.append(a)
        if b * k_num <= k_den * a:
            new.append(a + b)

    # last iteration above sets `a` and `b` to the last pair in seq,
    # so it misses `a` = 1 which is the last term of seq
    new.append(1)

    # Since we're only interested in the first `num_terms` terms,
    # we don't need terms significantly beyond that to calculate them
    # since the sequence expands at each step and later terms never
    # end up affecting earlier terms in future sequences
    del new[num_terms + 1:]

    previous_seq = seq
    seq = new

# All but the last values should have converged now.
# The last value is broken by ignoring terms after
seq.pop()
previous_seq.pop()
assert seq == previous_seq

with open(f"/home/alex/rdis_{k_num / k_den}_{num_terms}.txt", "w") as f:
    for n, a_n in enumerate(seq):
        if n > 3:
            # Verify recurrence relation
            assert a_n == seq[n - 2] * 10 - seq[n - 4], (n, a_n, seq[n
- 2], seq[n - 4])
        f.write(f"{n + 1} {a_n}\n")


This also creates a b-file which is just under 25 MB. The terms get an
extra digit at approximately every two steps, with the last term
having 4978 digits.

I'm sure someone can go significantly further than 10,000 terms. This
didn't take that long on my laptop.

Here's what the recurrence looks like for the last term in the file:

277023343964966549941236186363070410519911417477502666563614597646132562970119929926416711408017347469782447684868106382590295427229431561799168776292028127884199898881750448304862715059438919697684020079885515192630376492656351799455961777056882502146473383537842653424916559032703884649846005850674225362586414519682893745747837440881225933112202721539430850939472499577683065026913669341259742932130599297761271372636350172679279931801316376529733877006812086030132803124869799260733051438379643725220591886455021967244586770840773805228299583771748361955838293028935652766243991511001411755815536139830961894432191971041032521006062292879015124901815537701169312444843133002166600221860168544516050209644136774136488822861413446346086606325030669635539140922880269349497052610745591878938147841356151059916554632501098565388318269070692717646736663649384098812406911872428880100014206065770935420234834298020538175678929145004006779218928593563911775409693612025824092762860854948800217051184123608540350354422634214592646503094656589855533858047374941945987112235200471507535087785140307510694585291541413393151143784149554620925074381684993770589844502276006015908023822340648528922147310006904271302543243621730423189147740538152814426350158967632099810465653978022307529888895291899465709787837147537312552532321084657296747894362913291795759417536199985978819856310218154191034998592523071143782637285595424490506936978247356093997920646511627158283497412753290710547682434678221381736406906030853221713166616541780463518102188192512870851325967596130407572994520967490564794937238062780961429869499003750469011882113703823077246516668178007089807131351669062761756905257864937988183245424772115755087893745230712295158656669582938772774402772870472117318884654874391415349694347319176486176411573884478981642051999657481888636327230241444568069745595734781844730127808544478614933605704935763277661961833796874463668133328747020634041109408410367528335889186893331961315075626558654254391870830948842830827707258074694311402631069648939707449906292883500372409917959905352443855687423708244970920321567378779620224199540837092073587997511538747919838172493954820570854457138301882812625955666780123930091505092215150014925287072997176649988631421038227632939050787588589671312734949668171128037831334054432753628717925258456350984307645943769286579378174715352797093954614665336873357509694905970406926319927478545659352842329941307920365296398865834736460052106683880150297531782779573735213950411982173380822552979865977095673795648075349050109742023775278356702098687758140104358176817003879142052804711426515656178516930226558687078220432666628155133551949278816884478199149889440396339164259175662760691656382214332012779074350468023748437135928707248522384801372131722161574839510772127385435012509333133929031377023102998028494087520179654265213328298525416084173470318283272750931741954371116462714526799426043308885636310109118411997625296697098648260631538464374232676564956043124172985465397005246930420843686626335909000568245110266780098015142740700832673786922479042936094970650500149231218409903448091459855329714302357682438748307727452217681720042144246108119530818732143360846575985752666919002573082553023343734285879797135918014697272213681909690508018606398157521493463857993841605776432709360802261071767647240102582888991941749688515148390607736556500401120266676960505955474816689480597261069036066730938015266628859730562399449234536853863404491906259157921568208547545818655385256583726941810506158190594140628416286997007065786252749122899737851018409952784905568899435378769865377518954268780478061137160934729076731111687612431701483838367666574677383600506491610429103778913774413113592764728918415496265332113724684958560860479181590529896129359250766291088911789926408703149557745804981813599246752033945100649913514047630935020603329043529116942771017567838559439217512186717632774930757049739715686633539470489919732572591730566979914935734095232669873554310807621493428154602623650146398007159202066158785465749956124578017860782366477139704576903597919199774540568006922441006616828723763228416027392626805421190349935889843970462798848942924226793538980278734020919938542572491790612644056956498049309257699292837059401974809250564916097513946285510859491738307530393431490969330704907338122230457569489480367943902182951406352723224379648786174704525531034273349327343135739359876869594388356876266841634342223729699191725890913236313408952910902618081425710214023287738127240489193125737812086133458753879688799010626062201160293235803264499021368389371212864109593671020291161654151746097941753285341251513237415268628010580162366404393791553445169278275663553973711575729917822136675658823695449650252444005722461331413948593543871831555715885295286436467113379387264428174652023549306307904956287130217638270536113854458574000685480288286134236810401663966244690253581412344695859796599461879545572793954515473930296118374997
* 10 -
27985040717469175432334298618950183556600776896810796334716537644078468344186125107619037870801268167807604757058090015366221526467066007829277486379199580798732329111079217334714931400763325537769674620037891242606889027247365133578258119745900634272899448006689034218944614574347321914777475682133007411408720464163126539757680410163288114661066869312978053618059803733039740363547601696824931332145895211458734171735934596753330510948306631572177057055713664049396734420110520908318869230063762450144648104114283535483722289048563339014785774204566289264504979942070806021940888023511399072428974321784513698286479960876565900610707666546498887392347887551847778196315967647355712756740290575461581872996644064076141951056358068351274705403755110623202388805224654391655794342923841217431799713707689329451820940143523855708515590594369239362089672529375519988492560631060591641250255539119126588016775200955379426992905364321459317112285969688652557293219498387680660866269563449268865791480393742851710284723447521037719427549021945917902170935896486610452444465313594868052538496265805745003956439994011700205864851639137518050224257311390223541007523991219153455661360117016458490687262694809985824619799752863559165842806108679261533386362509773434788388786853260836595639742261715649346397436322824851297759621235417092158615504410336756801358765693038810422159611936165513536602520171166116585772456166611620117450793333366499535585263728216106503597622901705325646705590396447142407793839807667913212375567227213467838715291846488169907052102195187160511664632826877046202850469167345543233059118179442635751750950548823265402951386375558141812503839142008566796357191180980689597454841439412216499666788865935123488397788650787447173778869463733174750170647649417281136957546771702801954933693057249911783576524584846073965007254355069784638237010956966958050856585378373177505167510352234042526675380603357751449547368486409987219790840976692354155061055160883934201242814392219388346248583620273424881216716287804676557080968088778255080801012369265800905324152333829836957488780728116966068291480034241071975311170357492856374034454075686729419798872243905328086822571322323397288255512516848788167845274470479846685556893091590922993990513682951646959726050438977407232727162441643565895197094793258719114134922963882441023012479070887118240255283140608264942646171738933583710440792323996001423519664206594120114397485098225824795795342635755981855899639985617698428879416729956446523516195538152868179029445424488402104141794612590751753949880649058664522810149554639711948617773664945694573705951683973561897649552265380732948210133590017621986694235019450876869436622277511945999997591921330021207808132526480990524741290001322990104468917268167352485424294826982615573735466927650709249252284481535212855202384342574740368029316962186036391740821823862172623552486130267114789044339667142698545116911938780716513575964049771695272161925817240396601153878313342773501895908319329234499785343966466924611530151220683306992862328806623106467056367335106393537594610151107090371847482693813048304535561508588815808411737173674276567190084250306528550915181779462521234426941827297570267904131435791241467784440439011868797332268065323895096868867844767122925114892318491874573064687360998286570864981771105035589898080597609492630261911420858164635122854517395659759195630023475449039211561123268787294849572549382016800333297808999138140713023325724499506498992544520998700059092886404335027071034756383159819285576618436965369345007905970427757030115427896052185513239528281858576988642404661153351661294043905853386829859014122495375546168911736741349411807962712692918762026207458522489421984302948799373434327195065152077524176828035836960472900685843873377752172631470737780581756356202260161633545938365163433969613023268256586303468890607451442713477271869034562595534594193626507868313778931749604664564428600866036893830751943783523343467647347377089037980490190534206916719464266792071869156123394964946651339399267293740638388981508861576709885595250671676917568381019701124272704663426145870115928100026329268008761679622206796720871000901640122093717129341381890892145498853305584342814224919069476499125564606932256254001979828002574859776823749215658500860864095062002285661059682114665601855136498828282080611000640761272270043594972083730431922531363288790095938311521156037118634481014719389119233037628419381626566739865672786123504405192157336660367959947891915253381786463474905265023080152343607746210899116243632229349295857707530239206438768134842654986205605314857113794887242789356716809909928329256092580489538953604520298475634411722302112566097718231547479077281102088994931636553745041523712813291479319097277827203823841517046592508686301318485177398117218802055709887759312524419801042431636363191118682962936316432205130935557929116926083149516290029281817434441295058402307792746028676662530157881039213679602112497460074970
==
2742248398932196323980027565011753921642513397878215869301429438817247161357013174156548076209372206530016872091622973810536732745827249610162410276541081698043266659706425265713912219193625871439070526178817260683696875899316152860981359650822924387191834387371737500030220975752691524583682582824609246214455424732665810917720693998648971216460960346081330455776665192043790909905589091715772497989160097766153979554627567130039468807064857133725161713012407196251931296828587471699011645153732674802061270760435936136962145419359174713268210063512917330293877950347285721640499027086502718485726387076525105246035439749533759309449915262243652361625807489459845346252115362374310289461861394869698920223444723677288746277557776395109591357846551585732189020423578039103314731764532077571949678699853821269713725384867461798174667100112557937105276963964465468135576558093228209358891805118590227614331567779250002329796386085718608475076999965950465196803716621870560266762338986038733304720360842342551793259502894624888745603397543952637436409537852932849418677886691120207298339355137269361941896475420122231305572989856408691200519559538547482357437498768841005624576863289468830730785837374232727200812636464440672725634599272848882730115227166547563316267752926962238703249210657279007751480935152548274227563589611155875320328124722581200792816596306820977776403490245376396813383405059545321240600399787633284951918989140194440443621201388055476331376504631201779830118756385766674956275220500864303919290598190591167342306590078640538606207573766116915218280576848028601746521911460464071065635871858062054367070186489407507062215295404512756258809677548619050772695387468399192234999406281745334379270663441187828098168907178600280570248859240987998438675901094496872359985926420062059809182045787539904636943471989972812398265048059375896059218946390851489250421500066412971830889539005398734092942957365386885231785918983796353191303243126982929203830813772435678949513451194323155572459725868154883395855864459138437469229728400618819418261916465737923193855446719694601599385456354332743134924193753555130266684238013427879505940661311792468961926067304300380457748811696504728971301155284390512747205647681020302567313836880175576892323696699324682430781825446919305894622334240067714483116245751068817173044329620681068820063980366805747553526464012919705996899974914435149864656156735708067839679610578862473414025814314853378857168646022591382744621426853183804546438411065780905615987924283580940046500353235282554633814686140899749343470357103724902498176728026761331633150396373845725954341162581182999887519750000206137833994193076263929348825257768717967912554876616892017391644999835297585708755689616839137266002214678914494266890369804317871362589426490239000174659640793623145100872808849804077458567846687405544572845884834356615741542163430298669111150696702460394528375204044021928600151082321652372342787137041412424704091041153746086005161506330399553263753652111912495354868626086002379596906715042675783012820122296044694513095060071901933200274614639322270577859022307679263879563472972325782744885405849902547820292993024215648266285239662998559960881245494136038197855726090877948557946385091221568545526529906035285050103854292051973979965293745489700641869951218940129486899345322502987020819595874791533198628007996638720516361051559969905244815572643294156020343187043626018677761117811285292579819368479598167483281469019644039127545926518070580515622992589053851526781531080886258285776005287504440914817862064100230105497375801101326324670859999567197112005711383037500423528248643898927224541750333168271935570707212580273488971868703034080917243038708645768548367153441182336554212961989089810575796960418813748648131891130061425583541419876192173108536142907884771333943912111452972558497907316182749912831671585701898763319813163422134865114641084191967884306808088244578144643006068796290829441563952955413802382449658322422060319360462136164528626388611948142209676870113106499033420252621394294114019110579736918601897938069520725368851467598172296621132975405798264196052359137605954892265164588432005106778487897538064505894772299900886044497657288486903615042611499998836649941444000373560836322990948542591444888315681899945316638601991013532915097414244252200244091451912574552940223964694254042407168978234541979796800321265124572956949316998821577456154796876378879379576710845940343286789776682371624205793754503940205797429161149078288899003720353769402476007381811778913770374650435471295164658640810402914481363725919264510147558697688106813783982141822960122259824707551051088276760832025593420548165981630167211941741825349436733461235277558258635026762367541667621715064524141205023205342779397409490297968888846209629255840367775466247452331738162756522433995815692020647413199680183493419769044706339454804448925685956778192851813987357845012461240755721139165851937317956265297846900331475137190463723675000

On Thu, May 13, 2021 at 8:03 PM Neil Sloane <njasloane at gmail.com> wrote:

> Dear Seq Fans,
> Rick Mabry has made some interesting comments about a family of sequences
> called "Ratio-Determined Insertion Sequences" contributed many years ago by
> the late John Layman. I propose to do some major editing of them, but first
> I would like to know the answer to a specific question. It needs some
> computing help, and the answer will determine how I edit
>  these sequences.
>
> So here is the question, based on the test case A085376.
> This involves a certain fraction, which is c := 31*37/(2^5*5^10) = 0.36704
> exactly.
>
> Given c, we construct a triangle of numbers, as follows. The first row is
> (1,1).
> Given row k, we get the next row by repeating row k, except that between
> every 2 adjacent terms x and y in that row, we insert their sum x+y iff y
> <= c*x.
>
> The rows converge to a sequence, which is A085376.
>
> There is a conjecture there that this sequence satisfies a(n) = 10*a(n-2) -
> a(n-4) for n >=5, with initial terms 1, 3, 11, 30
>
> Assuming that no one can prove this conjecture, I propose to replace the
> existing definition with the recurrence, and state it as a conjecture that
> it agrees with the sequence produced by the insertion rule. (I won't take
> the space here to explain why I want to do this.)
>
> But first I would like to be sure that the conjecture is true.  So could
> someone please generate a lot of terms using the present definition (the
> insertion rule), and check that the recurrence is satisfied?
>
> What worries me is that c = 31*37/(2^5*5^10) = 0.36704 exactly is a rather
> strange constant, and why should  the resulting sequence be explained by
> the quite simple recurrence a(n) = 10*a(n-2) - a(n-4) ?  So I want a
> numerical verification, as far out as is convenient, before I accept it!
>
> There are two text files written by Layman attached to the sequence. I have
> not studied them carefully, maybe they contain the answer to the question.
>
> Best regards
> Neil
>
> Neil J. A. Sloane, President, OEIS Foundation.
> 11 South Adelaide Avenue, Highland Park, NJ 08904, USA.
> Also Visiting Scientist, Math. Dept., Rutgers University, Piscataway, NJ.
> Phone: 732 828 6098; home page: http://NeilSloane.com
> Email: njasloane at gmail.com
>
> --
> Seqfan Mailing list - http://list.seqfan.eu/
>



More information about the SeqFan mailing list