Pan base non-primes: Difference between revisions

m
m (→‎{{header|J}}: Works correctly but showing wrong count.)
Line 52:
 
=={{header|J}}==
{{improve|J|Probably not doing anything wrong but there are 377 (378 if you include 1) pan-base non-primes up to 1000. 63 (64) is just the odd count}}
Implementation:<lang J>pbnp=: {{ if. 10 > y do. -.1 p: y return. end.
digits=. 10 #.inv y
Line 61 ⟶ 60:
20{.(#~ 2&|)1+I.pbnp 1+i.1e3 NB. first 20 odd pan based non primes
1 9 33 39 55 63 69 77 93 99 121 143 165 169 187 231 253 273 275 297
#(#~ 2&|)1+I.pbnp 1+i.1e3 NB. number of pan based non primes up to 1000
378
#(#~ 2&|)1+I.pbnp 1+i.1e3 NB. number of odd pan based non primes up to 1000
64
100*(+/%#)2|1+I.pbnp 1+i.1e3 NB. percent odd pan based non primes up to 1000
6,962

edits