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.
%I A049345 #43 Oct 22 2024 15:28:02 %S A049345 0,1,10,11,20,21,100,101,110,111,120,121,200,201,210,211,220,221,300, %T A049345 301,310,311,320,321,400,401,410,411,420,421,1000,1001,1010,1011,1020, %U A049345 1021,1100,1101,1110,1111,1120,1121,1200,1201,1210,1211,1220,1221,1300,1301,1310,1311 %N A049345 n written in primorial base. %C A049345 Places reading from right have values (1, 2, 6, 30, 210, ...) = primorials. %C A049345 For n < 10 * 7# = 2100: a(n) = concatenation of n-th row in A235168 and for n > 0: A055642(a(n)) = A235224(n); for larger numbers the representation in A235168 is more appropriate. - _Reinhard Zumkeller_, Jan 05 2014 %C A049345 In the long run, numbers have fewer digits in the primorial base than in the factorial base (cf. A007623), since factorial(n) < n^n < primorial(n) for n > 12. However, the point where the digits become larger than 9 comes earlier: as soon as 10*7*5*3*2 = 2100 for the primorial base vs 10! = 3628800 in the factorial base. From there on, the representation using concatenation of digits written in decimal becomes ambiguous. - _M. F. Hasler_, Sep 22 2014 %H A049345 Reinhard Zumkeller, <a href="/A049345/b049345.txt">Table of n, a(n) for n = 0..2099</a> %H A049345 Anthony Overmars, <a href="https://doi.org/10.5772/intechopen.84852">Survey of RSA Vulnerabilities</a>, in: Menachem Domb (ed.), Modern Cryptography - Current Challenges and Solutions, Intechopen, 2019, pp. 17-41. See pp. 29-30. %H A049345 <a href="/index/Pri#primorialbase">Index entries for sequences related to primorial base</a>. %t A049345 Table[FromDigits@ IntegerDigits[n, MixedRadix[Reverse@ Prime@ Range@ 8]], {n, 0, 51}] (* _Michael De Vlieger_, Aug 23 2016, Version 10.2 *) %o A049345 (Haskell) %o A049345 a049345 n | n < 2100 = read $ concatMap show (a235168_row n) :: Int %o A049345 | otherwise = error "ambiguous primorial representation" %o A049345 -- _Reinhard Zumkeller_, Jan 05 2014 %o A049345 (PARI) A049345(n, p=2) = if(n<p, n, A049345(n\p, nextprime(p+1))*10 + n%p) \\ Valid at least up to the point where digits > 9 would arise (n=10*7*5*3*2), thereafter the definition of the sequence is ambiguous. _M. F. Hasler_, Sep 22 2014 %o A049345 (Scheme) %o A049345 (define (A049345 n) (if (>= n 2100) (error "A049345: ambiguous primorial representation when n is larger than 2099:" n) (let loop ((n n) (s 0) (t 1) (i 1)) (if (zero? n) s (let* ((p (A000040 i)) (d (modulo n p))) (loop (/ (- n d) p) (+ (* t d) s) (* 10 t) (+ 1 i))))))) %o A049345 ;; _Antti Karttunen_, Aug 26 2016 %o A049345 (Python) %o A049345 from sympy import nextprime %o A049345 def a(n, p=2): %o A049345 if n>2099: print("Error! Ambiguous primorial representation when n is larger than 2099") %o A049345 else: return n if n<p else a(n//p, nextprime(p))*10 + n%p %o A049345 print([a(n) for n in range(101)]) # _Indranil Ghosh_, Jun 22 2017 %Y A049345 Cf. A000040, A002110 (primorials), A235168, A235224, A276086, A276150. %Y A049345 Cf. factorial base A007623. %K A049345 nonn,base,easy,nice %O A049345 0,3 %A A049345 _R. K. Guy_