[go: up one dir, main page]

login
Numbers x = concat(a,b) such that b^a begins with the digits of x.
3

%I #25 May 16 2019 08:53:34

%S 25,59,102,104,250,590,1306,1976,2500,3763,12998,13060,19760,21912,

%T 25000,53216,71457,73365,137083,143507,214651,250000,348611,609185,

%U 732021,2500000,3323935,3486110,7848843,12122159,19977668,25000000,59725459,117927427,128226908

%N Numbers x = concat(a,b) such that b^a begins with the digits of x.

%C Any numbers of the form 25*10^k, with k>=0, are part of the sequence.

%e 25: 5^2 = 25;

%e 59: 9^5 = 59049 that begins with 59;

%e 102: 2^10 = 1024 that begins with 102;

%e 1306: 6^13 = 13060694016 that begins with 1306;

%e 3763: 63^37 = 3763572874813444727106020660762327844147969869582735798064027429183 that begins with 3763.

%p with(numtheory): P:= proc(q) local a,b,c,d,k,n;

%p for n from 1 to q do d:=ilog10(n); for k from 1 to d do a:=(n mod 10^k)^trunc(n/10^k); b:=ilog10(a)+1;

%p if trunc(a/10^(b-d-1))=n then print(n); break; fi; od; od; end: P(10^6);

%t Select[Range[10^5], AnyTrue[Function[n, FromDigits@ If[Length@ # < IntegerLength@ n, #, Take[#, IntegerLength@ n]] &@ IntegerDigits[#2^#1] & @@@ Map[Function[k, Map[FromDigits, TakeDrop[#, k]]], Range[Length@ # - 1]] &@ IntegerDigits@ n]@ #, Function[m, m == #]] &] (* _Michael De Vlieger_, Jan 12 2016, Version 10.2 *)

%Y Cf. A273382, A266818, A273383.

%K nonn,base

%O 1,1

%A _Paolo P. Lava_, Jan 04 2016

%E a(19)-a(25) from _Michael De Vlieger_, Jan 12 2016

%E a(26) from _Lars Blomberg_, Feb 08 2016

%E Name corrected by and a(27)-a(35) from _Giovanni Resta_, Jun 06 2016