Bill Allombert on Sun, 21 Jan 2024 14:08:57 +0100
|
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: oeis_digits( x, {D=105} )
|
- To: pari-users@pari.math.u-bordeaux.fr
- Subject: Re: oeis_digits( x, {D=105} )
- From: Bill Allombert <Bill.Allombert@math.u-bordeaux.fr>
- Date: Sun, 21 Jan 2024 14:08:53 +0100
- Arc-authentication-results: i=1; smail; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; d=math.u-bordeaux.fr; s=openarc; t=1705842535; c=relaxed/relaxed; bh=ubJK1YihW1rhtGqHDQLkhcaoXcFc2hl4CDjk86o/bBc=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:Mail-Followup-To: References:MIME-Version:Content-Type:Content-Disposition: Content-Transfer-Encoding:In-Reply-To; b=KD3/y+pWt8PMWmMTgXMD4HOuelP45ZVSVg/P9b3OMJz934O47cQHIf/ShdDBZQh3hmTKyfx4nRum4tm4hL9EOala2P0pBSgLFzTc0bcB4O2/6ukb4u164om4oVTnQsisfoBdRTVm5iXgjBZWjP1he9PPfxPDhlc8cole9XkzoVaALGFLFJWcyMIoDfmdccwa0oq0mHkehXURVzWmCKvARFWf6/edyENhIewXWyygAkh9xBn3FF6y5kUk9JX+HH2M3YVklYM+Ux0ddkeF4jDxVf/w6qBYTeXSEC4UVDZvViyopXhYt2o/wMAipcrD19HKjk7aPZHRnm1OlG+k8x5wT+BTqPaRdv9zFK4r/5JZ+SOfAGFAhEVLHQPGxMVMce6ADVXcf46giPdreP62UiYuDZb1Xl8aBLHDZafT9m2OAc65mBwuko+vtBUdvb7r2q630RjuVmVufaio3H78h8J4fXfMq16wuiKNd1yU6tM2UJlEqBJb6lBcAyIQbNMQmuxvB2HLYR/eHbKWPyJjVPxTDv//S0tdaz//HWQZc5nej9SOFBdneDFaESZE7VBxTczQB+TGGYBIeDF1SM0lvPu0QnBwvwB5SWniwBsKlhflrh3HcTpcl//nkf4bhQTPO3RJ+8fHGQQ6coJvLWKs8UOLCzPaPM02JUlqBcodIjI8cNM=
- Arc-seal: i=1; a=rsa-sha256; d=math.u-bordeaux.fr; s=openarc; t=1705842535; cv=none; b=Gc7RFsCcQnnLnZDNK5PhlvDpnKgX378NoxTUOUAYqhM5yBb0TNtvunzpF/AzJO05QAEzc2YHacgjyErOLcaK2Buhl9TMfW0mpnqOZ5yuUXnr5rA6gZiuf7O3A47SqDbH4KaaSx0l1fyk+ftRkutHdJdzGetUAUDSgFqOHmmfAIMnivJsB9o2hi/mmycRs6+6Lj2wH26uBDk00eL+hYuvvpdxDokE/KNeTOf3qevt/DTuiy+ztjkjNTw163OLkPY/tj2GtiNtQVPfB0LjWz9DRPs95LMrwv7Tq2rfy6b33KUWTvUYldotg1tQENp/gOPjDdsP3UNpp5/6Kf75pKFnnXqTzT78lToigmgtu4kkIap9kC+8jdsuw4hpT4fuQcDklQMQs8sCKCL7p4bhh8NOzQrdFN625RQn341/PwQ77BooWCl/D+fCe3v6BR/QvLR/PuM5u6is+wKzh3yAN4RGDQkNNrgUiv/sPJtyU1nCPJBzbCaV2d5cit0ggMmXPjOcr/JuIanygXtj91ecPhSmcKoIBj509Bllrbk09sTc678RqpXkJkqxBT/Px3k26qoL1d5bdq6/RIe2quZGDVU82+fJi7IzerfNABg+1NyQ99QFLH4FRspz+je7XluVlvLf0S/jnuKwGxXDanFrwaCsXDmzYHaJOoMQVxUOP4EJ6vI=
- Authentication-results: smail; arc=none
- Delivery-date: Sun, 21 Jan 2024 14:08:58 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=math.u-bordeaux.fr; s=2022; t=1705842535; bh=ubJK1YihW1rhtGqHDQLkhcaoXcFc2hl4CDjk86o/bBc=; h=Date:From:To:Subject:References:In-Reply-To:From; b=KmJy9Ms90R5/IfioUQ5FT0zyU3oWXGpEjQ+9AJw1gs5h2A5dvcwePP9omNaJWLg05 V3li/omjhsjvbvjQFXCyRiSpQwwM090UWGwqNkpmlVwwtpW92xTH3Qi2wZGsMvRV7Z Tm5jQ0nPlEWAeoIiejqap3KZbazr6TOinUkdP4xTJRcwzM1gWjfaUrAlNSIJOUCd0K CzqDwgIHk1rI8y5H6AECsVR5LhUqxxQ84VWBUfrrIsjA/qH1Y3pDTWhK/7rBrWbpsc DN28Iu/zV8PxoyBkkdVSijo1GOREN3Be8OGLgNrCU/EmBZqJwyCupRJCaW2UTBWNHl 59fiSidEHR8v6FeYTYXxlFzLZRoGOrnv0PE9EtEtMBiT+I1tLYOFqZtnM6GpLq4qR7 F4wYAEdltuQdq8SrRGXnTb9ROJ/pnjCyxzyRKuKcRF7RDcI/SPlwREV2sz2woS974q DqxHZjh1po+kNyGv53FWNjJZOh+NYYglJKz3RXax/LttbIT4sb1eXR3lOYCpi5nbA6 6XWwgUhhWrB1xVaRa1pH+BWLIJnnDaXGxMb1scz9xINR/6eDWKwvFM868XU8f8fY23 CSFWtieJew6Z+Aia7Y4PBuyPrHv1pYfNwFHTs4kC7E7TZRQkNIs6HY6YodoCDPf4Mc OHbtkrG1YsodGZzdgiotjlVA=
- In-reply-to: <60bf1218-fea1-4b9f-9868-bb8aeee7f052@isolution.nl>
- Mail-followup-to: pari-users@pari.math.u-bordeaux.fr
- References: <60bf1218-fea1-4b9f-9868-bb8aeee7f052@isolution.nl>
On Sun, Jan 21, 2024 at 01:54:18PM +0100, Ruud H.G. van Tol wrote:
>
> oeis_digits( x, D=105) = {
> localprec(D);
> if("t_STR" == type(x), x=eval(x));
> my(v=Vec(strprintf("%.*f", D, x)));
> [[ eval(s) |s<-v[1+(x<1)..D+1+(x<1)], s!="."], if(x<1, 0, 1+logint(x,
> 10))];
> }
A different way to do the same thing:
dig_exp1(N)=localprec(N+20);digits(round(exp(1)*10^N));
? dig_exp1(100)
%14 = [2,7,1,8,2,8,1,8,2,8,4,5,9,0,4,5,2,3,5,3,6,0,2,8,7,4,7,1,3,5,2,6,6,2,4,9,7,7,5,7,2,4,7,0,9,3,6,9,9,9,5,9,5,7,4,9,6,6,9,6,7,6,2,7,7,2,4,0,7,6,6,3,0,3,5,3,5,4,7,5,9,4,5,7,1,3,8,2,1,7,8,5,2,5,1,6,6,4,2,7,4]
and more generaly,
digreal(f,N)=localprec(N+20);digits(round(f()*10^N));
? digreal(()->log(2),100)
%17 = [6,9,3,1,4,7,1,8,0,5,5,9,9,4,5,3,0,9,4,1,7,2,3,2,1,2,1,4,5,8,1,7,6,5,6,8,0,7,5,5,0,0,1,3,4,3,6,0,2,5,5,2,5,4,1,2,0,6,8,0,0,0,9,4,9,3,3,9,3,6,2,1,9,6,9,6,9,4,7,1,5,6,0,5,8,6,3,3,2,6,9,9,6,4,1,8,6,8,7,5]
Cheers,
Bill.