cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A306645 a(n) is the least positive multiple of n belonging to A306263 if any, or a(n) = -1 otherwise.

This page as a plain text file.
%I A306645 #12 Mar 06 2019 08:36:46
%S A306645 1,2,6,4,10,6,42,8,18,10,66,12,156,42,60,16,34,18,228,20,42,66,92,24,
%T A306645 300,156,108,84,116,60,310,32,66,34,420,36,222,228,156,40,246,42,172,
%U A306645 132,180,92,2820,48,588,300,204,156,212,108,660,168,228,116,590,60
%N A306645 a(n) is the least positive multiple of n belonging to A306263 if any, or a(n) = -1 otherwise.
%C A306645 Is a(n) > 0 for every n > 0?
%F A306645 a(A306263(n)) = A306263(n) for any n > 0.
%e A306645 For n = 7:
%e A306645 - the divisors of 7 are: 1, 7,
%e A306645 - the corresponding Hamming weights are: 1, 3,
%e A306645 - 3 does not divide 7,
%e A306645 - the divisors of 3*7 are: 1, 3, 7, 21,
%e A306645 - the corresponding Hamming weights are: 1, 2, 3, 3,
%e A306645 - 2 does not divide 3*7,
%e A306645 - the divisors of 2*3*7 are: 1, 2, 3, 6, 7, 14, 21, 42,
%e A306645 - the corresponding Hamming weights are: 1, 1, 2, 2, 3, 3, 3, 3,
%e A306645 - they all divide 2*3*7,
%e A306645 - hence a(7) = 2*3*7 = 42.
%t A306645 With[{s = Select[Range[3000], With[{k = #}, AllTrue[Divisors@ k, Mod[k, DigitCount[#, 2, 1]] == 0 &]] &]}, Table[SelectFirst[s, Mod[#, n] == 0 &] /. k_ /; MissingQ@ k -> -1, {n, 60}]] (* _Michael De Vlieger_, Mar 05 2019 *)
%o A306645 (PARI) a(n) = while (1, my (m=n); fordiv (m, d, m = lcm(m, hammingweight(d));); if (n==m, return (n), n = m))
%Y A306645 Cf. A000120, A306263.
%K A306645 nonn,base
%O A306645 1,2
%A A306645 _Rémy Sigrist_, Mar 03 2019