A049345 n written in primorial base.
Links
- Reinhard Zumkeller, Table of n, a(n) for n = 0..2099
- Anthony Overmars, Survey of RSA Vulnerabilities, in: Menachem Domb (ed.), Modern Cryptography - Current Challenges and Solutions, Intechopen, 2019, pp. 17-41. See pp. 29-30.
- Index entries for sequences related to primorial base.
Crossrefs
Programs
-
Haskell
a049345 n | n < 2100 = read $ concatMap show (a235168_row n) :: Int | otherwise = error "ambiguous primorial representation" -- Reinhard Zumkeller, Jan 05 2014
-
Mathematica
Table[FromDigits@ IntegerDigits[n, MixedRadix[Reverse@ Prime@ Range@ 8]], {n, 0, 51}] (* Michael De Vlieger, Aug 23 2016, Version 10.2 *)
-
PARI
A049345(n, p=2) = if(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
-
Python
from sympy import nextprime def a(n, p=2): if n>2099: print("Error! Ambiguous primorial representation when n is larger than 2099") else: return n if n
-
Scheme
(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))))))) ;; Antti Karttunen, Aug 26 2016
Comments