[go: up one dir, main page]

login
A062845
When expressed in base 2 and then interpreted in base 3, is a multiple of the original number.
15
0, 1, 5, 6, 10, 12, 30, 36, 60, 120, 180, 215, 216, 252, 360, 430, 432, 1080, 2730, 3276, 13710, 14724, 16380, 20520, 24624, 24840, 27125, 27420, 32760, 38880, 48606, 49091, 54250, 54840, 97212, 98280
OFFSET
1,3
COMMENTS
The numbers 2*m, 4*m and 8*m are also terms of the sequence for m=a(122). - Dimiter Skordev, Mar 29 2020
LINKS
Dimiter Skordev, Table of n, a(n) for n = 1..122 (terms < 10^15, terms 1..36 from Erich Friedman, 37..111 from Dimiter Skordev, 112..120 from Giovanni Resta)
Dimiter Skordev, Pascal program
Dimiter Skordev, Python script
EXAMPLE
30 = 11110_2; 11110_3 = 120 = 4*30.
MATHEMATICA
{0} ~Join~ Select[Range[10^5], Mod[ FromDigits[ IntegerDigits[#, 2], 3], #] == 0 &] (* Giovanni Resta, Dec 10 2019 *)
PROG
(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
(PARI) isok(m) = (m==0) || fromdigits(digits(m, 2), 3) % m == 0; \\ Michel Marcus, Feb 15 2020
(Python)
def BaseUp(n, b):
up, b1 = 0, 1
while n > 0:
up, b1, n = up+(n%b)*b1, b1*(b+1), n//b
return up
n, k = 1, 0
print(1, 0)
while n < 35:
n, k = n+1, k+1
while BaseUp(k, 2)%k != 0:
k = k+1
print(n, k) # A.H.M. Smeets, Mar 31 2020
KEYWORD
base,nonn
AUTHOR
Erich Friedman, Jul 21 2001
STATUS
approved