A235807 Numbers n such that n^3 has one or more occurrences of exactly five different digits.
22, 24, 27, 29, 32, 35, 38, 41, 47, 48, 49, 51, 52, 54, 55, 57, 61, 63, 65, 71, 72, 82, 85, 87, 89, 94, 96, 102, 103, 104, 105, 108, 109, 119, 120, 123, 125, 126, 127, 130, 133, 134, 136, 137, 138, 141, 143, 144, 149, 152, 153, 154, 155, 158, 162, 165, 167
Offset: 1
Examples
22 is in the sequence because 22^3 = 10648, which contains exactly five different digits: 0, 1, 4, 6, 8. 87 is in the sequence because 87^3 = 658503, which contains exactly five different digits: 0, 3, 5, 6, 8.
Links
- Colin Barker, Table of n, a(n) for n = 1..1000
Programs
-
Magma
[n: n in [0..200] | #Set(Intseq(n^3)) eq 5]; // Bruno Berselli, Jan 19 2014
-
Mathematica
Select[Range[200], Length[Union[IntegerDigits[#^3]]] == 5 &] (* Bruno Berselli, Jan 19 2014 *)
-
PARI
s=[]; for(n=1, 200, if(#vecsort(eval(Vec(Str(n^3))),,8)==5, s=concat(s, n))); s
-
Python
A235807_list, m = [], [6, -6, 1, 0] for n in range(1,10**5+1): for i in range(3): m[i+1] += m[i] if len(set(str(m[-1]))) == 5: A235807_list.append(n) # Chai Wah Wu, Nov 05 2014