A358858 Least multiple m of n such that both m and m/n belong to A031443, or -1 if there is no such m.
2, -1, 147, -1, 10, 12, 3745, -1, 34587, 8990, 539, 2364, 156, 728, 135, -1, 153, 180, 38, 180, 42, 44, 805, 216, 50, 52, 3969, 56, 62089, 62850, 1022721, -1, 8515815, 2158830, 134715, 553212, 35557, 34428, 8814, 144120, 2296, 8442, 2107, 8668, 2205, 2254
Offset: 1
Examples
For n = 3 both 147 and 147/3=49 are in A031443.
Links
- Rémy Sigrist, Table of n, a(n) for n = 1..10000
- Rémy Sigrist, PARI program
Programs
-
PARI
See Links section.
-
Python
from itertools import count from sympy.utilities.iterables import multiset_permutations def isbalanced(n): b = bin(n)[2:]; return b.count("0") == b.count("1") def A031443gen(): yield from (int("1"+"".join(p), 2) for n in count(1) for p in multiset_permutations("0"*n+"1"*(n-1))) def a(n): if n > 1 and bin(n)[2:].strip("0") == "1": return -1 return next(k*n for k in A031443gen() if isbalanced(k*n)) print([a(n) for n in range(1, 47)]) # Michael S. Branicky, Dec 03 2022
Formula
a(n) = n*A358857(n) unless a(n) = -1. - Pontus von Brömssen, Dec 03 2022
Comments