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.

Showing 1-10 of 17 results. Next

A049345 n written in primorial base.

Original entry on oeis.org

0, 1, 10, 11, 20, 21, 100, 101, 110, 111, 120, 121, 200, 201, 210, 211, 220, 221, 300, 301, 310, 311, 320, 321, 400, 401, 410, 411, 420, 421, 1000, 1001, 1010, 1011, 1020, 1021, 1100, 1101, 1110, 1111, 1120, 1121, 1200, 1201, 1210, 1211, 1220, 1221, 1300, 1301, 1310, 1311
Offset: 0

Views

Author

Keywords

Comments

Places reading from right have values (1, 2, 6, 30, 210, ...) = primorials.
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
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

Crossrefs

Cf. A000040, A002110 (primorials), A235168, A235224, A276086, A276150.
Cf. factorial base A007623.

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(nA049345(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
    

A276150 Sum of digits when n is written in primorial base (A049345); minimal number of primorials (A002110) that add to n.

Original entry on oeis.org

0, 1, 1, 2, 2, 3, 1, 2, 2, 3, 3, 4, 2, 3, 3, 4, 4, 5, 3, 4, 4, 5, 5, 6, 4, 5, 5, 6, 6, 7, 1, 2, 2, 3, 3, 4, 2, 3, 3, 4, 4, 5, 3, 4, 4, 5, 5, 6, 4, 5, 5, 6, 6, 7, 5, 6, 6, 7, 7, 8, 2, 3, 3, 4, 4, 5, 3, 4, 4, 5, 5, 6, 4, 5, 5, 6, 6, 7, 5, 6, 6, 7, 7, 8, 6, 7, 7, 8, 8, 9, 3, 4, 4, 5, 5, 6, 4, 5, 5, 6, 6, 7, 5, 6, 6, 7, 7, 8, 6, 7, 7, 8, 8, 9, 7, 8, 8, 9, 9, 10, 4
Offset: 0

Views

Author

Antti Karttunen, Aug 22 2016

Keywords

Comments

The sum of digits of n in primorial base is odd if n is 1 or 2 (mod 4) and even if n is 0 or 3 (mod 4). Proof: primorials are 1 or 2 (mod 4) and a(n) can be constructed via the greedy algorithm. So if n = 4k + r where 0 <= r < 4, 4k needs an even number of primorials and r needs hammingweight(r) = A000120(r) primorials. Q.E.D. - David A. Corneth, Feb 27 2019

Examples

			For n=24, which is "400" in primorial base (as 24 = 4*(3*2*1) + 0*(2*1) + 0*1, see A049345), the sum of digits is 4, thus a(24) = 4.
		

Crossrefs

Cf. A333426 [k such that a(k)|k], A339215 [numbers not of the form x+a(x) for any x], A358977 [k such that gcd(k, a(k)) = 1].
Cf. A014601, A042963 (positions of even and odd terms), A343048 (positions of records).
Differs from analogous A034968 for the first time at n=24.

Programs

  • Mathematica
    nn = 120; b = MixedRadix[Reverse@ Prime@ NestWhileList[# + 1 &, 1, Times @@ Prime@ Range[# + 1] <= nn &]]; Table[Total@ IntegerDigits[n, b], {n, 0, nn}] (* Version 10.2, or *)
    nn = 120; f[n_] := Block[{a = {{0, n}}}, Do[AppendTo[a, {First@ #, Last@ #} &@ QuotientRemainder[a[[-1, -1]], Times @@ Prime@ Range[# - i]]], {i, 0, #}] &@ NestWhile[# + 1 &, 0, Times @@ Prime@ Range[# + 1] <= n &]; Rest[a][[All, 1]]]; Table[Total@ f@ n, {n, 0, 120}] (* Michael De Vlieger, Aug 26 2016 *)
  • PARI
    A276150(n) = { my(s=0, p=2, d); while(n, d = (n%p); s += d; n = (n-d)/p; p = nextprime(1+p)); (s); }; \\ Antti Karttunen, Feb 27 2019
  • Python
    from sympy import prime, primefactors
    def Omega(n): return 0 if n==1 else Omega(n//primefactors(n)[0]) + 1
    def a276086(n):
        i=0
        m=pr=1
        while n>0:
            i+=1
            N=prime(i)*pr
            if n%N!=0:
                m*=(prime(i)**((n%N)/pr))
                n-=n%N
            pr=N
        return m
    def a(n): return Omega(a276086(n))
    print([a(n) for n in range(201)]) # Indranil Ghosh, Jun 23 2017
    

Formula

a(n) = 1 + a(A276151(n)) = 1 + a(n-A002110(A276084(n))), a(0) = 0.
or for n >= 1: a(n) = 1 + a(n-A260188(n)).
Other identities and observations. For all n >= 0:
a(n) = A001222(A276086(n)) = A001222(A278226(n)).
a(n) >= A371091(n) >= A267263(n).
From Antti Karttunen, Feb 27 2019: (Start)
a(n) = A000120(A277022(n)).
a(A283477(n)) = A324342(n).
(End)
a(n) = A373606(n) + A373607(n). - Antti Karttunen, Jun 19 2024

A108731 Triangle read by rows: row n gives digits of n in factorial base.

Original entry on oeis.org

0, 1, 1, 0, 1, 1, 2, 0, 2, 1, 1, 0, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 2, 0, 1, 2, 1, 2, 0, 0, 2, 0, 1, 2, 1, 0, 2, 1, 1, 2, 2, 0, 2, 2, 1, 3, 0, 0, 3, 0, 1, 3, 1, 0, 3, 1, 1, 3, 2, 0, 3, 2, 1, 1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 2, 0, 1, 0, 2, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1
Offset: 0

Views

Author

Keywords

Comments

Row lengths are A084558. This sequence contains every finite sequence of nonnegative integers.
T(n,k)=A235168(n,k) for k=0..23; a(n) = A235168(n) for n=0..63, when both tables are seen as flattened lists. - Reinhard Zumkeller, Jan 05 2014

Examples

			Triangle begins:
  0
  1
  1, 0
  1, 1
  2, 0
  2, 1
  1, 0, 0
For example, 11 in factorial base is 121 (1*6 + 2*2 + 1*1), so row 11 is 1,2,1.
		

Crossrefs

Programs

  • Haskell
    a108731 n k = a108731_row n !! k
    a108731_row 0 = [0]
    a108731_row n = t n $ reverse $ takeWhile (<= n) $ tail a000142_list
       where t 0 []     = []
             t x (b:bs) = x' : t m bs where (x',m) = divMod x b
    a108731_tabf = map a108731_row [0..]
    -- Reinhard Zumkeller, Jun 04 2012
    
  • Maple
    b:= proc(n, i) local r; `if`(n b(n, 2)[]:
    seq(T(n), n=0..50);  # Alois P. Heinz, Mar 19 2014
  • Mathematica
    b[n_, i_] := b[n, i] = Module[{q, r}, If[n < i, {n}, {q, r} = QuotientRemainder[n, i]; Append[b[q, i + 1], r]]];
    T[n_] := b[n, 2];
    Table[T[n], {n, 0, 40}] // Flatten (* Jean-François Alcover, Feb 03 2018, after Alois P. Heinz *)
  • PARI
    A108731_row(n)={n=[n];while(n[1],n=concat(divrem(n[1],1+#n),n[^1]);n[1]||break);n[^1]~} \\ M. F. Hasler, Jun 20 2017
    
  • Python
    def row(n, i=2): return [n] if n < i else [*row(n//i, i=i+1), n%i]
    print([d for n in range(35) for d in row(n)]) # Michael S. Branicky, Oct 02 2024

Extensions

Added a(0)=0 and offset changed accordingly by Reinhard Zumkeller, Jun 04 2012

A267263 Number of nonzero digits in representation of n in primorial base.

Original entry on oeis.org

0, 1, 1, 2, 1, 2, 1, 2, 2, 3, 2, 3, 1, 2, 2, 3, 2, 3, 1, 2, 2, 3, 2, 3, 1, 2, 2, 3, 2, 3, 1, 2, 2, 3, 2, 3, 2, 3, 3, 4, 3, 4, 2, 3, 3, 4, 3, 4, 2, 3, 3, 4, 3, 4, 2, 3, 3, 4, 3, 4, 1, 2, 2, 3, 2, 3, 2, 3, 3, 4, 3, 4, 2, 3, 3, 4, 3, 4, 2, 3, 3, 4, 3, 4, 2, 3, 3, 4, 3, 4, 1, 2
Offset: 0

Views

Author

Cade Brown, Jan 12 2016

Keywords

Examples

			a(3) = 2 because 3 written in primorial base is 11 with 2 nonzero digits.
		

Crossrefs

Cf. A060735 (positions of ones).
A060130 is an analogous sequence for the factorial base, from which this differs for the first time at n=30, where a(30) = 1, while A060130(30) = 2.

Programs

  • Maple
    a:= proc(n) local m, p, r; m, p, r:= n, 2, 0;
           while m>0 do r:= r+`if`(irem(m, p, 'm')>0, 1, 0);
                        p:= nextprime(p)
           od; r
        end:
    seq(a(n), n=0..100);  # Alois P. Heinz, Jan 15 2016
  • Mathematica
    Table[Length[IntegerDigits[n, MixedRadix@ Prime@ Reverse@ Range@ PrimePi@ n] /. 0 -> Nothing], {n, 0, 120}] (* Michael De Vlieger, Jan 12 2016, Version 10.2 *)
    f[n_] := Block[{a = {{0, n}}}, Do[AppendTo[a, {First@ #, Last@ #} &@ QuotientRemainder[a[[-1, -1]], Times @@ Prime@ Range[# - i]]], {i, 0, #}] &@ NestWhile[# + 1 &, 0, Times @@ Prime@ Range[# + 1] <= n &]; Rest[a][[All, 1]]]; Table[Count[f@ n, d_ /; d > 0], {n, 0, 73}] (* Michael De Vlieger, Aug 29 2016 *)
  • PARI
    cnz(n) = my(d = digits(n)); sum(k=1, #d, d[k]!=0);
    A049345(n, p=2) = if(nA049345(n\p, nextprime(p+1))*10 + n%p)
    a(n) = cnz(A049345(n)); \\ Michel Marcus, Jan 12 2016
    
  • PARI
    a(n)=my(s); forprime(p=2,, if(n%p, s++, if(n==0, return(s))); n\=p) \\ Charles R Greathouse IV, Nov 17 2016

Formula

a(n) = A001221(A276086(n)). - Antti Karttunen, Aug 21 2016

A333426 Primorial base Niven numbers: numbers divisible by their sum of digits in primorial base (A276150).

Original entry on oeis.org

1, 2, 4, 6, 8, 9, 12, 16, 18, 20, 24, 25, 30, 32, 33, 36, 40, 42, 44, 45, 48, 50, 60, 64, 65, 66, 68, 70, 72, 77, 84, 88, 90, 92, 96, 105, 108, 112, 117, 120, 132, 133, 136, 144, 150, 154, 156, 160, 168, 180, 182, 184, 189, 192, 198, 200, 210, 212, 213, 216, 220
Offset: 1

Views

Author

Amiram Eldar, Mar 20 2020

Keywords

Comments

Numbers k for which A276086(k) is in A373852. - Antti Karttunen, Jun 22 2024

Examples

			1 is a term since A276150(1) = 1 divides 1;
2 is a term since A276150(2) = 1 divides 2;
		

Crossrefs

Programs

  • Mathematica
    max = 5; bases = Prime @ Range[max, 1, -1]; nmax = Times @@ bases - 1; sumdig[n_] := Plus @@ IntegerDigits[n, MixedRadix[bases]]; Select[Range[nmax], Divisible[#, sumdig[#]] &]
  • PARI
    isA333426 = A373834; \\ Antti Karttunen, Jun 22 2024

A235224 a(0) = 0, and for n > 0, a(n) = largest k such that A002110(k-1) <= n, where A002110(k) gives the k-th primorial number.

Original entry on oeis.org

0, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4
Offset: 0

Views

Author

Reinhard Zumkeller, Jan 05 2014

Keywords

Comments

For n > 0: a(n) = (length of row n in A235168) = A055642(A049345(n)).
For n > 0, a(n) gives the length of primorial base expansion of n. Also, after zero, each value n occurs A061720(n-1) times. - Antti Karttunen, Oct 19 2019

Crossrefs

Programs

  • Haskell
    a235224 n = length $ takeWhile (<= n) a002110_list
    
  • Maple
    A235224 := proc(n)
        local k;
        if n = 0 then
            0;
        else
            for k from 0 do
                if A002110(k-1) > n then
                    return k-1 ;
                end if;
            end do:
        end if;
    end proc: # R. J. Mathar, Apr 19 2021
  • Mathematica
    primorial[n_] := Times @@ Prime[Range[n]];
    a[n_] := TakeWhile[primorial /@ Range[0, n], # <= n &] // Length;
    Table[a[n], {n, 0, 100}] (* Jean-François Alcover, Oct 27 2021 *)
  • PARI
    A235224(n) = { my(s=0, p=2); while(n, s++; n = n\p; p = nextprime(1+p)); (s); }; \\ Antti Karttunen, Oct 19 2019
    
  • PARI
    A235224(n, p=2) = if(!n,n,if(nA235224(n\p, nextprime(p+1)))); \\ (Recursive implementation) - Antti Karttunen, Oct 19 2019

Formula

From Antti Karttunen, Oct 19 2019: (Start)
a(n) = A061395(A276086(n)).
For all n >= 0, a(n) >= A267263(n).
For all n >= 1, A000040(a(n)) > A328114(n). (End)

Extensions

Name corrected to match the data by Antti Karttunen, Oct 19 2019

A343044 Array T(n, k), n, k >= 0, read by antidiagonals; lunar addition table for the primorial base.

Original entry on oeis.org

0, 1, 1, 2, 1, 2, 3, 3, 3, 3, 4, 3, 2, 3, 4, 5, 5, 3, 3, 5, 5, 6, 5, 4, 3, 4, 5, 6, 7, 7, 5, 5, 5, 5, 7, 7, 8, 7, 8, 5, 4, 5, 8, 7, 8, 9, 9, 9, 9, 5, 5, 9, 9, 9, 9, 10, 9, 8, 9, 10, 5, 10, 9, 8, 9, 10, 11, 11, 9, 9, 11, 11, 11, 11, 9, 9, 11, 11, 12, 11, 10, 9, 10, 11, 6, 11, 10, 9, 10, 11, 12
Offset: 0

Views

Author

Rémy Sigrist, Apr 05 2021

Keywords

Comments

The i-th digit of T(n, k) in primorial base is the largest of the i-th digits of n and of k in primorial base.
For n = 0..23, the factorial and primorial base representations of n are the same; hence the date sections for this sequence and for A343040 are the same.

Examples

			Array T(n, k) begins:
  n\k|   0   1   2   3   4   5   6   7   8   9  10  11  12
  ---+----------------------------------------------------
    0|   0   1   2   3   4   5   6   7   8   9  10  11  12
    1|   1   1   3   3   5   5   7   7   9   9  11  11  13
    2|   2   3   2   3   4   5   8   9   8   9  10  11  14
    3|   3   3   3   3   5   5   9   9   9   9  11  11  15
    4|   4   5   4   5   4   5  10  11  10  11  10  11  16
    5|   5   5   5   5   5   5  11  11  11  11  11  11  17
    6|   6   7   8   9  10  11   6   7   8   9  10  11  12
    7|   7   7   9   9  11  11   7   7   9   9  11  11  13
    8|   8   9   8   9  10  11   8   9   8   9  10  11  14
    9|   9   9   9   9  11  11   9   9   9   9  11  11  15
   10|  10  11  10  11  10  11  10  11  10  11  10  11  16
   11|  11  11  11  11  11  11  11  11  11  11  11  11  17
   12|  12  13  14  15  16  17  12  13  14  15  16  17  12
		

Crossrefs

Programs

  • PARI
    See Links section.

A333423 Numbers that are palindromes in primorial base.

Original entry on oeis.org

0, 1, 3, 7, 9, 11, 31, 39, 47, 211, 217, 223, 229, 235, 243, 249, 255, 261, 267, 275, 281, 287, 293, 299, 2311, 2347, 2383, 2419, 2455, 2523, 2559, 2595, 2631, 2667, 2735, 2771, 2807, 2843, 2879, 30031, 30061, 30091, 30121, 30151, 30181, 30211, 30247, 30277, 30307
Offset: 1

Views

Author

Amiram Eldar, Mar 20 2020

Keywords

Examples

			3 is a term since its representation in primorial base is 11 (1 * 2# + 1) which is a palindrome.
7 is a term since its representation in primorial base is 101 (1 * 3# + 0 * 2# + 1 = 6 + 1) which is a palindrome.
		

Crossrefs

Programs

  • Mathematica
    max = 6; bases = Prime @ Range[max, 1, -1]; nmax = Times @@ bases - 1; Select[Range[0, nmax], PalindromeQ @ IntegerDigits[#, MixedRadix[bases]] &]

A343046 Array T(n, k), n, k >= 0, read by antidiagonals; lunar multiplication table for the primorial base.

Original entry on oeis.org

0, 0, 0, 0, 1, 0, 0, 2, 2, 0, 0, 3, 6, 3, 0, 0, 2, 8, 8, 2, 0, 0, 3, 6, 9, 6, 3, 0, 0, 6, 8, 8, 8, 8, 6, 0, 0, 7, 30, 9, 12, 9, 30, 7, 0, 0, 8, 32, 36, 14, 14, 36, 32, 8, 0, 0, 9, 36, 39, 30, 15, 30, 39, 36, 9, 0, 0, 8, 38, 38, 32, 36, 36, 32, 38, 38, 8, 0
Offset: 0

Views

Author

Rémy Sigrist, Apr 05 2021

Keywords

Comments

To compute T(n, k):
- write the primorial base representations of n and of k on two lines, right aligned,
- to "multiply" two digits: take the smallest,
- to "add" two digits: take the largest,
- for example, for T(9, 10):
9 -> 1 1 1
10 -> x 1 2 0
-------
0 0 0
1 1 1
+ 1 1 1
-----------
1 1 1 1 0 -> 248 = T(9, 10)
See A343044 for the corresponding addition table.

Examples

			Array T(n, k) begins:
  n\k|  0  1   2   3   4   5    6    7    8    9   10   11   12
  ---+---------------------------------------------------------
    0|  0  0   0   0   0   0    0    0    0    0    0    0    0
    1|  0  1   2   3   2   3    6    7    8    9    8    9    6  ->  A328841
    2|  0  2   6   8   6   8   30   32   36   38   36   38   30
    3|  0  3   8   9   8   9   36   39   38   39   38   39   36
    4|  0  2   6   8  12  14   30   32   36   38   42   44   60
    5|  0  3   8   9  14  15   36   39   38   39   44   45   66
    6|  0  6  30  36  30  36  210  216  240  246  240  246  210
    7|  0  7  32  39  32  39  216  217  248  249  248  249  216
    8|  0  8  36  38  36  38  240  248  246  248  246  248  240
    9|  0  9  38  39  38  39  246  249  248  249  248  249  246
   10|  0  8  36  38  42  44  240  248  246  248  252  254  270
   11|  0  9  38  39  44  45  246  249  248  249  254  255  276
   12|  0  6  30  36  60  66  210  216  240  246  270  276  420
		

Crossrefs

Programs

  • PARI
    See Links section.

Formula

T(n, k) = T(k, n).
T(m, T(n, k)) = T(T(m, n), k).
T(n, 0) = 0.
T(n, 1) = A328841(n).
T(n, n) = A343047(n).

A343404 For any number n with representation (d_w, ..., d_1) in primorial base, a(n) is the least number m such that m mod prime(k) = d_k for k = 1..w (where prime(k) denotes the k-th prime number).

Original entry on oeis.org

0, 1, 4, 1, 2, 5, 6, 21, 16, 1, 26, 11, 12, 27, 22, 7, 2, 17, 18, 3, 28, 13, 8, 23, 24, 9, 4, 19, 14, 29, 120, 15, 190, 85, 50, 155, 36, 141, 106, 1, 176, 71, 162, 57, 22, 127, 92, 197, 78, 183, 148, 43, 8, 113, 204, 99, 64, 169, 134, 29, 30, 135, 100, 205
Offset: 0

Views

Author

Rémy Sigrist, Apr 14 2021

Keywords

Comments

Leading zeros in primorial base expansions are ignored.
The Chinese remainder theorem ensures that this sequence is well defined and provides a way to compute it.

Examples

			For n = 42 :
- the expansion of 42 in primary base is "1200",
- so a(42) mod 2 = 0 => a(42) = 2*t for some t >= 0,
     a(42) mod 3 = 0 => a(42) = 6*u for some u >= 0,
     a(42) mod 5 = 2 => a(42) = 12 + 30*v for some v >= 0,
     a(42) mod 7 = 1 => a(42) = 162 + 210*w for some w >= 0,
- we choose w=0 so as to minimize the value,
- hence a(42) = 162.
		

Crossrefs

Cf. A002110, A079276, A143293, A235168, A343405 (fixed points).

Programs

  • PARI
    a(n) = { my (v=Mod(0,1)); forprime (p=2, oo, if (n==0, return (lift(v)), v=chinese(v, Mod(n, p)); n\=p)) }

Formula

a(n) = 1 iff n belongs to A143293.
a(n) = n iff n belongs to A343405.
a(n) < A002110(k) for any n < A002110(k) and k >= 0.
a(A002110(k)) = A079276(k+1) * A002110(k) for any k >= 0.
Showing 1-10 of 17 results. Next