login
Period of powers of 3 mod 10^n.
6

%I #18 Feb 19 2024 10:37:13

%S 4,20,100,500,5000,50000,500000,5000000,50000000,500000000,5000000000,

%T 50000000000,500000000000,5000000000000,50000000000000,

%U 500000000000000,5000000000000000,50000000000000000,500000000000000000

%N Period of powers of 3 mod 10^n.

%F 4*5^(n-1), n <= 4.

%F 5*10^(n-2), n >= 5.

%t Table[If[n<5,(4*5^n)/5,10^n/20],{n,20}] (* or *) Join[{4,20,100},NestList[ 10#&,500,20]] (* _Harvey P. Dale_, May 31 2017 *)

%o (PARI) a(n)=if(n<5,4*5^n/5,10^n/20) \\ _Charles R Greathouse IV_, Mar 26 2016

%Y Cf. A000244, A001148, A001218.

%K nonn,base,easy

%O 1,1

%A _V. Raman_, Sep 01 2012