Not J as such,  but one might consider including 2 & 5,  which are also 
"upside-downable"-ish,  partly depending on the font.

Have you considered a constructive approach?  
Eg take any number with only u-d digits possibly starting 0 in but not ending 
in 0;  
prepend the rotations of the reverse of all its digits or of all but the first.
Say, 016:  prepend 910 for 910016 or 91 for 91016.

Any use?

Mike

Sent from my iPad

> On 26 Aug 2023, at 15:43, Richard Donovan <rsdono...@hotmail.com> wrote:
> 
> Thanks Pascal,  Raul et al
> 
> For context, a friend just celebrated his 69th birthday and I noted this age 
> reads the same either way up. For practice i wanted to write a J function 
> that outputs all such possible numbers!
> 
> I am starting by finding all candidate numbers (those having only digits 0 1 
> 6 8 9, (I'm assuming 1 is upside-downable, even though when typed it isn't!). 
> The next steps will be (1) to swap 6s with 9s and v.v. , then (2) reverse the 
> digits and compare for equality.
> 
> So using the supplied algorithm, i can now perform the first step as follows:
> 
> seli=: 1 : 'u # ]'
> 
> 5 20 $ 0 1 6 8 9 (*./@:(e.~)&~.&(/:~) 10&#. inv)("1 0) seli i.1000
> 
>  0   1   6   8   9  10  11  16  18  19  60  61  66  68  69  80  81  86  88  89
> 
> 90  91  96  98  99 100 101 106 108 109 110 111 116 118 119 160 161 166 168 169
> 
> 180 181 186 188 189 190 191 196 198 199 600 601 606 608 609 610 611 616 618 
> 619
> 
> 660 661 666 668 669 680 681 686 688 689 690 691 696 698 699 800 801 806 808 
> 809
> 
> 810 811 816 818 819 860 861 866 868 869 880 881 886 888 889 890 891 896 898 
> 899..
> 
> 
> That is step 0.  I can now try to add steps 1 and 2!
> 
> 
> Sorry to be so frivolous but it helps me learn!
> 
> [I just noticed I also need to remove all found numbers ending with zero!]
> 
> Cheers,
> 
> Richard
> ________________________________
> From: Programming <programming-boun...@forums.jsoftware.com> on behalf of 
> Raul Miller <rauldmil...@gmail.com>
> Sent: 26 August 2023 13:46
> To: programm...@jsoftware.com <programm...@jsoftware.com>
> Subject: Re: [Jprogramming] integers occur in integers?
> 
> Yes... using rank 1 0 on the implementation is a good alternative to
> boxing. Using the approach I had come up with (I have not done any
> benchmarking here), this could be:
> 
>   3 2 1((0 = #@-.~) 10&#. inv)("1 0) 230 123 111 123123132
> 0 1 1 1
> 
> --
> Raul
> 
>> On Sat, Aug 26, 2023 at 8:30 AM 'Pascal Jasmin' via Programming
>> <programm...@jsoftware.com> wrote:
>> 
>> 
>> 3 2 1(*./@:(e.~)&~.&(/:~) 10&#. inv)("1 0) 230 123 111 123123132
>> 
>> 0 1 1 1
>> 
>> 
>>    On Saturday, August 26, 2023 at 06:31:01 a.m. EDT, Richard Donovan 
>> <rsdono...@hotmail.com> wrote:
>> 
>> I am trying to find out whether a series of integers y only contain a set of 
>> integers x
>> 
>> That is,        1 3 5 verb 5311 10531 536 1111111
>> should return 1 0 1 1
>> 
>>  NB. only 1 3 5 occur in 5311
>>  NB. not only 1 3 5  occur in 10531
>>  NB. not only 1 3 5  occur in 536
>>  NB. only 1 3 5 occur in 1111111
>> 
>> NB. x only contains digits 0-9 without repeat. #x is max 10
>> NB. leading zeros should be ignored in elements of y. No max for #y
>> 
>> I have tried several methods using combinations of e. i. under< etc. but 
>> haven't yet found a succinct verb that achieves what I want.
>> 
>> I hope my description is clear
>> 
>> Help gratefully received!
>> ----------------------------------------------------------------------
>> For information about J forums see 
>> https://gbr01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.jsoftware.com%2Fforums.htm&data=05%7C01%7C%7Cfc3c691e115b40932d0308dba6328760%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638286508177264390%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=1ytPgz0JzCdAkwUd%2FHZFVD9fIHh870N5I%2BFPql2qy1w%3D&reserved=0<http://www.jsoftware.com/forums.htm>
>> 
>> ----------------------------------------------------------------------
>> For information about J forums see 
>> https://gbr01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.jsoftware.com%2Fforums.htm&data=05%7C01%7C%7Cfc3c691e115b40932d0308dba6328760%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638286508177264390%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=1ytPgz0JzCdAkwUd%2FHZFVD9fIHh870N5I%2BFPql2qy1w%3D&reserved=0<http://www.jsoftware.com/forums.htm>
> ----------------------------------------------------------------------
> For information about J forums see 
> https://gbr01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.jsoftware.com%2Fforums.htm&data=05%7C01%7C%7Cfc3c691e115b40932d0308dba6328760%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638286508177264390%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=1ytPgz0JzCdAkwUd%2FHZFVD9fIHh870N5I%2BFPql2qy1w%3D&reserved=0<http://www.jsoftware.com/forums.htm>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to