Fungi

N. J. A. Sloane njas at research.att.com
Sat Jun 23 23:45:21 CEST 2007


Neil,

<<  it seems to me a(11) = -1 since 2^11 = 2048  >>

Agreed.  I don't get it ...    ?:-/

'Sorry if this has already been addressed ... but is there any significance 
to the differences in the PARI code given for A124691 and A124692, i.e.,

    digitpos2ton(n) = \ 2^n expansion first occurrence of n { local(x, y, r, 
dot); for(x=0, n, r = 2^x; ...
vs.
    digitposmton(n, m) = \ m^n expansion first occurrence of n { local(x, y, 
r, dot); for(x=0, n, r = m^x; ...

(Does the PARI code for either one yield a sequence anything like the 
enigmatic "-1,-1,-1,-1,-1,-1,1,-1,-1,-1,1,4, ..."?)

(For what it's worth, 51^11 = 6071163615208263051, which has the substring 
"11" starting at the 4th digit, and 51 is the smallest positive integer for 
which this is the case.)

-- Jon

----- Original Message ----- 
From: "N. J. A. Sloane" <njas at research.att.com>
To: <seqfan at ext.jussieu.fr>
Cc: <hillcino368 at hotmail.com>; <njas at research.att.com>
Sent: Saturday, June 23, 2007 3:03 PM
Subject: help needed with a duplicate


> Dear Seqfans,  Andrew P. pointed out that A124691 and A124692
> were the same.  So I tried to edit A124692.
> The old entry was :
>
> %I A124692
> %S A124692 
> 1,1,1,1,1,1,1,1,1,1,1,4,4,4,5,5,5,6,6,6,7,7,7,7,8,8,8,9,9,9,10,10,10,10,11,3,
> %T A124692 
> 10,2,12,12,13,13,13,13,10,14,14,15,15,5,16,3,16,16,17,17,17,18,18,18,11,19,19,19,20,
> %U A124692 
> 20,20,13,21,21,22,22,2,5,23,23,23,24,24,24,25,25,20,25,26,4,26,27,27,3,28,28,28,24,29
> %V 
> A124692 -1,-1,-1,-1,-1,-1,1,-1,-1,-1,1,4,4,4,5,5,5,6,6,6,7,7,7,7,8,8,8,9,9,9,10,10,10,10,11,3,
> %W A124692 
> 10,2,12,12,13,13,13,13,10,14,14,15,15,5,16,3,16,16,17,17,17,18,18,18,11,19,19,19,20,
> %X A124692 
> 20,20,13,21,21,22,22,2,5,23,23,23,24,24,24,25,25,20,25,26,4,26,27,27,3,28,28,28,24,29
> %N A124692 Position of the first n in the expansion of 2^n, or -1 if the 
> digits of n never appear.
> %o A124692 (PARI) digitposmton(n,m) = \ m^n expansion first occurrence of 
> n { local(x,y,r,dot); for(x=0,n, r = m^x; if(r==floor(r), 
> y=find(Str(floor(r)),x), y=find(Str(r),x); dot=find(Str(r),"."); if(dot < 
> y, y--); ); if(y, print1(y","),print1(-1",") ) )
> find(str,match) = \Return the position of the first occurrence of string 
> \match in string str { local(lnm,lns,x,c,i); str=Str(str); \This allows 
> leaving quotes off input match=Str(match); c=0; i=0; lns=length(str); 
> lnm=length(match); if(lnm>1,i=1); x=1;
> if(x>lns,return(0),return(x)) } mid(str,s,n) = \ Get a substring of length 
> n from string str starting at position s in str. { local(v,ln,x,tmp); v 
> =""; tmp = Vec(str); ln=length(tmp); for(x=s,s+n-1, v=concat(v,tmp[x]); ); 
> return(v) }
> %K A124692 base,easy,sign
> %O A124692 0,12
> %A A124692 Cino Hilliard (hillcino368(AT)hotmail.com), Dec 25 2006
>
> I tried to edit the description to the following:
>
> %N A124692 Starting position of the first n in the decimal expansion of 
> 2^n, reading the decimal string "2^n" from left to right; or -1 if the 
> digits of n never appear.
>
> and added some examples:
>
> %e A124692 2^6 = 64, where "6" appears in position 1, so a(6) = 1.
> %e A124692 2^10 = 1024, so a(10) = 1.
> %e A124692 But why is a(11) = 4?
>
> it seems to me a(11) = -1 since 2^11 = 2048
>
> What am I missing?
>
> Neil
>
> 





> it seems to me a(11) = -1 since 2^11 = 2048

For terms greater than a(10), whenever the digits of n never appear,  
Cino's list sports the number of digits in 2^n, instead of -1. It's  
possible that this is just an erroneous output from his coding, but I  
cannot confirm this since I do not speak PARI. There is no reason why  
we cannot use 0 instead of -1, thus removing the sequence from the  

In Mathematica, I used:

t = {}; Do[s = StringPosition[ToString[2^n], ToString[n]]; If[s ==  
{}, t = Append[t, 0], t = Append[t, s[[1]][[1]]]], {n, 0, 999}]; t

... to get:

{0, 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 0, 0, 0, 0, 0, 0, 198, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  
0, 0, 0, 185, 0, 0, 182, 0, 42, 0, 17, 0, 196, 0, 0, 0, 0, 0, 0, 0,  
0, 0, 19, 0, 0, 0, 0, 0, 93, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 107, 0,  
0, 0, 0, 0, 220, 0, 0, 0, 0, 0, 40, 0, 0, 5, 0, 0, 0, 0, 25, 0, 0,  
142, 187, 0, 0, 0, 0, 217, 0, 0, 0, 127, 0, 0, 0, 0, 78, 27, 0, 0, 0,  
47, 0, 0, 0, 72, 5, 141, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 200, 0, 0, 0, 0, 236, 0, 0, 0, 0, 93,  
0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 185, 0,  
212, 0, 0, 0, 203, 0, 0, 0, 0, 56, 0, 0, 0, 32, 0, 78, 218, 0, 0, 0,  
0, 0, 0, 124, 55, 0, 0, 0, 253, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  
246, 0, 79, 0, 0, 0, 0, 66, 0, 0, 68, 0, 0, 0, 0, 154, 0, 0, 0, 0, 0,  
0, 0, 0, 0, 0, 179, 0, 246, 0, 0, 0, 0, 0, 131, 0, 0, 0, 115, 157,  
137, 150, 0, 0, 92, 0, 0, 0, 0, 0, 0, 0, 253, 0, 0, 242, 0, 0, 0,  
164, 0, 0, 0, 58, 0, 51, 0, 243, 0, 0, 62, 187, 0, 27, 0, 0, 139,  
171, 0, 0, 279, 0, 0, 0, 0, 0, 0, 0, 0, 249, 0, 0, 0, 0, 212, 193, 0,  
0, 0, 0, 0, 0, 0, 276, 0, 202, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0,  
0, 0}





More information about the SeqFan mailing list