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.

Previous Showing 11-18 of 18 results.

A292270 Sum of all partial fractions in the algorithm used for calculation of A002326(n).

Original entry on oeis.org

1, 1, 4, 1, 13, 25, 36, 1, 38, 81, 12, 26, 124, 121, 196, 1, 103, 73, 324, 42, 224, 175, 91, 147, 232, 14, 676, 170, 303, 841, 900, 1, 264, 1089, 385, 364, 93, 301, 585, 563, 1093, 1681, 44, 355, 152, 118, 83, 484, 1254, 763, 2500, 1043, 156, 2809, 996, 564, 952, 931, 71, 387, 3325, 176, 3124, 1, 649, 4225, 554, 1081
Offset: 0

Views

Author

Keywords

Comments

This sequence gives important additional insight into the algorithm for the calculation of A002326 (see A179680 for its description). Let us estimate how many steps are required before (the first) 1 will appear. Note that all partial fractions (which are indeed, integers) are odd residues modulo 2*n+1 from the interval [1,2*n-1]. So, if there is no repetition, then the number of steps does not exceed n. Suppose then that there is a repetition before the appearance of 1. Then for an odd residue k from [1, 2*n-1], 2^m_1 == 2^m_2 == k (mod 2*n+1) such that m_2 > m_1. But then 2^(m_2-m_1) == 1 (mod 2*n+1). So, since m_2 - m_1 < m_2, it means that 1 should appear earlier than the repetition of k, which is a contradiction. So the number of steps <= n. For example, for n=9, 2*n+1 = 19, we have exactly 9 steps with all other odd residues <= 17 modulo 19 appearing before the final 1: 5, 3, 11, 15, 17, 9, 7, 13, 1.
A001122 gives the odd numbers k such that a((k-1)/2) = A000290((k-1)/2).

Examples

			Let n = 9. According to the comment, a(9) = 5 + 3 + 11 + 15 + 17 + 9 + 7 + 13 + 1 = 81.
		

Crossrefs

Cf. A000225 (gives the positions of ones), A292938 (of squares), A292939 (and the corresponding odd numbers), A292940 (odd numbers corresponding to squares larger than one), A292379 (odd numbers corresponding to squares less than n^2).

Programs

  • PARI
    A000265(n) = (n >> valuation(n, 2));
    A006519(n) = 2^valuation(n, 2);
    A292270(n) = { my(x = n+n+1, z = ((1+x)/A006519(1+x)), m = A000265(1+x)); while(m!=1, z += ((x+m)/A006519(x+m)); m = A000265(x+m)); z; };
    
  • Scheme
    (define (A292270 n) (let ((x (+ n n 1))) (let loop ((z (/ (+ 1 x) (A006519 (+ 1 x)))) (k 1)) (let ((m (A000265 (+ x k)))) (if (= 1 m) z (loop (+ z (/ (+ x m) (A006519 (+ x m)))) m))))))

Formula

For all n >= 1, A000196(a((A001122(1+n)-1)/2)) = (A001122(1+n)-1)/2, in other words, a(A163782(n)) = A000290(A163782(n)).

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
    

A292239 A multiplicative encoding for the exponents of 2 obtained when using Shevelev's algorithm for computing A002326.

Original entry on oeis.org

2, 3, 10, 5, 28, 252, 840, 7, 88, 23760, 22, 330, 66528, 23760, 6652800, 11, 208, 468, 471744000, 390, 58240, 1872, 468, 163800, 93600, 39, 3736212480000, 39000, 17472, 94152554496000, 313841848320000, 13, 544, 7387354275840000, 146880, 84823200, 68, 36720, 12337920, 1079568000
Offset: 0

Views

Author

Antti Karttunen, Oct 02 2017

Keywords

Comments

a(n) = prime(v(1)) * prime(v(2)) * ... * prime(v(k)), where prime(n) is the n-th prime (= A000040(n)) and v(1) .. v(k) are 2-adic valuations (not all necessarily distinct) of the iterated values obtained when running Shevelev's algorithm for computing A002326. See comments in A179680 and compare to A292265.

Crossrefs

Programs

  • Mathematica
    a265[n_] := n/2^IntegerExponent[n, 2];
    a[n_] := Module[{x, z, m}, x = 2 n + 1; z = Prime[IntegerExponent[1 + x, 2]]; m = a265[1 + x]; While[m != 1, z *= Prime[IntegerExponent[x + m, 2]]; m = a265[x + m]]; z];
    Table[a[n], {n, 0, 39}] (* Jean-François Alcover, Oct 03 2017, translated from PARI *)
  • PARI
    A000265(n) = (n >> valuation(n, 2));
    A292239(n) = { my(x = n+n+1, z = prime(valuation(1+x,2)), m = A000265(1+x)); while(m!=1, z *= prime(valuation(x+m,2)); m = A000265(x+m)); z; };
    
  • Scheme
    (define (A292239 n) (let ((x (+ n n 1))) (let loop ((z (A000040 (A007814 (+ 1 x)))) (k 1)) (let ((m (A000265 (+ x k)))) (if (= 1 m) z (loop (* z (A000040 (A007814 (+ x m)))) m))))))

Formula

For all n >= 0:
A001222(a(n)) = A179382(1+n).
A056239(a(n)) = A002326(n).

A179481 a(n) = 2*t(n)-1 where t(n) is the sequence of records positions of A179480.

Original entry on oeis.org

3, 7, 11, 19, 23, 29, 37, 47, 53, 59, 67, 71, 79, 83, 101, 103, 107, 131, 139, 149, 163, 167, 173, 179, 191, 197, 199, 211, 227, 239, 263, 269, 271, 293, 311, 317, 347, 359, 367, 373, 379, 383, 389, 419, 443, 461, 463, 467, 479, 487, 491, 503, 509, 523, 541
Offset: 2

Views

Author

Vladimir Shevelev, Jul 16 2010

Keywords

Comments

Question. Is every term of this sequence prime?
From Gary W. Adamson, Sep 04 2012: (Start)
In answer to the primality question and pursuant to the Coach Theorem of Hilton and Pedersen: phi(b) = 2 * k * c, with b an odd integer and k in A003558, and c (the numbers of coaches) in A135303; iff phi(b) = (b-1) then b = p, prime. This implies that if b has one coach and k = (b-1)/2, b must be prime since phi(b) = 2 * k * c = 2 * (b-1)/2 * 1 = (b-1). Conjectures: all terms in A179481 have one coach with k = (b-1)/2 and are therefore primes. Next, if A179480(n) is a new record high value, then so is A003558(n-1); but not necessarily the converse (e.g. 13), and the corresponding value of k for b is (b-1)/2. Examples: b = 13 has one coach with k (sum of bottom row terms ) = 6 = A003558(6); and r (number of entries in each row) = 3:
13: [1, 3, 5]
......2, 1, 3. This example satisfies the primality requirements since phi(13) = 12 = 2 * k * c = 2 * 6 * 1; but not the new record requirement for r = 3 since A179480(6) = 3, corresponding to 11, not 13. As shown in the coach for 11:
11: [1, 3, 3]
......1, 1, 3; k = (b-1)/2 with r = 3 and c = 1. Therefore, 11 is in A179481 but not 13. (End)

References

  • P. Hilton and J. Pedersen, A Mathematics Tapestry, Demonstrating the Beautiful Unity of Mathematics, 2010, Cambridge University Press, pp. 260-264.

Crossrefs

Extensions

Edited by N. J. A. Sloane, Jul 18 2010
More terms from R. J. Mathar, Jul 18 2010

A179738 a(n) = length of (eventual) period of the sequence defined by s(0) = 1, s(n+1) = odd_part(2n-1 + (s(n) if n odd else s(n)*3)), where odd_part = A000265.

Original entry on oeis.org

1, 2, 4, 1, 4, 8, 2, 4, 8, 4, 2, 2, 1, 4, 12, 4, 4, 26, 2, 12, 6, 2, 4, 4, 4, 16, 4, 8, 10, 6, 4, 8, 4, 2, 6, 8, 12, 12, 28, 1, 22, 16, 2, 16, 12, 12, 16, 6, 4, 40, 24, 4, 32, 6, 26, 16, 6, 8, 4, 8, 12, 2, 36, 6, 46, 12, 2, 36, 60, 6, 16, 8, 4, 18, 20, 4, 60, 36
Offset: 2

Views

Author

Vladimir Shevelev, Jul 25 2010

Keywords

Comments

Original definition (edited): Let x, y be odd numbers and the operation x <+> y := A000265(x+y). Consider sequence s(0) = x <+> y, s(2*k+1) = x <+> 3*s(2*k), s(2*k+2) = x <+> s(2*k+1); a(n) is the smallest period in case x = 2*n-1, y = 1.
The operation x <+> y = A000265(x+y) = odd part of x+y is also considered in A179382.
Record values are: a(2) = 1, a(3) = 2, a(4) = 4, a(7) = 8, a(16) = 12, a(19) = 26, a(40) = 28, a(51) = 40, a(66) = 46, a(70) = 60, a(111) = 64, a(126) = 70, a(147) = 80, a(162) = 96, a(225) = 120, a(379) = 170, a(619) = 184, a(640) = 228, a(727) = 248, a(759) = 256, a(916) = 348, ... - M. F. Hasler, Feb 16 2025

Examples

			For n = 4, 2*n-1 = 7, we get: 7 <+> 1 = 1, 7 <+> 3*1 = 5, 7 <+> 5 = 3, 7 <+> 3*3 = 1, and from here on it starts over with 7 <+> 1 = 1, etc., so the period is [1, 5, 3, 1], of length 4, whence a(4) = 4.
For n = 6, 2*n-1 = 11, we get:
  11 <+> 1 = 3, 11 <+> 3*3 =  5, 11 <+>  5  = 1, 11 <+> 3*1 = 7,
  11 <+> 7 = 9, 11 <+> 3*9 = 19, 11 <+> 19 = 15, 11 <+> 3*15 = 7, 11 <+> 7 = 9, ...
Thus we have an eventually periodic sequence with the smallest period 4 (with elements 7, 9, 19, 15). Thus a(6) = 4.
		

Crossrefs

Programs

  • PARI
    apply( {A179738(n, y=1, T(y, x=2*n-1)=(x+y)>>valuation(x+y,2))=my(s=[], P); until(, s=concat(s, y=T(3^(#s%2)*y)); for(L=1, #s\3, P=[vecextract(s,Str(-L-t,"..-",1+t)) | t<-[0,L,2*L]]; P[1]==P[2] && P[1]==P[3] && return(#P[1])))}, [2..90])
    
  • Python
    def A179738(n):
        s = [1]; x = 2*n-1; odd = lambda z: all(z&1 or(z:=z>>1)for _ in range(z))and z
        while not(p := next((p for p in range(1, len(s)//3+1) if
            s[-p:]==s[-2*p:-p]==s[-3*p:-2*p]), 0)): s.append(odd(x+3**(len(s)&1)*s[-1]))
        return p
    print([A179738(n)for n in range(2,99)]) # M. F. Hasler, Feb 16 2025

Extensions

Name edited and corrections proposed by Jason Yuen, Feb 09 2025
Edited, a(4) and a(18) corrected, and extended by M. F. Hasler, Feb 15 2025

A179687 a(n) = 2*q(n)-1 where q(n) is the sequence of records positions of A179686.

Original entry on oeis.org

3, 5, 7, 19, 27, 37, 47, 53, 67, 95, 101, 103, 107, 131, 149, 173, 181, 191, 227, 239, 263, 293, 311, 317, 349, 359, 367, 373, 383, 419, 461, 463, 479, 509, 547, 557, 587, 613, 619, 647, 653, 677, 701, 743, 751, 773, 787, 821, 841, 863, 887, 947
Offset: 1

Views

Author

Vladimir Shevelev, Jul 24 2010

Keywords

Comments

The record positions are q(n) = 2, 3, 4, 10, 14, 19, 24, 27, 34,...
Sequences A179382, A179383, A179480, A179481, A179686 and this sequence show that their terms depend on prime power factorization of 2*n-1. Nevertheless, this question yet is waiting its research. Most likely that almost all terms of this sequence are primes (27, 95, 841,... are not).

Crossrefs

Extensions

Extended beyond a(7) by R. J. Mathar, Dec 04 2011

A179787 Let the operation <+> be defined by x<+>y = A038502(x+y). a(n) is the period in the track of the iterated application x<+>(x<+>...(x<+>1)) for x = A001651(n-1).

Original entry on oeis.org

2, 1, 2, 4, 6, 1, 4, 4, 2, 6, 3, 16, 18, 2, 3, 8, 20, 1, 6, 28, 30, 7, 16, 10, 18, 18, 2, 8, 42, 8, 11, 18, 42, 20, 4, 52, 20, 3, 28, 26, 10, 30, 15, 10, 22, 12, 8, 28, 12, 18, 18, 28, 78, 1, 8, 38, 14, 42, 9, 88, 4, 22, 23, 28, 48, 42, 18, 100, 34, 3, 52, 50, 22, 20, 9, 112, 38, 22, 23, 38
Offset: 1

Views

Author

Vladimir Shevelev, Jul 27 2010

Keywords

Comments

The symbol <+> removes powers of three of the sum of the two operands.
The process of starting with 1, adding some constant number x = A001651(n-1) and reducing it iteratively with this operation defines a track 1, x<+>1, x<+>(x<+>1), ... which enters a cycle.
The period of this cycle specifies a(n).
Similar iterated reductions can be defined for power bases m other than 3.

Examples

			For n=5 we take x=A001651(4)=7. The iteration yields 1, 7<+>1=8, 7<+>8=5, 7<+>5=4, 7<+>4=11, 7<+>11=2, 7<+>2=1.
We have reached the 1 of the beginning and therefore a cycle of length a(5)=6.
		

Crossrefs

Programs

  • Maple
    A038502 := proc(n) a := 1; for p in ifactors(n)[2] do if op(1,p) <> 3 then a := a*op(1,p)^op(2,p) ; end if; end do; a ; end proc:
    A179787aux := proc(x,y) local xtrack,xitr,xpos ; xtrack := [y] ; while true do xitr := A038502(op(-1,xtrack)+x) ;
    if not member(xitr, xtrack,'xpos') then xtrack := [op(xtrack),xitr] ; else return 1+nops(xtrack)-xpos ; end if; end do: end proc:
    A001651 := proc(n) option remember; if n <=2 then n; else procname(n-2)+3 ; end if; end proc:
    A179787 := proc(n) A179787aux(A001651(n),1) ; end proc: seq(A179787(n),n=1..80) ; # R. J. Mathar, Nov 04 2010

Extensions

a(22) corrected, definition tightened removing new terminology, sequence extended beyond a(55) by R. J. Mathar, Nov 04 2010

A179739 a(n) = 2*h(n)-1 where h(n) is the sequence of records positions of A179738.

Original entry on oeis.org

3, 5, 7, 11, 13, 31, 37
Offset: 2

Views

Author

Vladimir Shevelev, Jul 25 2010

Keywords

Crossrefs

Previous Showing 11-18 of 18 results.