Permutations, Anagrams, Rotations (was: More digital silliness)

zak seidov zakseidov at yahoo.com
Fri Jan 11 07:45:32 CET 2008



Some occasional square anagrams: exactly 9 terms

{10400625,14062500,16040025,16402500,25040016,25401600,41602500,50126400,60140025}
= 
squares of
{3225,3750,4005,4050,5004,5040,6450,7080,7755}
from which {4005,4050,5004,5040} are themselves 4-term
anagrams!!

exactly 10 terms:
{12348196,19324816,19412836,31281649,34916281,42981136,48219136,81234169,83192641,91623184}
= squares of 
{3514,4396,4406,5593,5909,6556,6944,9013,9121,9572}
from which none are anagrams

exactly 11 terms:
{14243076,31270464,37601424,41370624,43046721,44076321,47032164,47320641,61027344,73410624,73462041}
= squares of
{3774,5592,6132,6432,6561,6639,6858,6879,7812,8568,8571}
from which {6858,8568} are  2-term  anagrams.

None of these square anagrams include rotated squares,

zak 

--- zak seidov <zakseidov at yahoo.com> wrote:

> Mathematica code for calculating 
> permutations, anagrams and rotations of 10-base
> integer n:
> 
> id[n_]:=IntegerDigits[n] 
> ndd[n_]:=Length[id[n]]
> permutations[n_]:=FromDigits/@Permutations[id[n]]
> anagrams[n_]:=Select[perms[n],ndd[#]\[Equal]ndd[n]&]
>
rotations[n_]:=Select[FromDigits/@NestList[RotateRight[#]&,id[n],ndd[n]-1],ndd[#]\[Equal]ndd[n]&]
> 
> 
> For David's number:
> permutations[25600]
> 
> Out[48]=
>
{25600,25060,25006,26500,26050,26005,20560,20506,20650,20605,20056,20065,52600,52060,52006,56200,56020,56002,50260,50206,50620,50602,50026,50062,62500,62050,62005,65200,65020,65002,60250,60205,60520,60502,60025,60052,2560,2506,2650,2605,2056,2065,5260,5206,5620,5602,5026,5062,6250,6205,6520,6502,6025,6052,256,265,526,562,625,652}
> 
> In[49]:=
> anagrams[25600]
> 
> Out[49]=
>
{25600,25060,25006,26500,26050,26005,20560,20506,20650,20605,20056,20065,52600,52060,52006,56200,56020,56002,50260,50206,50620,50602,50026,50062,62500,62050,62005,65200,65020,65002,60250,60205,60520,60502,60025,60052}
> 
> In[50]:=
> rotations[25600]
> 
> Out[50]=
> {25600,60025,56002}
> 
> Number of rotations <= number of anagrams <=  number
> of permutations.
> Number of anagrams = number of permutations for
> zero-less integers, e.g., 23513.
> Number of rotations  = number of anagrams for one
> digit integers (0..9), and 
> for zero-less two-digit integers (13, 47 etc.).
> zak
> 
> --- "David W. Wilson" <wilson.d at anseri.com> wrote:
> 
> > I like to distinguish between 'permutation' and
> > 'anagram'.
> > 
> > For a word w in language L, a string s is a
> > permutation of w if s and w have
> > the same number of each symbol they contain. A
> > string s is an anagram of w
> > if it additionally belongs to w.
> > 
> > For example, if L is the English language, then
> the
> > word 'stop' has
> > permutations 'ospt', 'sopt', 'spot', 'post',
> 'spto',
> > etc. Of these
> > permutations, only 'spot' and 'post' are anagrams,
> > since they are in L.
> > Think about it. In the game of anagrams, you could
> > not play 'ospt' as an
> > anagram of 'spot', since 'ospt' is not a word.
> > 
> > Similarly, let L be the language of standard
> base-10
> > representations of
> > positive integers. Then L consists of the strings
> of
> > 1 or more decimal
> > digits not starting in 0. In this language, 25600
> > has the permutations
> > 20605, 06502, and 60025, but of these 06502 is not
> > an anagram, since it is
> > not a standard base-10 integer representation,
> > because it starts with 0.
> > 
> > 
> > 
> > 
> 
> 
> 
> 
>      
>
____________________________________________________________________________________
> Never miss a thing.  Make Yahoo your home page. 
> http://www.yahoo.com/r/hs
> 



      ____________________________________________________________________________________
Never miss a thing.  Make Yahoo your home page. 
http://www.yahoo.com/r/hs




I have problems understanding A135393 = 1,1,2,2,2,1,2,1,2,..
Leaving aside the count for a(1)=1, the circular permutations
of [n] satisfying the constraint on absolute differences of
neighbors being at most 2 are

n=2: (1 2 ) 
n=3: (1 2 3 ),(1 3 2 )
n=4: (1 2 4 3 ),(1 3 4 2 )
n=5: (1 2 4 5 3 ),(1 3 5 4 2 )
n=6: (1 2 4 6 5 3 ),(1 3 5 6 4 2 )
n=7: (1 2 4 6 7 5 3 ),(1 3 5 7 6 4 2 )
n=8: (1 2 4 6 8 7 5 3 ),(1 3 5 7 8 6 4 2 )
n=9: (1 2 4 6 8 9 7 5 3 ),(1 3 5 7 9 8 6 4 2 )
n=10: (1 2 4 6 8 10 9 7 5 3 ),(1 3 5 7 9 10 8 6 4 2 )
n=11: (1 2 4 6 8 10 11 9 7 5 3 ),(1 3 5 7 9 11 10 8 6 4 2 )

This would  yield A135393=?,1,2,2,2,2,2,2,2,2,2,2,2...

If the interpretation is that permutations that are reflections
of each other are counted only once, each second permutation
above, ( 1 3 ... 2), is discarded, and we're left with
A135393=?,1,1,1,1,1,1,1,1,1,1,1

In both cases, the question mark symbolizes a(1) which is either a(1)=1
considering the original posting in the reference, or a(1)=0 if
the interpretation is that in a circular permutation of [1],
the 1 is it's own neighbor which also must obey |p(i)-p(i-1)|=1 or 2.
Is there any way of actually obtaining the alternating 1,2,1,2,...

--
Richard





More information about the SeqFan mailing list