OFFSET
1,2
COMMENTS
All terms are divisible by 9. - Eric M. Schmidt, Jul 12 2014
If x and y are in the sequence, then so is 10^m*x + y if y < 10^m. - Robert Israel, Mar 20 2017
From Petros Hadjicostas, Jul 29 2020: (Start)
This is Schuh's (1968) "doubles puzzle" (the double of k is 2*k). On five pages of his book, he finds the twelve 6-digit numbers that belong to this sequence (a(2) to a(13)) and the 288 7-digit numbers of the sequence (a(14) to a(301)).
All numbers in this sequence are permutations of numbers that are combinations of numbers from A336670, which is related to another puzzle of Schuh (1968). Before he solved this puzzle, he had to solve the puzzle described in A336670.
For example, a(2) = 125874 through a(13) = 428571 are all permutations of the number 512874, which is a combination of the numbers 512 and 874 that appear in A336670. (End)
REFERENCES
Fred Schuh, The Master Book of Mathematical Recreations, Dover, New York, 1968, pp. 31-35.
LINKS
David W. Wilson, Table of n, a(n) for n = 1..10001
Mark Dominus, When do n and 2n have the same digits?
MAPLE
Res:= 0:
for d from 1 to 7 do
for n from 10^(d-1)+8 to 5*10^(d-1)-1 by 9 do
if sort(convert(n, base, 10)) = sort(convert(2*n, base, 10)) then
Res:= Res, n
fi
od od:
Res; # Robert Israel, Mar 20 2017
MATHEMATICA
si[n_] := Sort@ IntegerDigits@ n; Flatten@ {0, Table[ Select[ Range[ 10^e+8, 5*10^e-1, 9], si[#] == si[2 #] &], {e, 6}]} (* Giovanni Resta, Mar 20 2017 *)
PROG
(Python)
def ok(n): return sorted(str(n)) == sorted(str(2*n))
print(list(filter(ok, range(1087543)))) # Michael S. Branicky, May 21 2021
(Python) # use with ok above for larger terms
def auptod(maxd):
return [0] + list(filter(ok, (n for d in range(2, maxd+1) for n in range(10**(d-1)-1, 5*10**(d-1), 9))))
print(auptod(7)) # Michael S. Branicky, May 22 2021
CROSSREFS
KEYWORD
nonn,base
AUTHOR
STATUS
approved