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

A283980 a(n) = A003961(n)*A006519(n).

Original entry on oeis.org

1, 6, 5, 36, 7, 30, 11, 216, 25, 42, 13, 180, 17, 66, 35, 1296, 19, 150, 23, 252, 55, 78, 29, 1080, 49, 102, 125, 396, 31, 210, 37, 7776, 65, 114, 77, 900, 41, 138, 85, 1512, 43, 330, 47, 468, 175, 174, 53, 6480, 121, 294, 95, 612, 59, 750, 91, 2376, 115, 186, 61, 1260, 67, 222, 275, 46656, 119, 390, 71, 684, 145, 462, 73, 5400, 79, 246, 245
Offset: 1

Views

Author

Antti Karttunen, Mar 19 2017

Keywords

Comments

Completely multiplicative since both A003961 and A006519 are. - Andrew Howroyd, Jul 25 2018

Examples

			From _Michael De Vlieger_, Dec 29 2019: (Start)
a(1) = 1 since 1 is the empty product.
a(2) = 6 because 2 = 2^1 in form p_k^e; switching p_(k+1) for p, we have 3^1 = 3, and the largest power of 2 dividing 2 is 2^1 = 2; thus 3 * 2 = 6.
a(4) = 36 since 4 = 2^2 -> 4(3^2).
a(6) = 30 since 6 = 2^1 * 3^1 -> 2(3 * 5).
a(12) = 180 since 12 = 2^2 * 3 -> 4(3^2 * 5) = 4(45) = 180.
a(30) = 210 since 30 = 2 * 3 * 5 -> 2(3 * 5 * 7) = 210.
(End)
		

Crossrefs

Programs

  • Mathematica
    Array[(Times @@ Map[#1^#2 & @@ # &, FactorInteger[#] /. {p_, e_} /; e > 0 :> {Prime[PrimePi@ p + 1], e}] - Boole[# == 1])*2^IntegerExponent[#, 2] &, 75] (* Michael De Vlieger, Dec 29 2019 *)
  • PARI
    a(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)} \\ Andrew Howroyd, Jul 25 2018
    
  • Python
    from sympy import nextprime, factorint
    from math import prod
    def A283980(n): return prod(nextprime(p)**e if p > 2 else 6**e for p, e in factorint(n).items()) # Chai Wah Wu, Dec 08 2022
  • Scheme
    (define (A283980 n) (* (A006519 n) (A003961 n)))
    

Formula

a(n) = A003961(n)*A006519(n).
From Michael De Vlieger, Dec 29 2019: (Start)
a(p_k) = p_(k+1) for odd prime p.
a(2^k) = 6^k.
a(p_k#) = p_(k+1)# for p_k# = A002110(k). (End)

A100338 Decimal expansion of the constant x whose continued fraction expansion equals A006519 (highest power of 2 dividing n).

Original entry on oeis.org

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

Views

Author

Paul D. Hanna, Nov 17 2004

Keywords

Comments

This constant x has the special property that the continued fraction expansion of 2*x results in the continued fraction expansion of x interleaved with 2's: contfrac(x) = [1;2,1,4,1,2,1,8,1,2,1,4,1,2,1,16,...A006519(n),... ] while contfrac(2*x) = [2;1, 2,2, 2,1, 2,4, 2,1, 2,2, 2,1, 2,8,... 2, A006519(n),...].
The continued fraction of x^2 has large partial quotients (see A100864, A100865) that appear to be doubly exponential.

Examples

			1.353871128429882374388894084016608124227333416812118556923672649787001842...
		

Crossrefs

Programs

  • Mathematica
    cf = ContinuedFraction[ Table[ 2^IntegerExponent[n, 2], {n, 1, 200}]]; RealDigits[ FromContinuedFraction[cf // Flatten] , 10, 105] // First (* Jean-François Alcover, Feb 19 2013 *)
  • PARI
    /* This PARI code generates 1000 digits of x very quickly: */ {x=sqrt(2);y=x;L=2^10;for(i=1,10,v=contfrac(x,2*L); if(2*L>#v,v=concat(v,vector(2*L-#v+1,j,1))); if(2*L>#w,w=concat(w,vector(2*L-#w+1,j,1))); w=vector(2*L,n,if(n%2==1,2,w[n]=v[n\2]));w[1]=floor(2*x); CFW=contfracpnqn(w);x=CFW[1,1]/CFW[2,1]*1.0/2;);x}
    
  • PARI
    {CFM=contfracpnqn(vector(1500,n,2^valuation(n,2))); x=CFM[1,1]/CFM[2,1]*1.0}

A159885 For n >= 1, let f(2n+1) = (3n+2)/A006519(3n+2) and let f^k be the k-th iteration of f. Then a(n) is the least k such that A000120(f^k(2n+1)) <= A000120(n).

Original entry on oeis.org

2, 1, 2, 6, 1, 1, 2, 3, 3, 1, 1, 4, 1, 1, 2, 8, 2, 3, 3, 39, 1, 1, 1, 4, 3, 1, 1, 2, 1, 1, 2, 8, 5, 2, 2, 41, 3, 2, 3, 5, 5, 1, 1, 1, 1, 1, 1, 42, 2, 1, 4, 6, 1, 1, 1, 2, 2, 1, 1, 2, 1, 1, 2, 44, 5, 5, 5, 31, 5, 2, 2, 41, 7, 1, 3, 3, 3, 2, 3, 34, 3, 5, 13, 12, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 42, 8, 1, 2, 4, 1
Offset: 1

Views

Author

Vladimir Shevelev, Apr 25 2009, Apr 27 2009

Keywords

Comments

Conjecture: a(n) exists for every n >= 1. It is easy to see that this conjecture is equivalent to the well-known Collatz 3x+1 conjecture.

Crossrefs

Programs

  • PARI
    A006519(n) = (1<A006519((3*((n-1)/2))+2); \\ Defined only for odd n. Cf. A075677.
    A159885(n) = { my(w=hammingweight(n), n = (n+n+1)); for(k=1,oo,n = f(n); if(hammingweight(n) <= w, return(k))); }; \\ Antti Karttunen, Sep 22 2018

Extensions

Edited by N. J. A. Sloane, May 03 2009
a(25) corrected, sequence extended by R. J. Mathar, May 15 2009

A006520 Partial sums of A006519.

Original entry on oeis.org

1, 3, 4, 8, 9, 11, 12, 20, 21, 23, 24, 28, 29, 31, 32, 48, 49, 51, 52, 56, 57, 59, 60, 68, 69, 71, 72, 76, 77, 79, 80, 112, 113, 115, 116, 120, 121, 123, 124, 132, 133, 135, 136, 140, 141, 143, 144, 160, 161, 163, 164, 168, 169, 171, 172, 180, 181, 183, 184, 188, 189
Offset: 1

Views

Author

Keywords

Comments

The subsequence of primes in this partial sum begins: 3, 11, 23, 29, 31, 59, 71, 79, 113, 163, 181. The subsequence of powers in this partial sum begins: 1, 4, 8, 9, 32, 49, 121, 144, 169. - Jonathan Vos Post, Feb 18 2010

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

First differences of A022560.

Programs

  • Mathematica
    Table[ 2^IntegerExponent[n, 2], {n, 1, 70}] // Accumulate (* Jean-François Alcover, May 14 2013 *)
  • PARI
    a(n)=sum(i=1,n,2^valuation(i,2))
    
  • Python
    def A006520(n): return sum(i&-i for i in range(1,n+1)) # Chai Wah Wu, Jul 14 2022

Formula

a(n)/(n*log(n)) is bounded. - Benoit Cloitre, Dec 17 2002
G.f.: (1/(x*(1-x))) * (x/(1-x) + Sum_{k>=1} 2^(k-1)*x^2^k/(1-x^2^k)). - Ralf Stephan, Apr 17 2003
a(n) = b(n+1), with b(2n) = 2b(n) + n, b(2n+1) = 2b(n) + n + 1. - Ralf Stephan, Sep 07 2003
a(2^k-1) = k*2^(k-1) = A001787(k) for any k > 0. - Rémy Sigrist, Jan 21 2021
a(n) ~ (1/(2*log(2)))*n*log(n) + (3/4 + (gamma-1)/(2*log(2)))*n, where gamma is Euler's constant (A001620). - Amiram Eldar, Nov 15 2022
a(n) = A136013(n) + n = A159699(n) - n. - Alan Michael Gómez Calderón, Apr 13 2025

Extensions

More terms from Benoit Cloitre, Dec 17 2002
Offset changed to 1 by N. J. A. Sloane, Oct 18 2019

A228350 Triangle read by rows: T(j,k) is the k-th part in nonincreasing order of the j-th region of the set of compositions (ordered partitions) of n in colexicographic order, if 1<=j<=2^(n-1) and 1<=k<=A006519(j).

Original entry on oeis.org

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

Views

Author

Omar E. Pol, Aug 20 2013

Keywords

Comments

Triangle read by rows in which row n lists the A006519(n) elements of the row A001511(n) of triangle A065120, n >= 1.
The equivalent sequence for integer partitions is A206437.

Examples

			---------------------------------------------------------
.              Diagram                Triangle
Compositions     of            of compositions (rows)
.   of 5       regions          and regions (columns)
----------------------------------------------------------
.             _ _ _ _ _
.         5  |_        |                                5
.       1+4  |_|_      |                              1 4
.       2+3  |_  |     |                            2   3
.     1+1+3  |_|_|_    |                          1 1   3
.       3+2  |_    |   |                        3       2
.     1+2+2  |_|_  |   |                      1 2       2
.     2+1+2  |_  | |   |                    2   1       2
.   1+1+1+2  |_|_|_|_  |                  1 1   1       2
.       4+1  |_      | |                4               1
.     1+3+1  |_|_    | |              1 3               1
.     2+2+1  |_  |   | |            2   2               1
.   1+1+2+1  |_|_|_  | |          1 1   2               1
.     3+1+1  |_    | | |        3       1               1
.   1+2+1+1  |_|_  | | |      1 2       1               1
.   2+1+1+1  |_  | | | |    2   1       1               1
. 1+1+1+1+1  |_|_|_|_|_|  1 1   1       1               1
.
Also the structure could be represented by an isosceles triangle in which the n-th diagonal gives the n-th region. For the composition of 4 see below:
.             _ _ _ _
.         4  |_      |                  4
.       1+3  |_|_    |                1   3
.       2+2  |_  |   |              2       2
.     1+1+2  |_|_|_  |            1   1       2
.       3+1  |_    | |          3               1
.     1+2+1  |_|_  | |        1   2               1
.     2+1+1  |_  | | |      2       1               1
.   1+1+1+1  |_|_|_|_|    1   1       1               1
.
Illustration of the four sections of the set of compositions of 4:
.                                      _ _ _ _
.                                     |_      |     4
.                                     |_|_    |   1+3
.                                     |_  |   |   2+2
.                       _ _ _         |_|_|_  | 1+1+2
.                      |_    |   3          | |     1
.             _ _      |_|_  | 1+2          | |     1
.     _      |_  | 2       | |   1          | |     1
.    |_| 1     |_| 1       |_|   1          |_|     1
.
.
Illustration of initial terms. The parts of the eight regions of the set of compositions of 4:
--------------------------------------------------------
\j:  1      2    3        4     5      6    7          8
k
--------------------------------------------------------
.  _    _ _    _    _ _ _     _    _ _    _    _ _ _ _
1 |_|1 |_  |2 |_|1 |_    |3  |_|1 |_  |2 |_|1 |_      |4
2        |_|1        |_  |2         |_|1        |_    |3
3                      | |1                       |   |2
4                      |_|1                       |_  |2
5                                                   | |1
6                                                   | |1
7                                                   | |1
8                                                   |_|1
.
Triangle begins:
1;
2,1;
1;
3,2,1,1;
1;
2,1;
1;
4,3,2,2,1,1,1,1;
1;
2,1;
1;
3,2,1,1;
1;
2,1;
1;
5,4,3,3,2,2,2,2,1,1,1,1,1,1,1,1;
...
.
Also triangle read by rows T(n,m) in which row n lists the parts of the n-th section of the set of compositions of the integers >= n, ordered by regions. Row lengths give A045623. Row sums give A001792 (see below):
[1];
[2,1];
[1],[3,2,1,1];
[1],[2,1],[1],[4,3,2,2,1,1,1,1];
[1],[2,1],[1],[3,2,1,1],[1],[2,1],[1],[5,4,3,3,2,2,2,2,1,1,1,1,1,1,1,1];
		

Crossrefs

Formula

T(j,k) = A065120(A001511(j)),k) = A001511(j) - A029837(k), 1<=k<=A006519(j), j>=1.

A228371 First differences of A228370. Also A001511 and A006519 interleaved.

Original entry on oeis.org

1, 1, 2, 2, 1, 1, 3, 4, 1, 1, 2, 2, 1, 1, 4, 8, 1, 1, 2, 2, 1, 1, 3, 4, 1, 1, 2, 2, 1, 1, 5, 16, 1, 1, 2, 2, 1, 1, 3, 4, 1, 1, 2, 2, 1, 1, 4, 8, 1, 1, 2, 2, 1, 1, 3, 4, 1, 1, 2, 2, 1, 1, 6, 32, 1, 1, 2, 2, 1, 1, 3, 4, 1, 1, 2, 2, 1, 1, 4, 8, 1, 1, 2, 2, 1, 1, 3, 4, 1, 1, 2, 2, 1, 1, 5, 16, 1, 1, 2, 2, 1, 1, 3, 4, 1, 1, 2, 2, 1, 1, 4, 8, 1, 1, 2, 2, 1, 1, 3, 4, 1, 1, 2, 2, 1, 1, 7, 64
Offset: 1

Views

Author

Omar E. Pol, Aug 21 2013

Keywords

Comments

Number of toothpicks added at n-th stage to the toothpick structure (related to integer compositions) of A228370.
The equivalent sequence for integer partitions is A220517.

Examples

			Illustration of the structure after 32 stages. The diagram represents the 16 compositions of 5. The k-th horizontal line segment has length A001511(k) equals the largest part of the k-th region. The k-th vertical line segment has length A006519(k) equals the number of parts of the k-th region.
.      _ _ _ _ _
16     _        |
15     _|_      |
14     _  |     |
13     _|_|_    |
12     _    |   |
11     _|_  |   |
10     _  | |   |
9      _|_|_|_  |
8      _      | |
7      _|_    | |
6      _  |   | |
5      _|_|_  | |
4      _    | | |
3      _|_  | | |
2      _  | | | |
1       | | | | |
.
Written as an irregular triangle the sequence begins:
  1,1;
  2,2;
  1,1,3,4;
  1,1,2,2,1,1,4,8;
  1,1,2,2,1,1,3,4,1,1,2,2,1,1,5,16;
  1,1,2,2,1,1,3,4,1,1,2,2,1,1,4,8,1,1,2,2,1,1,3,4,1,1,2,2,1,1,6,32;
  ...
		

Crossrefs

Row lengths give 2*A011782. Right border gives A000079.

Programs

  • Python
    def A228371(n): return ((m:=(n>>1)+1)&-m).bit_length() if n&1 else (m:=n>>1)&-m # Chai Wah Wu, Jul 14 2022

Formula

a(2n-1) = A001511(n), n >= 1. a(2n) = A006519(n), n >= 1.

A084458 An infinite juggling sequence using three balls: a(n) is the least (lowest) throw needed to ensure that none of the juggling states A084457[n..n+A006519(n)-1] occurs in A084457[0..n-1].

Original entry on oeis.org

4, 4, 6, 0, 5, 8, 0, 0, 3, 7, 0, 7, 0, 9, 0, 0, 7, 0, 10, 0, 0, 0, 7, 12, 0, 0, 0, 0, 4, 10, 0, 0, 9, 0, 0, 11, 0, 0, 0, 9, 0, 13, 0, 0, 0, 0, 9, 0, 14, 0, 0, 0, 0, 0, 5, 12, 0, 0, 0, 11, 0, 0, 14, 0, 0, 0, 0, 11, 0, 0, 15, 0, 0, 0, 0, 0, 10, 0, 16, 0, 0, 0, 0, 0, 0, 5, 13, 0, 0, 0, 13, 0, 0, 0, 15, 0, 0, 0
Offset: 1

Views

Author

Antti Karttunen, Jun 02 2003

Keywords

Comments

The condition is equivalent to that A000265(A084457(n)) does not occur in A084457[0..n-1].

Crossrefs

Variant: A084452. Positions of zeros, minus one: A084463.

A100661 Quet transform of A006519 (see A101387 for definition). Also, least k such that n+k has at most k ones in its binary representation.

Original entry on oeis.org

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

Views

Author

David Wasserman, Jan 14 2005

Keywords

Comments

If n+a(n) has exactly a(n) 1's in binary, then a(n+1) = a(n)+1, but if n+a(n) has less than a(n) 1's, then a(n+1) = a(n)-1. a(n) is the number of terms needed to represent n as a sum of numbers of the form 2^k-1. [Jeffrey Shallit]
Is a(n) = A080468(n+1)+1?
Compute a(n) by repeatedly subtracting the largest number 2^k-1<=n until zero is reached. The number of times a term was subtracted gives a(n). Examples: 5 = 3 + 1 + 1 ==> a(5) = 3 6 = 3 + 3 ==> a(6) = 2. Replace all zeros in A079559 by -1, then the a(n) are obtained as cumulative sums (equivalent to the generating function given); see fxtbook link. [Joerg Arndt, Jun 12 2006]

Examples

			a(4) = 2 because 4+2 (110) has two 1's, but 4+1 (101) has more than one 1.
Conjecture (Joerg Arndt):
a(n) is the number of bits in the binary words of sequence A108918
......A108918.A108918..n..=..n.=.(sum.of.term.2^k-1)
........00001.1.....00001.=..1.=..1
........00011.2.....00010.=..2.=..1.+.1
........00010.1.....00011.=..3.=..3
........00101.2.....00100.=..4.=..3.+.1
........00111.3.....00101.=..5.=..3.+.1.+.1
........00110.2.....00110.=..6.=..3.+.3
........00100.1.....00111.=..7.=..7
........01001.2.....01000.=..8.=..7.+.1
........01011.3.....01001.=..9.=..7.+.1.+.1
........01010.2.....01010.=.10.=..7.+.3
........01101.3.....01011.=.11.=..7.+.3.+.1
........01111.4.....01100.=.12.=..7.+.3.+.1.+.1
........01110.3.....01101.=.13.=..7.+.3.+.3
........01100.2.....01110.=.14.=..7.+.7
........01000.1.....01111.=.15.=.15
		

Crossrefs

Records at indices in (essentially) A000325.

Programs

  • Maple
    hb:= n-> `if`(n=1, 0, 1+hb(iquo (n, 2))):
    a:= proc(n) local m, t;
          m:= n;
          for t from 0 while m>0 do
            m:= m - (2^(hb(m+1))-1)
          od; t
        end:
    seq(a(n), n=1..100);  # Alois P. Heinz, Jan 22 2011
  • Mathematica
    hb[n_] := If[n==1, 0, 1+hb[Quotient[n, 2]]];
    a[n_] := Module[{m=n, t}, For[t=0, m>0, t++, m = m - (2^(hb[m+1])-1)]; t];
    Array[a, 100] (* Jean-François Alcover, Oct 31 2020, after Alois P. Heinz *)
  • PARI
    A100661(n)=
    { /* method: repeatedly subtract Mersenne numbers */
        local(m, ct);
        if ( n<=1, return(n) );
        m = 1;
        while ( n>m, m<<=1 );
        m -= 1;
        while ( m>n, m>>=1 );
        /* here m=2^k-1 and m<=n */
        ct = 0;
        while ( n, while (m<=n, n-=m; ct+=1);  m>>=1 );
        return( ct );
    }
    vector(100,n,A100661(n)) /* show terms */
    /* Joerg Arndt, Jan 22 2011 */
    
  • PARI
    TInverse(v)=
    {
        local(l, w, used, start, x);
        l = length(v); w = vector(l); used = vector(l); start = 1;
        for (i = 1, l,
            while (start <= l && used[start], start++);
            x = start;
            for (j = 2, v[i], x++; while (x <= l && used[x], x++));
            if (x > l,
                return (vector(i - 1, k, w[k]))
                , /* else */
                w[i] = x; used[x] = 1
            )
        );
        return(w);
    }
    PInverse(v)=
    {
        local(l, w);
        l = length(v); w = vector(l);
        for (i = 1, l, if (v[i] <= l, w[v[i]] = i));
        return(w);
    }
    T(v)=
    {
        local(l, w, c);
        l = length(v); w = vector(l);
        for (n = 1, l,
            if (v[n],
                c = 0;
                for (m = 1, n - 1, if (v[m] < v[n], c++));
                w[n] = v[n] - c
                , /* else */
                return (vector(n - 1, i, w[i]))
            )
        );
        return(w);
    }
    Q(v)=T(PInverse(TInverse(v)));
    /* compute terms: */
    v = vector(150);
    for (n = 1, 150, m = n; x = 1; while (!(m%2), m\=2; x *= 2); v[n] = x); Q(v)
  • Sage
    A100661 = lambda n: next(k for k in PositiveIntegers() if (n+k).digits(base=2).count(1) <= k) # D. S. McNeil, Jan 23 2011
    

Formula

a(2^k-1) = 1. For 2^k <= n <= 2^(k+1)-2, a(n) = a(n-2^k+1)+1.
G.f.: x*(2*(1-x)*prod(n>=1, (1+x^(2^n-1))) - 1)/((1-x)^2) = x*(1 + 2*x + 1*x^2 + 2*x^3 + 3*x^4 + 2*x^5 + 1*x^6 + 2*x^7 + 3*x^8 + 2*x^9 + ...) [Joerg Arndt, Jun 12 2006]

A101119 Nonzero differences of A006519 (highest power of 2 dividing n) and A003484 (Radon function).

Original entry on oeis.org

7, 22, 7, 52, 7, 22, 7, 112, 7, 22, 7, 52, 7, 22, 7, 239, 7, 22, 7, 52, 7, 22, 7, 112, 7, 22, 7, 52, 7, 22, 7, 494, 7, 22, 7, 52, 7, 22, 7, 112, 7, 22, 7, 52, 7, 22, 7, 239, 7, 22, 7, 52, 7, 22, 7, 112, 7, 22, 7, 52, 7, 22, 7, 1004, 7, 22, 7, 52, 7, 22, 7, 112, 7, 22, 7, 52, 7, 22, 7, 239
Offset: 1

Views

Author

Simon Plouffe and Paul D. Hanna, Dec 02 2004

Keywords

Comments

A006519 and A003484 differ only at every 16th term; this sequence forms the nonzero differences. Records form A101120. Equals the XOR BINOMIAL transform of A101122.

Crossrefs

Programs

  • Magma
    [2^Valuation(16*n,2) - 8*Floor(Valuation(16*n,2)/4) - 2^(Valuation(16*n,2) mod 4): n in [1..50]]; // G. C. Greubel, Nov 01 2018
    
  • Mathematica
    Table[2^(IntegerExponent[16*n, 2]) - 8*Floor[IntegerExponent[16*n, 2]/4] - 2^(Mod[IntegerExponent[16*n, 2], 4]), {n, 1, 50}] (* G. C. Greubel, Nov 01 2018 *)
  • PARI
    {a(n)=2^valuation(16*n,2)-(8*(valuation(16*n,2)\4)+2^(valuation(16*n,2)%4))}
    
  • Python
    def A101119(n): return (1<<(m:=(~n&n-1).bit_length()+4))-((m&-4)<<1)-(1<<(m&3)) # Chai Wah Wu, Jul 10 2022

Formula

a(n) = A006519(16*n) - A003484(16*n) for n>=1. a(2*n-1) = 7 for n>=1.

A118821 2-adic continued fraction of zero, where a(n) = 2 if n is odd, -A006519(n/2) otherwise.

Original entry on oeis.org

2, -1, 2, -2, 2, -1, 2, -4, 2, -1, 2, -2, 2, -1, 2, -8, 2, -1, 2, -2, 2, -1, 2, -4, 2, -1, 2, -2, 2, -1, 2, -16, 2, -1, 2, -2, 2, -1, 2, -4, 2, -1, 2, -2, 2, -1, 2, -8, 2, -1, 2, -2, 2, -1, 2, -4, 2, -1, 2, -2, 2, -1, 2, -32, 2, -1, 2, -2, 2, -1, 2, -4, 2, -1, 2, -2, 2, -1, 2, -8, 2, -1, 2, -2, 2, -1, 2, -4, 2, -1, 2, -2, 2, -1, 2, -16
Offset: 1

Views

Author

Paul D. Hanna, May 01 2006

Keywords

Comments

Limit of convergents equals zero; only the 6th convergent is indeterminate. Other 2-adic continued fractions of zero are A118824, A118827, A118830. A006519(n) is the highest power of 2 dividing n; A080277 = partial sums of A038712, where A038712(n) = 2*A006519(n) - 1.

Examples

			For n >= 1, convergents A118822(k)/A118823(k) are:
  at k = 4*n: -1/A080277(n);
  at k = 4*n+1: -2/(2*A080277(n)-1);
  at k = 4*n+2: -1/(A080277(n)-1);
  at k = 4*n-1: 0/(-1)^n.
Convergents begin:
  2/1, -1/-1, 0/-1, -1/1, -2/1, 1/0, 0/1, 1/-4,
  2/-7, -1/3, 0/-1, -1/5, -2/9, 1/-4, 0/1, 1/-12,
  2/-23, -1/11, 0/-1, -1/13, -2/25, 1/-12, 0/1, 1/-16,
  2/-31, -1/15, 0/-1, -1/17, -2/33, 1/-16, 0/1, 1/-32, ...
		

Crossrefs

Cf. A006519, A080277; convergents: A118822/A118823; variants: A118824, A118827, A118830; A100338.

Programs

  • Mathematica
    Array[-2^(IntegerExponent[#, 2] - 1) /. -1/2 -> 2 &, 96] (* Michael De Vlieger, Nov 02 2018 *)
  • PARI
    a(n)=local(p=+2,q=-1);if(n%2==1,p,q*2^valuation(n/2,2))
Showing 1-10 of 334 results. Next