---------- Forwarded message ----------
From: Bhavin Moriya <[email protected]>
Date: Mon, Jul 21, 2014 at 9:07 AM
Subject: SAGE
To: William Stein <[email protected]>
Dear Sir,
Friend of mine written up following code to generate The Rudin Shapiro Sequence.
def count_11(st):
count = 0
for i in range(len(st)-1):
if st[i] == '1' and st[i+1] == '1':
count += 1
return count
def rudin_shapiro(n):
return (1-(-1)**count_11(Integer(n).str(2)))/2
The thing is every time I wanna use it, I have to run this code. Now,
I just wanna know how do I make it work like the in-built command in
sage. Like for factoring number 10. I just need to say factor(10).
Thank you very much.
Bhavin.
Bhavin K Moriya
NASI Research Associate
Harish Chandra Research Institute
Chhatnag Road, Jhusi
Allahabad - 211 019.
"Only the gentle are ever really strong."
- James Dean
--
William Stein
Professor of Mathematics
University of Washington
http://wstein.org
--
You received this message because you are subscribed to the Google Groups
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.