A247883 Consecutive exclusionary cubes: Digits of n are not present in n^3 and digits of n+1 are not present in (n+1)^3.
2, 7, 47, 52, 187, 222, 477, 587, 5522, 6777
Offset: 1
Crossrefs
Cf. A029785.
Programs
-
Maple
filter:= proc(n) convert(convert(n,base,10),set) intersect convert(convert(n^3,base,10),set) = {} end proc: select(t -> filter(t) and filter(t+1), [seq(i,i=2..10^6, 5)]); # Robert Israel, Mar 10 2025
-
PARI
for(n=1,10^6,s=digits(n);t=digits(n+1);s3=digits(n^3);t3=digits((n+1)^3);if(#vecsort(concat(s,s3),,8)==#vecsort(s,,8)+#vecsort(s3,,8)&vecsort(concat(t,t3),,8)==#vecsort(t,,8)+#vecsort(t3,,8),print1(n,", ")))
-
Python
for n in range(10**6): s, t = str(n), str(n+1) s3, t3 = str(n**3), str((n+1)**3) c = 0 for i in s: if s3.count(i): c += 1 break for j in t: if t3.count(j): c += 1 break if not c: print(n, end=', ')
Extensions
Definition corrected by Robert Israel, Mar 10 2025
Comments