[seqfan] Re: Numbers that are the sum of x nonzero y-th powers

M. F. Hasler oeis at hasler.fr
Thu Aug 13 12:38:20 CEST 2020


3On Thu, Aug 13, 2020 at 10:21 AM David Corneth <davidacorneth at gmail.com>
wrote:

> As far as I can see the editing of these sequences is done. Thanks for the
> help!
>

I just got a message

*OEIS Server*: This sequence has not been edited or commented on for a
week yet is not proposed for review. If it is ready for review, please
visit https://oeis.org/draft/A003332 and click the button that reads
"These changes are ready for review by an OEIS Editor." Thanks. - The
OEIS Server

And that draft still has the lengthy (20+ lines) partially "buggy" list of
crossrefs (and idem for the "adjacent" sequences).
Now that we have an index page I think we could replace this list by s
shorter "navigational aid"
(e.g., "Ax .. Ay (analog for k=2..12); Az..Aw (analog for m=2..12)" plus a
link to the index page, do others agree ?)

Also, I wonder whether it's useful to replace the earlier 1K b-file by a
10K b-file when all integers > 471 are in the sequence.


> Thanks for the code above Maximilian! I didn't know things like printf
> work here.
>

Yes, printf() has been there for quite some time and is a good choice, I
think.

Very unfortunately, it has been decided very recently that Strprintf() is
scheduled to be removed in favour of strprintf().
I think that's a very regrettable choice. (If it were up to me, I'd have
chosen the well known name "sprintf()" as alias for the already established
Strprintf(), preserving backward compatibility at least until sprintf would
have replaced Strprintf in common use...)


> It must be me but I tried using
> fmt(r)=strprintf("%s A%06d (%d, %d)",
> if(r[1]>404,",","Cf."),r[1],r[2],r[3])
> ref=concat([ fmr(r)  | r <- v ])
>

Oops! in the second line, "fmt" is misspelled as "fmr"! (now
corrected above.)

What should r be? Like the list I put?
>

The syntax "... | r <- v "  means " for r in v ", i.e., r runs over all
elements of the vector v.
The vector v should be your list of  (  [n,k,m]  )  as given in your post
from  Aug 4, 2020 at 5:13 AM:

v = [ [404, 2, 2], [3325, 2, 3] /*,...: see your post from Aug 4 */ ]
fmt(r)=Strprintf("%s A%06d (%d, %d)", if(r[1]>404,",","Cf."),r[1],r[2],r[3])
ref=concat([ fmt(r)  | r <- v ])  /* fmt(r), not fmr ! */

NB: In the above I put the older "Strprintf" (instead of "strprintf" as
suggested in the latest version).


> I tried changing fmr to fmt but that didn't help.
>

It should have worked, then.... I suspect that the problem ("*not a
function in function call*"?) is due to strprintf instead of Strprintf.
Sorry for that. If the change is so recent that it's only in the latest
development version, maybe I can convince the PARI/GP developers to keep
Strprintf and introduce sprintf as an alias...

PS: the list can be sorted by k or m using "v=vecsort(v,2)"  (to sort by
2nd component, 3 for 3rd component).

Best wishes,
Maximilian



More information about the SeqFan mailing list