MathGroup Archive 2004

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: A list element replacement.

  • To: mathgroup at smc.vnet.net
  • Subject: [mg50910] Re: A list element replacement.
  • From: Roger Bagula <tftn at earthlink.net>
  • Date: Mon, 27 Sep 2004 00:42:22 -0400 (EDT)
  • References: <cj62r1$qne$1@smc.vnet.net>
  • Reply-to: tftn at earthlink.net
  • Sender: owner-wri-mathgroup at wolfram.com

Not the bset method , but here's how you replaced my code for it:
ID Number: A090722 <http://www.research.att.com/projects/OEIS?Anum=A090722>
URL:       http://www.research.att.com/projects/OEIS?Anum=A090722
Sequence <http://www.research.att.com/cgi-bin/access.cgi/as/njas/sequences/showtabl.cgi?A=A090722&format=4&height=4&seq=,2,0,3,2,1,3,1,0,2,0,3,2,3,1,0,2,0,3,1,3,1,2,0,3,2,1,3,2,0,2,1,1,0,2,3,2,3,1,0,0,3,2,1,0,3,2,1,3,1,0,0,2,3,1,0,2,0,3,3,2,0,3,2,0,2,2,1,3,1,2,3,1,3,1,2,0,1,1,0,0,3,1,3,1,2,0,3,2,1,2,0,1,3,1,0,3,0,2,2,3,1,0,2,2,3>:  2,0,3,2,1,3,1,0,2,0,3,2,3,1,0,2,0,3,1,3,1,2,0,3,2,1,3,2,0,2,
           1,1,0,2,3,2,3,1,0,0,3,2,1,0,3,2,1,3,1,0,0,2,3,1,0,2,0,3,3,2,
           0,3,2,0,2,2,1,3,1,2,3,1,3,1,2,0,1,1,0,0,3,1,3,1,2,0,3,2,1,2,
           0,1,3,1,0,3,0,2,2,3,1,0,2,2,3
Name:      a(n) = if 10 - Mod(Prime(n),10) == {1,3,7,9} respectively then
              {1,2,3,0}.
Math'ca:   Table[ ReplaceAll[ Mod[ Prime[n], 10], {1 -> 0, 3 -> 3, 7 -> 2, 9
              -> 1}], {n, 4, 108}]
See also:  Adjacent sequences: A090719 <http://www.research.att.com/cgi-bin/access.cgi/as/njas/sequences/eisA.cgi?Anum=A090719> A090720 <http://www.research.att.com/cgi-bin/access.cgi/as/njas/sequences/eisA.cgi?Anum=A090720> A090721 <http://www.research.att.com/cgi-bin/access.cgi/as/njas/sequences/eisA.cgi?Anum=A090721> this_sequence A090723 <http://www.research.att.com/cgi-bin/access.cgi/as/njas/sequences/eisA.cgi?Anum=A090723>
              A090724 <http://www.research.att.com/cgi-bin/access.cgi/as/njas/sequences/eisA.cgi?Anum=A090724> A090725 <http://www.research.att.com/cgi-bin/access.cgi/as/njas/sequences/eisA.cgi?Anum=A090725>
           Sequence in context: A035159 <http://www.research.att.com/cgi-bin/access.cgi/as/njas/sequences/eisA.cgi?Anum=A035159> A097418 <http://www.research.att.com/cgi-bin/access.cgi/as/njas/sequences/eisA.cgi?Anum=A097418> A026728 <http://www.research.att.com/cgi-bin/access.cgi/as/njas/sequences/eisA.cgi?Anum=A026728> this_sequence A082785 <http://www.research.att.com/cgi-bin/access.cgi/as/njas/sequences/eisA.cgi?Anum=A082785>
              A051613 <http://www.research.att.com/cgi-bin/access.cgi/as/njas/sequences/eisA.cgi?Anum=A051613> A077961 <http://www.research.att.com/cgi-bin/access.cgi/as/njas/sequences/eisA.cgi?Anum=A077961>
Offset:    4
Author(s): Roger L. Bagula (tftn(AT)earthlink.net), Jan 18 2004
Extension: Edited by Robert G. Wilson v (rgwv(AT)rgwv.com), Jan 19 2004


I think my method was more general,
but it no longer exists due to your editing.

Robert G. Wilson v wrote:

>HELP please,
>
>I have a list of many elements, some of which are identical, and wish
>to 'replace' elements in the first list with elements of a second list
>of unequal length.
>
>As an example, list 1 might equal {3, 4, 5, 6, 6, 6, 9, 2, 1} and if the
>elements {9, 3, 1} are present in list 1, when replace them with elements
>{2, 4}. Thus list 1 would become {4, 5, 6, 6, 6, 2, 2, 4}. I am not
>interested in order for I well use Sort at the end for presentation.
>
>Thank you in advance. Bob.
>
>  
>

-- 
Respectfully, Roger L. Bagula
tftn at earthlink.net, 11759Waterhill Road, Lakeside,Ca 92040-2905,tel: 619-5610814 :
URL :  http://home.earthlink.net/~tftn
URL :  http://victorian.fortunecity.com/carmelita/435/ 



  • Prev by Date: Re: unevaluated, hold, holdform
  • Next by Date: Hyperbolic function identity
  • Previous by thread: Re: A list element replacement.
  • Next by thread: Re: A list element replacement.