login
When expressed in base 2 and then interpreted in base 3, is a multiple of the original number.
15

%I #95 Sep 08 2022 08:45:03

%S 0,1,5,6,10,12,30,36,60,120,180,215,216,252,360,430,432,1080,2730,

%T 3276,13710,14724,16380,20520,24624,24840,27125,27420,32760,38880,

%U 48606,49091,54250,54840,97212,98280

%N When expressed in base 2 and then interpreted in base 3, is a multiple of the original number.

%C The numbers 2*m, 4*m and 8*m are also terms of the sequence for m=a(122). - _Dimiter Skordev_, Mar 29 2020

%H Dimiter Skordev, <a href="/A062845/b062845.txt">Table of n, a(n) for n = 1..122</a> (terms < 10^15, terms 1..36 from Erich Friedman, 37..111 from Dimiter Skordev, 112..120 from Giovanni Resta)

%H Dimiter Skordev, <a href="/A062845/a062845_1.pas.txt">Pascal program</a>

%H Dimiter Skordev, <a href="/A062845/a062845_1.py.txt">Python script</a>

%e 30 = 11110_2; 11110_3 = 120 = 4*30.

%t {0} ~Join~ Select[Range[10^5], Mod[ FromDigits[ IntegerDigits[#, 2], 3], #] == 0 &] (* _Giovanni Resta_, Dec 10 2019 *)

%o (Magma) [0] cat [k:k in [1..100000]|Seqint(Intseq(Seqint(Intseq(k, 2))),3) mod k eq 0]; // _Marius A. Burtea_, Dec 29 2019

%o (PARI) isok(m) = (m==0) || fromdigits(digits(m, 2), 3) % m == 0; \\ _Michel Marcus_, Feb 15 2020

%o (Python)

%o def BaseUp(n,b):

%o up, b1 = 0, 1

%o while n > 0:

%o up, b1, n = up+(n%b)*b1, b1*(b+1), n//b

%o return up

%o n, k = 1, 0

%o print(1,0)

%o while n < 35:

%o n, k = n+1, k+1

%o while BaseUp(k,2)%k != 0:

%o k = k+1

%o print(n,k) # _A.H.M. Smeets_, Mar 31 2020

%Y Cf. A062846, A062847, A062848, A062849, A062850, A032533, A062853.

%Y Cf. A005836.

%K base,nonn

%O 1,3

%A _Erich Friedman_, Jul 21 2001