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.

A287874 Concatenate prime factorization as in A080670, but write everything in binary.

This page as a plain text file.
%I A287874 #33 Apr 11 2021 03:59:04
%S A287874 1,10,11,1010,101,1011,111,1011,1110,10101,1011,101011,1101,10111,
%T A287874 11101,10100,10001,101110,10011,1010101,11111,101011,10111,101111,
%U A287874 10110,101101,1111,1010111,11101,1011101,11111,10101,111011,1010001,101111,10101110,100101
%N A287874 Concatenate prime factorization as in A080670, but write everything in binary.
%C A287874 As in A080670 the prime factorization of n is written as p1^e1*...*pN^eN (except for exponents eK = 1 which are omitted), with all factors and exponents in binary (cf. A007088). Then "^" and "*" signs are dropped and all binary digits are concatenated.
%C A287874 See A230625 for the terms written in base 10, and for further information (fixed points, trajectories).
%H A287874 Robert Israel, <a href="/A287874/b287874.txt">Table of n, a(n) for n = 1..10000</a>
%F A287874 a(n) = A007088(A230625(n)). - _R. J. Mathar_, Jun 16 2017
%e A287874 a(1) = 1 by convention.
%e A287874 a(2) = 10 (= 2 written in binary).
%e A287874 a(4) = 1010 = concatenate(10,10), since 4 = 2^2 = 10[2] ^ 10[2].
%e A287874 a(6) = 1011 = concatenate(10,11), since 6 = 2*3 = 10[2] * 11[2].
%e A287874 a(8) = 1011 = concatenate(10,11), since 8 = 2^3 = 10[2] ^ 11[2].
%p A287874 f:= proc(n) local F, L, i;
%p A287874     F:= map(op,subs(1=NULL, sort(ifactors(n)[2], (a,b) -> a[1] < b[1])));
%p A287874     F:= map(convert, F, binary);
%p A287874     L:= map(length,F);
%p A287874     L:= ListTools:-Reverse(ListTools:-PartialSums(ListTools:-Reverse(L)));
%p A287874     add(F[i]*10^L[i+1],i=1..nops(F)-1)+F[-1];
%p A287874 end proc:
%p A287874 f(1):= 1:
%p A287874 map(f, [$1..100]); # _Robert Israel_, Jun 20 2017
%t A287874 fn[1] = 1; fn[n_] := FromDigits[Flatten[IntegerDigits[DeleteCases[Flatten[FactorInteger[n]], 1], 2]]];
%t A287874 Table[fn[n], {n, 37}] (* _Robert Price_, Mar 16 2020 *)
%o A287874 (PARI) A287874(n)=if(n>1,fromdigits(concat(apply(binary,select(t->t>1,concat(Col(factor(n))~)))),10),1) \\ _M. F. Hasler_, Jun 21 2017
%o A287874 (Python)
%o A287874 from sympy import factorint
%o A287874 def a(n):
%o A287874     f=factorint(n)
%o A287874     return 1 if n==1 else int("".join(bin(i)[2:] + bin(f[i])[2:] if f[i]!=1 else bin(i)[2:] for i in f))
%o A287874 print([a(n) for n in range(1, 101)]) # _Indranil Ghosh_, Jun 23 2017
%Y A287874 Cf. A080670, A230625, A230626, A230627, A287875.
%K A287874 nonn,base
%O A287874 1,2
%A A287874 _N. J. A. Sloane_, Jun 15 2017
%E A287874 Edited by _M. F. Hasler_, Jun 21 2017