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

A324383 a(n) is the minimal number of primorials that add to A322827(n).

Original entry on oeis.org

1, 1, 1, 2, 2, 1, 2, 2, 2, 6, 1, 6, 4, 2, 4, 4, 8, 6, 6, 10, 8, 1, 10, 22, 4, 6, 2, 12, 8, 4, 4, 2, 8, 16, 6, 4, 24, 6, 8, 14, 26, 18, 1, 26, 20, 6, 18, 30, 6, 12, 2, 14, 16, 2, 10, 16, 8, 6, 4, 8, 6, 2, 4, 4, 12, 14, 14, 18, 18, 12, 16, 32, 42, 28, 6, 22, 32, 24, 24, 42, 46, 32, 18, 20, 30, 1, 24, 54, 38, 26, 14, 44, 34, 8
Offset: 0

Views

Author

Antti Karttunen, Feb 27 2019

Keywords

Comments

a(n) is odd if and only if n is one of the terms of A000975: 1, 2, 5, 10, 21, 42, 85, ..., in which case A322827(n) will be one of primorials (A002110), and a(n) = 1. This happens because A276150 is even for all multiples of four, and a product of two or more primorials > 1 is always a multiple of 4. Note that the same property does not hold in factorial system: 36 = 3!*3!, but A034968(36) = 3 as 36 = 4!+3!+3!.

Crossrefs

Cf. A000975 (positions of ones), A002110, A003188, A025487, A276150, A322827, A324342, A324382.
Cf. also A324386, A324387 (permutations of this sequence).

Programs

  • PARI
    A276150(n) = { my(s=0,m); forprime(p=2, , if(!n, return(s)); m = n%p; s += m; n = (n-m)/p); };
    A322827(n) = if(!n,1,my(bits = Vecrev(binary(n)), rl=1, o = List([])); for(i=2,#bits,if(bits[i]==bits[i-1], rl++, listput(o,rl))); listput(o,rl); my(es=Vecrev(Vec(o)), m=1); for(i=1,#es,m *= prime(i)^es[i]); (m));
    A324383(n) = A276150(A322827(n));

Formula

a(n) = A276150(A322827(n)).
a(n) = A324386(A003188(n)).

A323503 a(n) = A322827(2n) / A322827(n).

Original entry on oeis.org

1, 3, 6, 3, 6, 7, 6, 3, 6, 7, 210, 7, 6, 7, 6, 3, 6, 7, 210, 7, 210, 13, 210, 7, 6, 7, 210, 7, 6, 7, 6, 3, 6, 7, 210, 7, 210, 13, 210, 7, 210, 13, 30030, 13, 210, 13, 210, 7, 6, 7, 210, 7, 210, 13, 210, 7, 6, 7, 210, 7, 6, 7, 6, 3, 6, 7, 210, 7, 210, 13, 210, 7, 210, 13, 30030, 13, 210, 13, 210, 7, 210, 13, 30030, 13, 30030, 19, 30030, 13
Offset: 0

Views

Author

Antti Karttunen, Jan 17 2019

Keywords

Crossrefs

Bisection of A323507.

Programs

  • PARI
    A322827(n) = if(!n,1,my(bits = Vecrev(binary(n)), rl=1, o = List([])); for(i=2,#bits,if(bits[i]==bits[i-1], rl++, listput(o,rl))); listput(o,rl); my(es=Vecrev(Vec(o)), m=1); for(i=1,#es,m *= prime(i)^es[i]); (m));
    A323503(n) = A322827(2*n)/A322827(n);

Formula

a(n) = A322827(2*n) / A322827(n).

A323504 a(n) = A322827(2n+1) / A322827(n).

Original entry on oeis.org

2, 2, 5, 2, 5, 30, 5, 2, 5, 30, 11, 30, 5, 30, 5, 2, 5, 30, 11, 30, 11, 2310, 11, 30, 5, 30, 11, 30, 5, 30, 5, 2, 5, 30, 11, 30, 11, 2310, 11, 30, 11, 2310, 17, 2310, 11, 2310, 11, 30, 5, 30, 11, 30, 11, 2310, 11, 30, 5, 30, 11, 30, 5, 30, 5, 2, 5, 30, 11, 30, 11, 2310, 11, 30, 11, 2310, 17, 2310, 11, 2310, 11, 30, 11, 2310, 17, 2310, 17
Offset: 0

Views

Author

Antti Karttunen, Jan 17 2019

Keywords

Crossrefs

Bisection of A323507.

Programs

  • PARI
    A322827(n) = if(!n,1,my(bits = Vecrev(binary(n)), rl=1, o = List([])); for(i=2,#bits,if(bits[i]==bits[i-1], rl++, listput(o,rl))); listput(o,rl); my(es=Vecrev(Vec(o)), m=1); for(i=1,#es,m *= prime(i)^es[i]); (m));
    A323504(n) = A322827(n+n+1)/A322827(n);

Formula

a(n) = A322827(2n+1) / A322827(n).

A323507 a(n) = A322827(n) / A322827(floor(n/2)).

Original entry on oeis.org

1, 2, 3, 2, 6, 5, 3, 2, 6, 5, 7, 30, 6, 5, 3, 2, 6, 5, 7, 30, 210, 11, 7, 30, 6, 5, 7, 30, 6, 5, 3, 2, 6, 5, 7, 30, 210, 11, 7, 30, 210, 11, 13, 2310, 210, 11, 7, 30, 6, 5, 7, 30, 210, 11, 7, 30, 6, 5, 7, 30, 6, 5, 3, 2, 6, 5, 7, 30, 210, 11, 7, 30, 210, 11, 13, 2310, 210, 11, 7, 30, 210, 11, 13, 2310, 30030, 17, 13, 2310, 210, 11, 13, 2310
Offset: 0

Views

Author

Antti Karttunen, Jan 17 2019

Keywords

Crossrefs

Cf. A322827.
Cf. A323503, A323504 (bisections).

Programs

  • PARI
    A322827(n) = if(!n,1,my(bits = Vecrev(binary(n)), rl=1, o = List([])); for(i=2,#bits,if(bits[i]==bits[i-1], rl++, listput(o,rl))); listput(o,rl); my(es=Vecrev(Vec(o)), m=1); for(i=1,#es,m *= prime(i)^es[i]); (m));
    A323507(n) = A322827(n)/A322827(n>>1);

Formula

a(n) = A322827(n) / A322827(floor(n/2)).

A322825 A variant of A322827.

Original entry on oeis.org

1, 2, 6, 4, 36, 30, 18, 8, 216, 450, 210, 900, 108, 150, 54, 16, 1296, 6750, 7350, 13500, 44100, 2310, 22050, 27000, 648, 2250, 1470, 4500, 324, 750, 162, 32, 7776, 101250, 257250, 202500, 1543500, 177870, 771750, 405000, 9261000, 2668050, 30030, 5336100, 4630500, 889350, 2315250, 810000, 3888, 33750, 51450, 67500
Offset: 0

Views

Author

Antti Karttunen, Jan 16 2019

Keywords

Crossrefs

Cf. A005811, A227183, A322827 (the main entry).

Programs

  • PARI
    A322825(n) = if(!n,1, my(rl=1, m=1, p=2, eb = (n%2)); n>>=1; while(n,if((n%2)==eb, rl++, eb = 1-eb; m *= p^rl; p = nextprime(1+p)); n >>= 1); m *= p^rl; (m));
    
  • PARI
    A322825(n) = if(!n,1,my(bits = Vecrev(binary(n)), rl=1, o = List([])); for(i=2,#bits,if(bits[i]==bits[i-1], rl++, listput(o,rl))); listput(o,rl); my(es=Vec(o), m=1); for(i=1,#es,m *= prime(i)^es[i]); (m));

Formula

A001221(a(n)) = A005811(n).
A001222(a(n)) = A227183(n).
A046523(a(n)) = A322827(n).

A025487 Least integer of each prime signature A124832; also products of primorial numbers A002110.

Original entry on oeis.org

1, 2, 4, 6, 8, 12, 16, 24, 30, 32, 36, 48, 60, 64, 72, 96, 120, 128, 144, 180, 192, 210, 216, 240, 256, 288, 360, 384, 420, 432, 480, 512, 576, 720, 768, 840, 864, 900, 960, 1024, 1080, 1152, 1260, 1296, 1440, 1536, 1680, 1728, 1800, 1920, 2048, 2160, 2304, 2310
Offset: 1

Views

Author

Keywords

Comments

All numbers of the form 2^k1*3^k2*...*p_n^k_n, where k1 >= k2 >= ... >= k_n, sorted.
A111059 is a subsequence. - Reinhard Zumkeller, Jul 05 2010
Choie et al. (2007) call these "Hardy-Ramanujan integers". - Jean-François Alcover, Aug 14 2014
The exponents k1, k2, ... can be read off Abramowitz & Stegun p. 831, column labeled "pi".
For all such sequences b for which it holds that b(n) = b(A046523(n)), the sequence which gives the indices of records in b is a subsequence of this sequence. For example, A002182 which gives the indices of records for A000005, A002110 which gives them for A001221 and A000079 which gives them for A001222. - Antti Karttunen, Jan 18 2019
The prime signature corresponding to a(n) is given in row n of A124832. - M. F. Hasler, Jul 17 2019

Examples

			The first few terms are 1, 2, 2^2, 2*3, 2^3, 2^2*3, 2^4, 2^3*3, 2*3*5, ...
		

Crossrefs

Subsequence of A055932, A191743, and A324583.
Cf. A085089, A101296 (left inverses).
Equals range of values taken by A046523.
Cf. A178799 (first differences), A247451 (squarefree kernel), A146288 (number of divisors).
Rearrangements of this sequence include A036035, A059901, A063008, A077569, A085988, A086141, A087443, A108951, A181821, A181822, A322827, A329886, A329887.
Cf. also array A124832 (row n = prime signature of a(n)) and A304886, A307056.

Programs

  • Haskell
    import Data.Set (singleton, fromList, deleteFindMin, union)
    a025487 n = a025487_list !! (n-1)
    a025487_list = 1 : h [b] (singleton b) bs where
       (_ : b : bs) = a002110_list
       h cs s xs'@(x:xs)
         | m <= x    = m : h (m:cs) (s' `union` fromList (map (* m) cs)) xs'
         | otherwise = x : h (x:cs) (s  `union` fromList (map (* x) (x:cs))) xs
         where (m, s') = deleteFindMin s
    -- Reinhard Zumkeller, Apr 06 2013
    
  • Maple
    isA025487 := proc(n)
        local pset,omega ;
        pset := sort(convert(numtheory[factorset](n),list)) ;
        omega := nops(pset) ;
        if op(-1,pset) <> ithprime(omega) then
            return false;
        end if;
        for i from 1 to omega-1 do
            if padic[ordp](n,ithprime(i)) < padic[ordp](n,ithprime(i+1)) then
                return false;
            end if;
        end do:
        true ;
    end proc:
    A025487 := proc(n)
        option remember ;
        local a;
        if n = 1 then
            1 ;
        else
            for a from procname(n-1)+1 do
                if isA025487(a) then
                    return a;
                end if;
            end do:
        end if;
    end proc:
    seq(A025487(n),n=1..100) ; # R. J. Mathar, May 25 2017
  • Mathematica
    PrimeExponents[n_] := Last /@ FactorInteger[n]; lpe = {}; ln = {1}; Do[pe = Sort@PrimeExponents@n; If[ FreeQ[lpe, pe], AppendTo[lpe, pe]; AppendTo[ln, n]], {n, 2, 2350}]; ln (* Robert G. Wilson v, Aug 14 2004 *)
    (* Second program: generate all terms m <= A002110(n): *)
    f[n_] := {{1}}~Join~
      Block[{lim = Product[Prime@ i, {i, n}],
       ww = NestList[Append[#, 1] &, {1}, n - 1], dec},
       dec[x_] := Apply[Times, MapIndexed[Prime[First@ #2]^#1 &, x]];
       Map[Block[{w = #, k = 1},
          Sort@ Prepend[If[Length@ # == 0, #, #[[1]]],
            Product[Prime@ i, {i, Length@ w}] ] &@ Reap[
             Do[
              If[# < lim,
                 Sow[#]; k = 1,
                 If[k >= Length@ w, Break[], k++]] &@ dec@ Set[w,
                 If[k == 1,
                   MapAt[# + 1 &, w, k],
                   PadLeft[#, Length@ w, First@ #] &@
                     Drop[MapAt[# + Boole[i > 1] &, w, k], k - 1] ]],
               {i, Infinity}] ][[-1]]
    ] &, ww]]; Sort[Join @@ f@ 13] (* Michael De Vlieger, May 19 2018 *)
  • PARI
    isA025487(n)=my(k=valuation(n,2),t);n>>=k;forprime(p=3,default(primelimit),t=valuation(n,p);if(t>k,return(0),k=t);if(k,n/=p^k,return(n==1))) \\ Charles R Greathouse IV, Jun 10 2011
    
  • PARI
    factfollow(n)={local(fm, np, n2);
      fm=factor(n); np=matsize(fm)[1];
      if(np==0,return([2]));
      n2=n*nextprime(fm[np,1]+1);
      if(np==1||fm[np,2]Franklin T. Adams-Watters, Dec 01 2011 */
    
  • PARI
    is(n) = {if(n==1, return(1)); my(f = factor(n));  f[#f~, 1] == prime(#f~) && vecsort(f[, 2],,4) == f[, 2]} \\ David A. Corneth, Feb 14 2019
    
  • PARI
    upto(Nmax)=vecsort(concat(vector(logint(Nmax,2),n,select(t->t<=Nmax,if(n>1,[factorback(primes(#p),Vecrev(p)) || p<-partitions(n)],[1,2]))))) \\ M. F. Hasler, Jul 17 2019
    
  • PARI
    \\ For fast generation of large number of terms, use this program:
    A283980(n) = {my(f=factor(n)); prod(i=1, #f~, my(p=f[i, 1], e=f[i, 2]); if(p==2, 6, nextprime(p+1))^e)}; \\ From A283980
    A025487list(e) = { my(lista = List([1, 2]), i=2, u = 2^e, t); while(lista[i] != u, if(2*lista[i] <= u, listput(lista,2*lista[i]); t = A283980(lista[i]); if(t <= u, listput(lista,t))); i++); vecsort(Vec(lista)); }; \\ Returns a list of terms up to the term 2^e.
    v025487 = A025487list(101);
    A025487(n) = v025487[n];
    for(n=1,#v025487,print1(A025487(n), ", ")); \\ Antti Karttunen, Dec 24 2019
    
  • Sage
    def sharp_primorial(n): return sloane.A002110(prime_pi(n))
    N = 2310
    nmax = 2^floor(log(N,2))
    sorted([j for j in (prod(sharp_primorial(t[0])^t[1] for k, t in enumerate(factor(n))) for n in (1..nmax)) if j <= N])
    # Giuseppe Coppoletta, Jan 26 2015

Formula

What can be said about the asymptotic behavior of this sequence? - Franklin T. Adams-Watters, Jan 06 2010
Hardy & Ramanujan prove that there are exp((2 Pi + o(1))/sqrt(3) * sqrt(log x/log log x)) members of this sequence up to x. - Charles R Greathouse IV, Dec 05 2012
From Antti Karttunen, Jan 18 & Dec 24 2019: (Start)
A085089(a(n)) = n.
A101296(a(n)) = n [which is the first occurrence of n in A101296, and thus also a record.]
A001221(a(n)) = A061395(a(n)) = A061394(n).
A007814(a(n)) = A051903(a(n)) = A051282(n).
a(A101296(n)) = A046523(n).
a(A306802(n)) = A002182(n).
a(n) = A108951(A181815(n)) = A329900(A181817(n)).
If A181815(n) is odd, a(n) = A283980(a(A329904(n))), otherwise a(n) = 2*a(A329904(n)).
(End)
Sum_{n>=1} 1/a(n) = Product_{n>=1} 1/(1 - 1/A002110(n)) = A161360. - Amiram Eldar, Oct 20 2020

Extensions

Offset corrected by Matthew Vandermast, Oct 19 2008
Minor correction by Charles R Greathouse IV, Sep 03 2010

A283477 If 2n = 2^e1 + 2^e2 + ... + 2^ek [e1 .. ek distinct], then a(n) = A002110(e1) * A002110(e2) * ... * A002110(ek).

Original entry on oeis.org

1, 2, 6, 12, 30, 60, 180, 360, 210, 420, 1260, 2520, 6300, 12600, 37800, 75600, 2310, 4620, 13860, 27720, 69300, 138600, 415800, 831600, 485100, 970200, 2910600, 5821200, 14553000, 29106000, 87318000, 174636000, 30030, 60060, 180180, 360360, 900900, 1801800, 5405400, 10810800, 6306300, 12612600, 37837800, 75675600
Offset: 0

Views

Author

Antti Karttunen, Mar 16 2017

Keywords

Comments

a(n) = Product of distinct primorials larger than one, obtained as Product_{i} A002110(1+i), where i ranges over the zero-based positions of the 1-bits present in the binary representation of n.
This sequence can be represented as a binary tree. Each child to the left is obtained as A283980(k), and each child to the right is obtained as 2*A283980(k), when their parent contains k:
1
|
...................2....................
6 12
30......../ \........60 180......../ \......360
/ \ / \ / \ / \
/ \ / \ / \ / \
/ \ / \ / \ / \
210 420 1260 2520 6300 12600 37800 75600
etc.

Crossrefs

Programs

  • Mathematica
    Table[Times @@ Map[#1^#2 & @@ # &, FactorInteger[#] /. {p_, e_} /; e == 1 :> {Times @@ Prime@ Range@ PrimePi@ p, e}] &[Times @@ Prime@ Flatten@ Position[#, 1] &@ Reverse@ IntegerDigits[n, 2]], {n, 0, 43}] (* Michael De Vlieger, Mar 18 2017 *)
  • PARI
    A283477(n) = prod(i=0,exponent(n),if(bittest(n,i),vecprod(primes(1+i)),1)) \\ Edited by M. F. Hasler, Nov 11 2019
    
  • Python
    from sympy import prime, primerange, factorint
    from operator import mul
    from functools import reduce
    def P(n): return reduce(mul, [i for i in primerange(2, n + 1)])
    def a108951(n):
        f = factorint(n)
        return 1 if n==1 else reduce(mul, [P(i)**f[i] for i in f])
    def a019565(n): return reduce(mul, (prime(i+1) for i, v in enumerate(bin(n)[:1:-1]) if v == '1')) if n > 0 else 1 # after Chai Wah Wu
    def a(n): return a108951(a019565(n))
    print([a(n) for n in range(101)]) # Indranil Ghosh, Jun 22 2017
    
  • Python
    from sympy import primorial
    from math import prod
    def A283477(n): return prod(primorial(i) for i, b in enumerate(bin(n)[:1:-1],1) if b =='1') # Chai Wah Wu, Dec 08 2022
  • Scheme
    (define (A283477 n) (A108951 (A019565 n)))
    ;; Recursive "binary tree" implementation, using memoization-macro definec:
    (definec (A283477 n) (cond ((zero? n) 1) ((even? n) (A283980 (A283477 (/ n 2)))) (else (* 2 (A283980 (A283477 (/ (- n 1) 2)))))))
    

Formula

a(0) = 1; a(2n) = A283980(a(n)), a(2n+1) = 2*A283980(a(n)).
Other identities. For all n >= 0 (or for n >= 1):
a(2n+1) = 2*a(2n).
a(n) = A108951(A019565(n)).
A097248(a(n)) = A283475(n).
A007814(a(n)) = A051903(a(n)) = A000120(n).
A001221(a(n)) = A070939(n).
A001222(a(n)) = A029931(n).
A048675(a(n)) = A005187(n).
A248663(a(n)) = A006068(n).
A090880(a(n)) = A283483(n).
A276075(a(n)) = A283984(n).
A276085(a(n)) = A283985(n).
A046660(a(n)) = A124757(n).
A056169(a(n)) = A065120(n). [seems to be]
A005361(a(n)) = A284001(n).
A072411(a(n)) = A284002(n).
A007913(a(n)) = A284003(n).
A000005(a(n)) = A284005(n).
A324286(a(n)) = A324287(n).
A276086(a(n)) = A324289(n).
A267263(a(n)) = A324341(n).
A276150(a(n)) = A324342(n). [subsequences in the latter are converging towards this sequence]
G.f.: Product_{k>=0} (1 + prime(k + 1)# * x^(2^k)), where prime()# = A002110. - Ilya Gutkovskiy, Aug 19 2019

Extensions

More formulas and the binary tree illustration added by Antti Karttunen, Mar 19 2017
Four more linking formulas added by Antti Karttunen, Feb 25 2019

A329886 Primorial inflation of Doudna-tree: a(0) = 1, a(1) = 2; for n > 1, if n is even, a(n) = A283980(a(n/2)), and if n is odd, then a(n) = 2*a((n-1)/2).

Original entry on oeis.org

1, 2, 6, 4, 30, 12, 36, 8, 210, 60, 180, 24, 900, 72, 216, 16, 2310, 420, 1260, 120, 6300, 360, 1080, 48, 44100, 1800, 5400, 144, 27000, 432, 1296, 32, 30030, 4620, 13860, 840, 69300, 2520, 7560, 240, 485100, 12600, 37800, 720, 189000, 2160, 6480, 96, 5336100, 88200, 264600, 3600, 1323000, 10800, 32400, 288, 9261000
Offset: 0

Views

Author

Antti Karttunen, Dec 24 2019

Keywords

Examples

			This irregular table can be represented as a binary tree. Each child to the left is obtained by applying A283980 to the parent, and each child to the right is obtained by doubling the parent:
                                     1
                                     |
                  ...................2...................
                 6                                       4
      30......../ \........12                 36......../ \........8
      / \                 / \                 / \                 / \
     /   \               /   \               /   \               /   \
    /     \             /     \             /     \             /     \
  210      60         180     24          900      72         216      16
etc.
A329887 is the mirror image of the same tree. See also A342000.
		

Crossrefs

Programs

  • Mathematica
    Block[{a}, a[0] = 1; a[1] = 2; a[n_] := a[n] = If[EvenQ@ n, (Times @@ Map[Prime[PrimePi@#1 + 1]^#2 & @@ # &, FactorInteger[#]] - Boole[# == 1])*2^IntegerExponent[#, 2] &[a[n/2]], 2 a[(n - 1)/2]]; Array[a, 57, 0]]
    (* or, via Doudna *)
    Map[Times @@ Flatten@ MapIndexed[ConstantArray[Prime[First[#2]], #1] &, Table[LengthWhile[#1, # >= j &], {j, #2}] & @@ {#, Max[#]} &@ Sort[Flatten[ConstantArray[PrimePi@#1, #2] & @@@ FactorInteger[#]], Greater]] &, Nest[Append[#1, Prime[1 + BitLength[#2] - DigitCount[#2, 2, 1]]*#1[[#2 - 2^Floor@ Log2@ #2 + 1]]] & @@ {#, Length@ #} &, {1}, 57] ] (* Michael De Vlieger, Mar 05 2021 *)
  • PARI
    A283980(n) = {my(f=factor(n)); prod(i=1, #f~, my(p=f[i, 1], e=f[i, 2]); if(p==2, 6, nextprime(p+1))^e)}; \\ From A283980
    A329886(n) = if(n<2,1+n,if(!(n%2),A283980(A329886(n/2)),2*A329886(n\2)));

Formula

a(0) = 1, a(1) = 2; for n > 1, if n is even, a(n) = A283980(a(n/2)), and if n is odd, then a(n) = 2*a((n-1)/2).
a(n) = A108951(A005940(1+n)).
For n >= 1, a(n) = A329887(A054429(n)).

Extensions

Name amended by Antti Karttunen, Mar 05 2021

A106831 Define a triangle in which the entries are of the form +-1/(b!c!d!e!...), where the order of the factorials is important; read the triangle by rows and record and expand the denominators.

Original entry on oeis.org

2, 6, 4, 24, 12, 12, 8, 120, 48, 36, 24, 48, 24, 24, 16, 720, 240, 144, 96, 144, 72, 72, 48, 240, 96, 72, 48, 96, 48, 48, 32, 5040, 1440, 720, 480, 576, 288, 288, 192, 720, 288, 216, 144, 288, 144, 144, 96, 1440, 480, 288, 192, 288, 144, 144, 96, 480, 192, 144, 96, 192
Offset: 0

Views

Author

N. J. A. Sloane, May 22 2005

Keywords

Comments

Row n has 2^n terms. Row 0 is +1/2!. An entry +-1/b!c!d!... has two children, a left child -+1/(a+1)!b!c!... and a right child +-1/2!b!c!d!...
Let S_n = sum of entries in row n of the triangle. Then for n > 0, n!S_{n-1} is the Bernoulli number B_n.

Examples

			Woon's "Bernoulli Tree" begins like this (see also the given Wikipedia-link). This sequence gives the values of the denominators:
                                     +1
                                    ────
                                     2!
                 -1                 /  \                  +1
                ──── ............../    \.............. ─────
                 3!                                      2!2!
        +1        .         -1                 -1         .         +1
       ────      / \       ────               ────       / \      ──────
        4! ...../   \..... 2!3!               3!2! ...../   \.... 2!2!2!
       / \                 / \                 / \                 / \
      /   \               /   \               /   \               /   \
     /     \             /     \             /     \             /     \
    -1      +1         +1       -1         +1      -1          -1       +1
   ────    ────       ────     ──────     ────   ──────      ──────  ────────
    5!     2!4!       3!3!     2!2!3!     4!2!   2!3!2!      3!2!2!  2!2!2!2!
etc.
		

Crossrefs

Cf. A242179 (numerators), A050925, A050932, A000142.
Cf. A323505 (mirror image), and also A005940, A283477, A322827 for other similar trees.

Programs

  • Haskell
    a106831 n k = a106831_tabf !! n !! n
    a106831_row n = a106831_tabf !! n
    a106831_tabf = map (map (\(, , left, right) -> left * right)) $
       iterate (concatMap (\(x, f, left, right) -> let f' = f * x in
       [(x + 1, f', f', right), (3, 2, 2, left * right)])) [(3, 2, 2, 1)]
    -- Reinhard Zumkeller, May 05 2014
    
  • Maple
    Contribution from Peter Luschny, Jun 12 2009: (Start)
    The routine computes the triangle row by row and gives the numbers with their sign.
    Thus A(1)=[2]; A(2)=[ -6,4]; A(3)=[24,-12,-12,8]; etc.
    A := proc(n) local k, i, j, m, W, T; k := 2;
    W := array(0..2^n); W[1] := [1,`if`(n=0,1,2)];
    for i from 1 to n-1 do for m from k by 2 to 2*k-1 do
    T := W[iquo(m,2)]; W[m] := [ -T[1],T[2]+1,seq(T[j],j=3..nops(T))];
    W[m+1] := [T[1],2,seq(T[j],j=2..nops(T))]; od; k := 2*k; od;
    seq(W[i][1]*mul(W[i][j]!,j=2..nops(W[i])),i=iquo(k,2)..k-1) end:
    seq(print(A(i)),i=1..5); (End)
  • Mathematica
    a [n_] := Module[{k, i, j, m, w, t}, k = 2; w = Array[0&, 2^n]; w[[1]] := {1, If[n == 0, 1, 2]}; For[i = 1, i <= n-1, i++, For[m = k, m <= 2*k-1 , m = m+2, t = w[[Quotient[m, 2]]]; w[[m]] = {-t[[1]], t[[2]]+1, Sequence @@ Table[t[[j]], {j, 3, Length[t]}]}; w[[m+1]] = {t[[1]], 2, Sequence @@ Table[t[[j]], {j, 2, Length[t]}]}]; k = 2*k]; Table[w[[i, 1]]*Product[w[[i, j]]!, {j, 2, Length[w[[i]]]}], {i, Quotient[k, 2], k-1}]]; Table[a[i] , {i, 1, 6}] // Flatten // Abs (* Jean-François Alcover, Dec 20 2013, translated from Maple *)
  • PARI
    A106831off1(n) = if(!n,1, my(rl=1, m=1); while(n,if(!(n%2), rl++, m *= ((1+rl)!); rl=1); n >>= 1); (m));
    A106831(n) = A106831off1(1+n); \\ Antti Karttunen, Jan 16 2019
    
  • PARI
    A001511(n) = (1+valuation(n,2));
    A106831r1(n) = if(!n,1,if(n%2, 2*A106831r1((n-1)/2), (1+A001511(n))*A106831r1(n/2))); \\ Implements the given recurrence.
    A106831(n) = A106831r1(1+n); \\ Antti Karttunen, Jan 16 2019

Formula

From Antti Karttunen, Jan 16 2019: (Start)
If sequence is shifted one term to the right, then the following recurrence works:
a(0) = 1; and for n > 0, a(2n) = (1+A001511(2n))*a(n), a(2n+1) = 2*a(n).
(End)

Extensions

More terms from Franklin T. Adams-Watters, Apr 28 2006
Example section reillustrated by Antti Karttunen, Jan 16 2019

A323505 Mirror image of (denominators of) Bernoulli tree, A106831.

Original entry on oeis.org

1, 2, 4, 6, 8, 12, 12, 24, 16, 24, 24, 48, 24, 36, 48, 120, 32, 48, 48, 96, 48, 72, 96, 240, 48, 72, 72, 144, 96, 144, 240, 720, 64, 96, 96, 192, 96, 144, 192, 480, 96, 144, 144, 288, 192, 288, 480, 1440, 96, 144, 144, 288, 144, 216, 288, 720, 192, 288, 288, 576, 480, 720, 1440, 5040, 128, 192, 192, 384, 192, 288, 384, 960, 192, 288, 288
Offset: 0

Views

Author

Antti Karttunen, Jan 16 2019

Keywords

Comments

In contrast to A106831 which follows Woon's original indexing (and orientation), this variant starts with value a(0) = 1, with the rest of terms having an index incremented by one, thus allowing for a simple recurrence.
Sequence contains only terms of A001013 and each a(n) is a multiple of A246660(n).

Examples

			This sequence can be represented as a binary tree:
                                       1
                                       |
                    ...................2....................
                   4                                        6
         8......../ \........12                 12........./ \.......24
        / \                 / \                 / \                 / \
       /   \               /   \               /   \               /   \
      /     \             /     \             /     \             /     \
    16       24         24       48         24       36         48      120
  32  48   48  96     48  72   96  240    48  72   72  144    96  144 240  720
etc.
		

Crossrefs

Cf. A000079 (left edge), A000142 (right edge), A001013, A001511, A036987, A054429, A246660, A323506, A323508.
Cf. A106831 and also A005940, A283477, A322827 for other similar trees.

Programs

Formula

a(0) = 1; and for n > 0, if n is even, a(n) = 2*a(n/2), and if n is odd, a(n) = (A001511(n+1)+1-A036987(n)) * a((n-1)/2).
For n > 0, a(n) = b(A054429(n)), where b(n) = A106831(n-1).
a(n) = A246660(n) * A323506(n).
a(n) = A323508(A005940(1+n)).
Showing 1-10 of 12 results. Next