login
Powers of 2 with initial digit 2.
23

%I #24 Sep 08 2022 08:45:05

%S 2,256,2048,262144,2097152,268435456,2147483648,274877906944,

%T 2199023255552,281474976710656,2251799813685248,288230376151711744,

%U 2305843009213693952,295147905179352825856,2361183241434822606848,2417851639229258349412352,2475880078570760549798248448

%N Powers of 2 with initial digit 2.

%H Muniru A Asiru, <a href="/A067480/b067480.txt">Table of n, a(n) for n = 1..400</a>

%t Select[Table[2^n,{n,75}],First@IntegerDigits[#]==2 &] (* _Jayanta Basu_, May 19 2013 *)

%t Select[2^Range[100], First[IntegerDigits[#]]==2 &] (* _Vincenzo Librandi_, Oct 22 2018 *)

%o (PARI) lista(nn) = {for (n=0, nn, if (digits(x=2^n)[1] == 2, print1(x, ", ")););} \\ _Michel Marcus_, Oct 20 2018

%o (GAP) k:=2;; Filtered(List([0..100],n->k^n),i->ListOfDigits(i)[1]=k); # _Muniru A Asiru_, Oct 19 2018

%o (Magma) [2^n: n in [1..100] | Intseq(2^n)[#Intseq(2^n)] eq 2]; // _Vincenzo Librandi_, Oct 22 2018

%Y Cf. A000079, A067469, A067483.

%K base,easy,nonn

%O 1,1

%A _Amarnath Murthy_, Feb 09 2002