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 14 results. Next

A003422 Left factorials: !n = Sum_{k=0..n-1} k!.

Original entry on oeis.org

0, 1, 2, 4, 10, 34, 154, 874, 5914, 46234, 409114, 4037914, 43954714, 522956314, 6749977114, 93928268314, 1401602636314, 22324392524314, 378011820620314, 6780385526348314, 128425485935180314, 2561327494111820314, 53652269665821260314, 1177652997443428940314
Offset: 0

Views

Author

Keywords

Comments

Number of {12, 12*, 1*2, 21*}- and {12, 12*, 21, 21*}-avoiding signed permutations in the hyperoctahedral group.
a(n) is the number of permutations on [n] that avoid the patterns 2n1 and n12. An occurrence of a 2n1 pattern is a (scattered) subsequence a-n-b with a > b. - David Callan, Nov 29 2007
Also, numbers left over after the following sieving process: At step 1, keep all numbers of the set N = {0, 1, 2, ...}. In step 2, keep only every second number after a(2) = 2: N' = {0, 1, 2, 4, 6, 8, 10, ...}. In step 3, keep every third of the numbers following a(3) = 4, N" = {0, 1, 2, 4, 10, 16, 22, ...}. In step 4, keep every fourth of the numbers beyond a(4) = 10: {0, 1, 2, 4, 10, 34, 58, ...}, and so on. - M. F. Hasler, Oct 28 2010
If s(n) is a second-order recurrence defined as s(0) = x, s(1) = y, s(n) = n*(s(n - 1) - s(n - 2)), n > 1, then s(n) = n*y - n*a(n - 1)*x. - Gary Detlefs, May 27 2012
a(n) is the number of lists of {1, ..., n} with (1st element) = (smallest element) and (k-th element) <> (k-th smallest element) for k > 1, where a list means an ordered subset. a(4) = 10 because we have the lists: [1], [2], [3], [4], [1, 3, 2], [1, 4, 2], [1, 4, 3], [2, 4, 3], [1, 3, 4, 2], [1, 4, 2, 3]. Cf. A000262. - Geoffrey Critzer, Oct 04 2012
Consider a tree graph with 1 vertex. Add an edge to it with another vertex. Now add 2 edges with vertices to this vertex, and then 3 edges to each open vertex of the tree (not the first one!), and the next stage is to add 4 edges, and so on. The total number of vertices at each stage give this sequence (see example). - Jon Perry, Jan 27 2013
Additive version of the superfactorials A000178. - Jon Perry, Feb 09 2013
Repunits in the factorial number system (see links). - Jon Perry, Feb 17 2013
Whether n|a(n) only for 1 and 2 remains an open problem. A published 2004 proof was retracted in 2011. This is sometimes known as Kurepa's conjecture. - Robert G. Wilson v, Jun 15 2013, corrected by Jeppe Stig Nielsen, Nov 07 2015.
!n is not always squarefree for n > 3. Miodrag Zivkovic found that 54503^2 divides !26541. - Arkadiusz Wesolowski, Nov 20 2013
a(n) gives the position of A007489(n) in A227157. - Antti Karttunen, Nov 29 2013
Matches the total domination number of the Bruhat graph from n = 2 to at least n = 5. - Eric W. Weisstein, Jan 11 2019
For the connection with Kurepa trees, see A. Petojevic, The {K_i(z)}{i=1..oo} functions, Rocky Mtn. J. Math., 36 (2006), 1637-1650. - _Aleksandar Petojevic, Jun 29 2018
This sequence converges in the p-adic topology, for every prime number p. - Harry Richman, Aug 13 2024

Examples

			!5 = 0! + 1! + 2! + 3! + 4! = 1 + 1 + 2 + 6 + 24 = 34.
x + 2*x^2 + 4*x^3 + 10*x^4 + 34*x^5 + 154*x^6 + 874*x^7 + 5914*x^8 + 46234*x^9 + ...
From _Arkadiusz Wesolowski_, Aug 06 2012: (Start)
Illustration of initial terms:
.
. o        o         o            o                         o
.          o         o            o                         o
.                   o o          o o                       o o
.                              ooo ooo                   ooo ooo
.                                             oooo oooo oooo oooo oooo oooo
.
. 1        2         4            10                        34
.
(End)
The tree graph. The total number of vertices at each stage is 1, 2, 4, 10, ...
    0 0
    |/
    0-0
   /
0-0
   \
    0-0
    |\
    0 0
- _Jon Perry_, Jan 27 2013
		

References

  • Richard K. Guy, Unsolved Problems Number Theory, Section B44.
  • D. Kurepa, On the left factorial function !n. Math. Balkanica 1 1971 147-153.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Haskell
    a003422 n = a003422_list !! n
    a003422_list = scanl (+) 0 a000142_list
    -- Reinhard Zumkeller, Dec 27 2011
    
  • Maple
    A003422 := proc(n) local k; add(k!,k=0..n-1); end proc:
    # Alternative, using the Charlier polynomials A137338:
    C := proc(n, x) option remember; if n > 0 then (x-n)*C(n-1, x) - n*C(n-2, x)
    elif n = 0 then 1 else 0 fi end: A003422 := n -> (-1)^(n+1)*C(n-1, -1):
    seq(A003422(n), n=0..22); # Peter Luschny, Nov 28 2018
    # third Maple program:
    a:= proc(n) option remember; `if`(n=0, 0, a(n-1)+(n-1)!) end:
    seq(a(n), n=0..23);  # Alois P. Heinz, Feb 24 2022
  • Mathematica
    Table[Sum[i!, {i, 0, n - 1}], {n, 0, 20}] (* Stefan Steinerberger, Mar 31 2006 *)
    Join[{0}, Accumulate[Range[0, 25]!]] (* Harvey P. Dale, Nov 19 2011 *)
    a[0] = 0; a[1] = 1; a[n_] := a[n] = n*a[n - 1] - (n - 1)*a[n - 2]; Array[a, 23, 0] (* Robert G. Wilson v, Jun 15 2013 *)
    a[n_] := (-1)^n*n!*Subfactorial[-n-1]-Subfactorial[-1]; Table[a[n] // FullSimplify, {n, 0, 22}] (* Jean-François Alcover, Jan 09 2014 *)
    RecurrenceTable[{a[n] == n a[n - 1] - (n - 1) a[n - 2], a[0] == 0, a[1] == 1}, a, {n, 0, 10}] (* Eric W. Weisstein, Jan 11 2019 *)
    Range[0, 20]! CoefficientList[Series[(ExpIntegralEi[1] - ExpIntegralEi[1 - x]) Exp[x - 1], {x, 0, 20}], x] (* Eric W. Weisstein, Jan 11 2019 *)
    Table[(-1)^n n! Subfactorial[-n - 1] - Subfactorial[-1], {n, 0, 20}] // FullSimplify (* Eric W. Weisstein, Jan 11 2019 *)
    Table[(I Pi + ExpIntegralEi[1] + (-1)^n n! Gamma[-n, -1])/E, {n, 0, 20}] // FullSimplify (* Eric W. Weisstein, Jan 11 2019 *)
  • Maxima
    makelist(sum(k!,k,0,n-1), n, 0, 20); /* Stefano Spezia, Jan 11 2019 */
    
  • PARI
    a003422(n)=sum(k=0,n-1,k!) \\ Charles R Greathouse IV, Jun 15 2011
    
  • Python
    from itertools import count, islice
    def A003422_gen(): # generator of terms
        yield from (0,1)
        c, f = 1, 1
        for n in count(1):
            yield (c:= c + (f:= f*n))
    A003422_list = list(islice(A003422_gen(),20)) # Chai Wah Wu, Jun 22 2022
    
  • Python
    def a(n):
        if n == 0: return 0
        s = f = 1
        for k in range(1, n):
            f *= k
            s += f
        return round(s)
    print([a(n) for n in range(24)])  # Peter Luschny, Mar 05 2024

Formula

D-finite with recurrence: a(n) = n*a(n - 1) - (n - 1)*a(n - 2). - Henry Bottomley, Feb 28 2001
Sequence is given by 1 + 1*(1 + 2*(1 + 3*(1 + 4*(1 + ..., terminating in n*(1)...). - Jon Perry, Jun 01 2004
a(n) = Sum_{k=0..n-1} P(n, k) / C(n, k). - Ross La Haye, Sep 20 2004
E.g.f.: (Ei(1) - Ei(1 - x))*exp(-1 + x) where Ei(x) is the exponential integral. - Djurdje Cvijovic and Aleksandar Petojevic, Apr 11 2000
a(n) = Integral_{x = 0..oo} [(x^n - 1)/(x - 1)]*exp(-x) dx. - Gerald McGarvey, Oct 12 2007
A007489(n) = !(n + 1) - 1 = a(n + 1) - 1. - Artur Jasinski, Nov 08 2007. Typos corrected by Antti Karttunen, Nov 29 2013
Starting (1, 2, 4, 10, 34, 154, ...), = row sums of triangle A135722. - Gary W. Adamson, Nov 25 2007
a(n) = a(n - 1) + (n - 1)! for n >= 2. - Jaroslav Krizek, Jun 16 2009
E.g.f. A(x) satisfies the differential equation A'(x) = A(x) + 1/(1 - x). - Vladimir Kruchinin, Jan 19 2011
a(n + 1) = p(-1) where p(x) is the unique degree-n polynomial such that p(k) = A182386(k) for k = 0, 1, ..., n. - Michael Somos, Apr 27 2012
From Sergei N. Gladkovskii, May 09 2013 to Oct 22 2013: (Start)
Continued fractions:
G.f.: x/(1-x)*Q(0) where Q(k) = 1 + (2*k + 1)*x/( 1 - 2*x*(k+1)/(2*x*(k+1) + 1/Q(k+1))).
G.f.: G(0)*x/(1-x)/2 where G(k) = 1 + 1/(1 - x*(k+1)/(x*(k+1) + 1/G(k+1))).
G.f.: 2*x/(1-x)/G(0) where G(k) = 1 + 1/(1 - 1/(1 - 1/(2*x*(k+1)) + 1/G(k+1))).
G.f.: W(0)*x/(1+sqrt(x))/(1-x) where W(k) = 1 + sqrt(x)/(1 - sqrt(x)*(k+1)/(sqrt(x)*(k+1) + 1/W(k+1))).
G.f.: B(x)*(1+x)/(1-x) where B(x) is the g.f. of A153229.
G.f.: x/(1-x) + x^2/(1-x)/Q(0) where Q(k) = 1 - 2*x*(2*k+1) - x^2*(2*k+1)*(2*k+2)/(1 - 2*x*(2*k+2) - x^2*(2*k+2)*(2*k+3)/Q(k+1)).
G.f.: x*(1+x)*B(x) where B(x) is the g.f. of A136580. (End)
a(n) = (-1)^(n+1)*C(n-1, -1) where C(n, x) are the Charlier polynomials (with parameter a=1) as given in A137338. (Evaluation at x = 1 gives A232845.) - Peter Luschny, Nov 28 2018
a(n) = (a(n-3)*(n-2)^2*(n-3)! + a(n-1)^2)/a(n-2) (empirical). - Gary Detlefs, Feb 25 2022
a(n) = signum(n)/b(1,n) with b(i,n) = i - [iMohammed Bouras, Sep 07 2022
Sum_{n>=1} 1/a(n) = A357145. - Amiram Eldar, Oct 01 2022

A255411 Shift factorial base representation of n one digit left (with 0 added to right), increment all nonzero digits by one, then convert back to decimal; Numbers with no digit 1 in their factorial base representation.

Original entry on oeis.org

0, 4, 12, 16, 18, 22, 48, 52, 60, 64, 66, 70, 72, 76, 84, 88, 90, 94, 96, 100, 108, 112, 114, 118, 240, 244, 252, 256, 258, 262, 288, 292, 300, 304, 306, 310, 312, 316, 324, 328, 330, 334, 336, 340, 348, 352, 354, 358, 360, 364, 372, 376, 378, 382, 408, 412, 420, 424, 426, 430, 432, 436, 444
Offset: 0

Views

Author

Antti Karttunen, Apr 16 2015

Keywords

Comments

Nonnegative integers such that the number of ones (A257511) in their factorial base representation (A007623) is zero.
Nonnegative integers such that the least missing nonzero digit (A257079) in their factorial base representation is one.
a(n) can be also directly computed from n by "shifting left" its factorial base representation (that is, by appending one zero to the right, see A153880) and then incrementing all nonzero digits by one, and then converting the resulting (still valid) factorial base number back to decimal. See the examples.
The sequences A227130 and A227132 are closed under a(n), in other words, permutation listed as the a(n)-th entry in tables A060117 & A060118 has the same parity as the n-th entry in those same tables.

Examples

			Factorial base representation (A007623) of 1 is "1", shifting it left yields "10", and when we increment all nonzero digits by one, we get "20", which is the factorial base representation of 4 (as 4 = 2*2! + 0*1!), thus a(1) = 4.
F.b.r. of 2 is "10", shifting it left yields "100", and "200" is f.b.r. of 12, thus a(2) = 12.
F.b.r. of 43 is "1301", shifting it left and incrementing all nonzeros by one yields "24020", which is f.b.r of 340, thus a(43) = 340.
		

Crossrefs

Complement: A256450.
Positions of ones in A257079, fixed points of A257080, positions of zeros in A257511, A257081 and A257261.
Cf. also A227130/A227132, A060117/A060118 and also arrays A257503 & A257505.

Programs

  • Mathematica
    factBaseIntDs[n_] := Module[{m, i, len, dList, currDigit}, i = 1; While[n > i!, i++]; m = n; len = i; dList = Table[0, {len}]; Do[currDigit = 0; While[m >= j!, m = m - j!; currDigit++]; dList[[len - j + 1]] = currDigit, {j, i, 1, -1}]; If[dList[[1]] == 0, dList = Drop[dList, 1]]; dList]; s = Table[FromDigits[factBaseIntDs[n]], {n, 500}]; {0}~Join~Flatten@ Position[s, x_ /; DigitCount[x][[1]] == 0](* Michael De Vlieger, Apr 27 2015, after Alonso del Arte at A007623 *)
    Select[Range[0, 444], ! MemberQ[IntegerDigits[#, MixedRadix[Reverse@ Range@ 12]], 1] &] (* Michael De Vlieger, May 30 2016, Version 10.2 *)
    r = MixedRadix[Reverse@Range[2, 12]]; Table[FromDigits[Map[If[# == 0, 0, # + 1] &, IntegerDigits[n, r]]~Join~{0}, r], {n, 0, 60}] (* Michael De Vlieger, Aug 14 2016, Version 10.2 *)
  • Python
    from sympy import factorial as f
    def a007623(n, p=2): return n if n

    0 else '0' for i in x)[::-1] return 0 if n==0 else sum(int(y[i])*f(i + 1) for i in range(len(y))) print([a(n) for n in range(101)]) # Indranil Ghosh, Jun 20 2017

A339013 Class number m containing n in a partitioning of the natural numbers into classes B_m by William J. Keith.

Original entry on oeis.org

2, 3, 2, 4, 2, 4, 2, 3, 2, 5, 2, 5, 2, 3, 2, 5, 2, 5, 2, 3, 2, 5, 2, 5, 2, 3, 2, 4, 2, 4, 2, 3, 2, 6, 2, 6, 2, 3, 2, 6, 2, 6, 2, 3, 2, 6, 2, 6, 2, 3, 2, 4, 2, 4, 2, 3, 2, 6, 2, 6, 2, 3, 2, 6, 2, 6, 2, 3, 2, 6, 2, 6, 2, 3, 2, 4, 2, 4, 2, 3, 2, 6, 2, 6, 2, 3, 2
Offset: 1

Views

Author

Kevin Ryde, Nov 19 2020

Keywords

Comments

a(n)=m when n is in class B_m. Keith's residues formula in lemma 1 is equivalent to requiring that n-1 in factorial base representation ends in m-2 nonzero digits, so m = A339012(n-1) + 2.
a(n)=m iff n mod m! is among certain residue classes determined by m. The residues for A339012 are rows of A227157 and here add +1 to each residue (mod m!). For example 3 or 5 (mod 24) in A339012 becomes here 4 or 6 (mod 24).
The frequency of appearance of the term k = 2, 3, ... in this sequence is 1/(k*(k-1)). - Amiram Eldar, Feb 15 2021

Crossrefs

Cf. A005408 (class B_2), A016933 (class B_3).
Cf. A161189 (class number in partition A_k), A339012.

Programs

  • Mathematica
    a[n_] := Module[{k = n - 1, m = 2, r}, While[{k, r} = QuotientRemainder[k, m]; r != 0, m++]; m]; Array[a, 30] (* Amiram Eldar, Feb 15 2021 after Kevin Ryde's PARI code *)
  • PARI
    a(n) = n--; my(b=2,r); while([n,r]=divrem(n,b);r!=0, b++); b;

Formula

a(n) = A339012(n-1) + 2.
a(n) = m iff n == 1 + Sum_{j=1..m-2} d[j]*j! (mod m!) with d[j] in ranges 1 <= d[j] <= j. [Keith, section 2.1 lemma 1]
a(n)=2 iff n mod 2 = 1. [Keith section 4 residues].
a(n)=3 iff n mod 6 = 2.
a(n)=4 iff n mod 24 = 4 or 6.
a(n)=5 iff n mod 120 = any of 10, 12, 16, 18, 22, 24.

A227153 Product of nonzero digits of n in factorial base.

Original entry on oeis.org

1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 4, 4, 3, 3, 3, 3, 6, 6, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 4, 4, 3, 3, 3, 3, 6, 6, 2, 2, 2, 2, 4, 4, 2, 2, 2, 2, 4, 4, 4, 4, 4, 4, 8, 8, 6, 6, 6, 6, 12, 12, 3, 3, 3, 3, 6, 6, 3, 3, 3, 3, 6, 6, 6, 6, 6, 6
Offset: 0

Views

Author

Antti Karttunen, Jul 04 2013

Keywords

Comments

a(0) = 1 as an empty product always gives 1.

Crossrefs

A227157 gives the positions where equal with A208575.

Programs

  • Mathematica
    a[n_] := Module[{k = n, m = 2, r, p = 1}, While[{k, r} = QuotientRemainder[k, m]; k != 0|| r != 0, If[r > 0, p *= r]; m++]; p]; Array[a, 100, 0] (* Amiram Eldar, Feb 07 2024 *)
  • Python
    from functools import reduce
    from operator import mul
    def A(n, p=2):
        return n if n
  • Python
    def a(n, k=2): return max(n % k, 1) * a(n // k, k + 1) if n else 1 # David Radcliffe, May 22 2025

Formula

For all n, a(A227157(n)) = A208575(A227157(n)).

A325616 Triangle read by rows where T(n,k) is the number of length-k integer partitions of n into factorial numbers.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, May 12 2019

Keywords

Examples

			Triangle begins:
  1
  0 1
  0 1 1
  0 0 1 1
  0 0 1 1 1
  0 0 0 1 1 1
  0 1 0 1 1 1 1
  0 0 1 0 1 1 1 1
  0 0 1 1 1 1 1 1 1
  0 0 0 1 1 1 1 1 1 1
  0 0 0 1 1 2 1 1 1 1 1
  0 0 0 0 1 1 2 1 1 1 1 1
  0 0 1 0 1 1 2 2 1 1 1 1 1
  0 0 0 1 0 1 1 2 2 1 1 1 1 1
  0 0 0 1 1 1 1 2 2 2 1 1 1 1 1
  0 0 0 0 1 1 1 1 2 2 2 1 1 1 1 1
  0 0 0 0 1 1 2 1 2 2 2 2 1 1 1 1 1
  0 0 0 0 0 1 1 2 1 2 2 2 2 1 1 1 1 1
  0 0 0 1 0 1 1 2 2 2 2 2 2 2 1 1 1 1 1
  0 0 0 0 1 0 1 1 2 2 2 2 2 2 2 1 1 1 1 1
  0 0 0 0 1 1 1 1 2 2 3 2 2 2 2 2 1 1 1 1 1
Row n = 12 counts the following partitions:
  (66)
  (6222)
  (62211)
  (222222) (621111)
  (2222211) (6111111)
  (22221111)
  (222111111)
  (2211111111)
  (21111111111)
  (111111111111)
		

Crossrefs

Row sums are A064986.
Cf. A008284.
Reciprocal factorial sum: A325618, A325619, A325620, A325622.

Programs

  • Mathematica
    Table[SeriesCoefficient[Product[1/(1-y*x^(i!)),{i,1,n}],{x,0,n},{y,0,k}],{n,0,15},{k,0,n}]

Formula

T(n,k) is the coefficient of x^n * y^k in the expansion of Product_{i > 0} 1/(1 - y * x^(i!)).

A231716 Numbers with restricted residue set factorial base representation: numbers n which can be formed as a sum n = du*u! + ... + d2*2! + d1*1!, where each di is in range 1..i and gcd(di,i+1)=1.

Original entry on oeis.org

1, 3, 5, 9, 11, 21, 23, 33, 35, 45, 47, 57, 59, 69, 71, 81, 83, 93, 95, 105, 107, 117, 119, 153, 155, 165, 167, 177, 179, 189, 191, 201, 203, 213, 215, 225, 227, 237, 239, 633, 635, 645, 647, 657, 659, 669, 671, 681, 683, 693, 695, 705, 707, 717, 719, 873, 875
Offset: 1

Views

Author

Antti Karttunen, Nov 12 2013

Keywords

Comments

A001088(n+1) gives the number of terms x in sequence for which A084558(x)=n.
Because totatives (the reduced residue set) of each natural number k form a multiplicative group of integers modulo same k, it means that taking e.g. inverses of each digit modulo same k or multiplying them (again modulo k) by some member of that set keeps the set closed, and thus applying these operations to each digit modulo i+1 (2 for the least significant digit in factorial base, 3 for the next, and so on) yield only digits allowed in this sequence, and thus they induce various permutations of this sequence. These can be further "normalized" to be permutations of natural numbers with a suitable ranking function, which is to be submitted later.

Examples

			This can be viewed as an irregular table, where row n has A001088(n+1) elements, starts from position A231721(n) and ends at position A231722(n+1):
1;
3, 5;
9, 11, 21, 23;
33, 35, 45, 47, 57, 59, 69, 71, 81, 83, 93, 95, 105, 107, 117, 119;
...
		

Crossrefs

Positions of ones in A231715.
The first term of each row: A007489(n) = a(A231721(n)).
The last term of each row: A033312(n+1) = a(A231722(n+1)).
Subset of A227157.

A257510 Number of nonleading zeros in factorial base representation of n (A007623).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Apr 27 2015

Keywords

Comments

Sequence starts from n=1, because 0 is an ambiguous case.

Crossrefs

Cf. A227157 (numbers n such that a(n) = 0), A227187 (n for which a(n) > 0).
Cf. also A257511.
Cf. also A023416, A080791 (analogous sequences for base-2), A055641 (for base-10).

Programs

  • Mathematica
    factBaseIntDs[n_] := Module[{m, i, len, dList, currDigit}, i = 1; While[n > i!, i++]; m = n; len = i; dList = Table[0, {len}]; Do[currDigit = 0; While[m >= j!, m = m - j!; currDigit++]; dList[[len - j + 1]] = currDigit, {j, i, 1, -1}]; If[dList[[1]] == 0, dList = Drop[dList, 1]]; dList]; s = Table[FromDigits[factBaseIntDs[n]], {n, 120}]; Last@ DigitCount[#] & /@ s (* Michael De Vlieger, Apr 27 2015, after Alonso del Arte at A007623 *)
  • Scheme
    (define (A257510 n) (let loop ((n n) (i 2) (s 0)) (cond ((zero? n) s) (else (loop (floor->exact (/ n i)) (+ 1 i) (+ s (if (zero? (modulo n i)) 1 0)))))))

Formula

a(n) = A084558(n) - A060130(n).
Other identities and observations:
For all n >= 0, a(A000142(n+1)) = n. [(n+1)! gives the position where n first appears.]
For all n, a(n) >= A230403(n).

A328574 a(1) = 0, and, for n >= 2, numbers n whose primorial base expansion doesn't contain any nonleading zeros.

Original entry on oeis.org

0, 1, 3, 5, 9, 11, 15, 17, 21, 23, 27, 29, 39, 41, 45, 47, 51, 53, 57, 59, 69, 71, 75, 77, 81, 83, 87, 89, 99, 101, 105, 107, 111, 113, 117, 119, 129, 131, 135, 137, 141, 143, 147, 149, 159, 161, 165, 167, 171, 173, 177, 179, 189, 191, 195, 197, 201, 203, 207, 209, 249, 251, 255, 257, 261, 263, 267, 269, 279, 281, 285
Offset: 1

Views

Author

Antti Karttunen, Oct 20 2019

Keywords

Comments

After the initial zero, numbers n for which A276086(n) produces an even number with no gaps in its prime factorization.
Numbers n such that A276086(n) is in A055932; numbers for which A328475(n) is equal to A328572(n) = A003557(A276086(n)).
The number of positive terms below prime(m)# = A002110(m) is Sum_{k=1..m} A005867(k). - Amiram Eldar, Feb 16 2021

Crossrefs

Positions of 1's in A328573, positions of 0's in A329027, cf. also A328840.
Cf. A227157 for analogous sequence.

Programs

  • Mathematica
    max = 4; bases = Prime @ Range[max, 1, -1]; nmax = Times @@ bases - 1; Join[{0}, Select[Range[nmax], FreeQ[IntegerDigits[#, MixedRadix[bases]], 0] &]] (* Amiram Eldar, Feb 16 2021 *)
  • PARI
    A276086(n) = { my(m=1, p=2); while(n, m *= (p^(n%p)); n = n\p; p = nextprime(1+p)); (m); };
    isA055932(n) = { my(f=factor(n)[, 1]~); f==primes(#f); }; \\ From A055932
    isA328574(n) = isA055932(A276086(n));
    
  • PARI
    A328475(n) = { my(m=1, p=2, y=1); while(n, if(n%p, m *= p^((n%p)-y), y=0); n = n\p; p = nextprime(1+p)); (m); };
    A328572(n) = { my(m=1, p=2); while(n, if(n%p, m *= p^((n%p)-1)); n = n\p; p = nextprime(1+p)); (m); };
    isA328574(n) = (A328475(n) == A328572(n));

Extensions

Primary definition changed, the old definition moved to comment section by Antti Karttunen, Nov 03 2019

A227187 Numbers n whose factorial base representation A007623(n) contains at least one nonleading zero. (Zero is also included as a(0)).

Original entry on oeis.org

0, 2, 4, 6, 7, 8, 10, 12, 13, 14, 16, 18, 19, 20, 22, 24, 25, 26, 27, 28, 29, 30, 31, 32, 34, 36, 37, 38, 40, 42, 43, 44, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 58, 60, 61, 62, 64, 66, 67, 68, 70, 72, 73, 74, 75, 76, 77, 78, 79, 80, 82, 84, 85, 86, 88, 90, 91
Offset: 0

Views

Author

Antti Karttunen, Jul 04 2013

Keywords

Crossrefs

Complement: A227157.
The sequence gives all positions n where A208575 is zero and all terms where A257510 (also A257260) are nonzeros.
Cf. A232745 (a subsequence), A232744.
Cf. also A007623, A132371, A153880, A227130, A227132, A256450 (numbers with at least one 1 in their factorial representation).

Programs

  • Mathematica
    q[n_] := Module[{k = n, m = 2, r, s = {}}, While[{k, r} = QuotientRemainder[k, m]; k != 0|| r != 0, AppendTo[s, r]; m++]; MemberQ[s, 0]]; q[0] = True; Select[Range[0, 100], q] (* Amiram Eldar, Feb 07 2024 *)

Formula

a(0) = 0, a(1) = 2, and for n > 1, if a(n-1) is odd or A257510(a(n-1)) > 1, then a(n) = a(n-1) + 1, otherwise a(n) = a(n-1) + 2. - Antti Karttunen, Apr 29 2015
Other identities:
For all n >= 2, a(A132371(n)) = A000142(n) = n! [See comments in A227157.]

A231720 a(0)=1, after which, for any n uniquely written as du*u! + ... + d2*2! + d1*1! (each di in range 0..i), a(n) = (du+1)*(u+1)! + ... + (d2+1)*3! + (d1+1)*2! + 1; the natural numbers with their factorial base representation (A007623) shifted left one step and each digit incremented by one, converted back to decimal.

Original entry on oeis.org

1, 5, 15, 17, 21, 23, 57, 59, 63, 65, 69, 71, 81, 83, 87, 89, 93, 95, 105, 107, 111, 113, 117, 119, 273, 275, 279, 281, 285, 287, 297, 299, 303, 305, 309, 311, 321, 323, 327, 329, 333, 335, 345, 347, 351, 353, 357, 359, 393, 395, 399, 401, 405, 407, 417, 419
Offset: 0

Views

Author

Antti Karttunen, Nov 29 2013

Keywords

Examples

			1 has a factorial base representation A007623(1) = '1'. This shifted once left is '10', and when each digit is incremented by one, this will be '21', and 2*2! + 1*1! = 5 (also A007623(5) = '21'), thus a(1)=5.
2 has a factorial base representation '10'. This shifted once left is '100', and with each digit incremented, makes '211'. 2*3! + 1*2! + 1*1! = 15, thus a(2)=15.
		

Crossrefs

Subset of A227157. Cf. A007623, A153880, A220655.

Programs

  • Scheme
    ;; Standalone iterative implementation:
    (define (A231720 n) (let loop ((n n) (z 1) (i 2) (f 2)) (cond ((zero? n) z) (else (loop (quotient n i) (+ (* f (+ 1 (remainder n i))) z) (+ 1 i) (* f (+ i 1)))))))

Formula

a(0)=1, and for n>=1, a(n) = A220655(A153880(n)).
Showing 1-10 of 14 results. Next