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-3 of 3 results.

A179680 The number of exponents >1 in a recursive reduction of 2n-1 until reaching an odd part equal to 1.

Original entry on oeis.org

0, 1, 1, 1, 1, 3, 3, 1, 1, 5, 1, 3, 5, 5, 7, 1, 1, 3, 9, 3, 3, 3, 3, 6, 5, 2, 13, 5, 3, 15, 15, 1, 1, 17, 5, 9, 1, 5, 7, 10, 13, 21, 1, 7, 2, 3, 2, 9, 11, 9, 25, 13, 2, 27, 9, 9, 5, 11, 2, 6, 27, 5, 25, 1, 1, 33, 3, 9, 15, 35, 11, 15, 3, 11, 37, 3, 6, 5, 13, 13
Offset: 1

Views

Author

Vladimir Shevelev, Jul 24 2010

Keywords

Comments

Let N = 2n-1. Then consider the following algorithm of updating pairs (v,m) indicating highest exponent of 2 (2-adic valuation) and odd part: Initialize at step 1 by v(1) = A007814(N+1) and m(1) = A000265(N+1). Iterate over steps i>=2: v(i) = A007814(N+m(i-1)), m(i) = A000265(N+m(i-1)) using the previous odd part m(i-1) until some m(k) = 1. a(n) is defined as the count of the v(i) which are larger than 1.
This is an algorithm to compute A002326 because the sum v(1)+v(2)+ ... +v(k) of the exponents is A002326(n-1).
A179382(n) = 1 + the number of iterations taken by the algorithm when starting from N = 2n-1. - Antti Karttunen, Oct 02 2017

Examples

			For n = 9, 2*n-1 = 17, we have v_1 = v_2 = v_3 = 1, v_4 = 5. Thus a(9) = 1.
For n = 10, 2*n-1 = 19, we have v_1 = 2, v_2 = 3, v_3 = v_4 = v_5 = 1, v_6 = v_7 = 2, v_8 = 1, v_9 = 5. Thus a(10) = 5.
		

Crossrefs

Programs

  • Maple
    A179680 := proc(n) local l,m,a ,N ; N := 2*n-1 ; a := 0 ; l := A007814(N+1) ; m := A000265(N+1) ; if l > 1 then a := a+1 ; end if; while m <> 1 do l := A007814(N+m) ; if l > 1 then a := a+1 ; end if; m := A000265(N+m) ; end do: a ; end proc:
    seq(A179680(n),n=1..80) ; # R. J. Mathar, Apr 05 2011
  • Mathematica
    a7814[n_] := IntegerExponent[n, 2];
    a265[n_] := n/2^IntegerExponent[n, 2];
    a[n_] := Module[{l, m, k, nn}, nn = 2n-1; k = 0; l = a7814[nn+1]; m = a265[nn+1]; If[l>1, k++]; While[m != 1, l = a7814[nn+m]; If[l>1, k++]; m = a265[nn+m]]; k];
    Array[a, 80] (* Jean-François Alcover, Jul 30 2018, after R. J. Mathar *)
  • Sage
    def A179680(n):
        s, m, N = 0, 1, 2*n - 1
        while True:
            k = N + m
            v = valuation(k, 2)
            if v > 1: s += 1
            m = k >> v
            if m == 1: break
        return s
    print([A179680(n) for n in (1..80)]) # Peter Luschny, Oct 07 2017
  • Scheme
    (define (A179680 n) (let ((x (+ n n -1))) (let loop ((s (- 1 (A000035 n))) (k 1)) (let ((m (A000265 (+ x k)))) (if (= 1 m) s (loop (+ s (if (> (A007814 (+ x m)) 1) 1 0)) m)))))) ;; Antti Karttunen, Oct 02 2017
    

A292265 A multiplicative encoding (compressed) for the exponents of 2 obtained when using Shevelev's algorithm for computing A002326.

Original entry on oeis.org

2, 3, 12, 6, 20, 180, 720, 5, 80, 25920, 20, 360, 43200, 25920, 6220800, 10, 240, 540, 671846400, 540, 57600, 2160, 540, 194400, 155520, 45, 5804752896000, 77760, 14400, 87071293440000, 348285173760000, 15, 960, 12538266255360000, 311040, 139968000, 120, 77760, 18662400, 1679616000, 23219011584000, 108330620446310400000, 60, 4665600, 360, 540, 180
Offset: 0

Views

Author

Antti Karttunen, Oct 02 2017

Keywords

Comments

a(n) = A019565(v(1)) * A019565(v(2)) * ... * A019565(v(k)), where v(1) .. v(k) are 2-adic valuations (not all necessarily distinct) of the iterated values obtained when running Shevelev's algorithm for computing A002623. (See A179680 and A292239.)

Crossrefs

Cf. A000265, A002326, A007814, A019565, A179680, A292239 (a variant), A292266 (rgs-version of this filter).

Programs

  • PARI
    A000265(n) = (n >> valuation(n, 2));
    A019565(n) = {my(j,v); factorback(Mat(vector(if(n, #n=vecextract(binary(n), "-1..1")), j, [prime(j), n[j]])~))}; \\ This function from M. F. Hasler
    A292265(n) = { my(x = n+n+1, z = A019565(valuation(1+x,2)), m = A000265(1+x)); while(m!=1, z *= A019565(valuation(x+m,2)); m = A000265(x+m)); z; };
    
  • Scheme
    (define (A292265 n) (let ((x (+ n n 1))) (let loop ((z (A019565 (A007814 (+ 1 x)))) (k 1)) (let ((m (A000265 (+ x k)))) (if (= 1 m) z (loop (* z (A019565 (A007814 (+ x m)))) m))))))

Formula

For all n >= 0, A048675(a(n)) = A002326(n).

A293446 Restricted growth sequence transform of A293445, related to Shevelev's algorithm for computing A053446.

Original entry on oeis.org

1, 1, 2, 3, 4, 2, 3, 5, 6, 7, 3, 8, 9, 3, 10, 11, 12, 6, 13, 14, 15, 16, 17, 18, 19, 20, 21, 16, 22, 23, 24, 25, 26, 27, 13, 28, 27, 13, 29, 30, 23, 15, 17, 18, 31, 17, 32, 33, 34, 35, 20, 15, 36, 21, 16, 37, 17, 26, 23, 38, 13, 39, 40, 41, 42, 22, 27, 43, 44, 13, 28, 45, 46, 47, 18, 48, 49, 29, 50, 51, 52, 53, 54, 55, 56, 57, 34, 58, 35, 39, 59, 60, 61, 34
Offset: 1

Views

Author

Antti Karttunen, Oct 09 2017

Keywords

Crossrefs

Cf. also A292266.

Formula

For all i, j: a(i) = a(j) => A053446(i) = A053446(j).
Showing 1-3 of 3 results.