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

A076657 a(n) = (1/24) * binomial(2n,n)*(16^n-binomial(2n,n)^2). Right side of identity involving series A005148.

Original entry on oeis.org

0, 1, 55, 3080, 176855, 10343256, 613052440, 36701926976, 2214353424855, 134425330290680, 8201448540559560, 502460159228920256, 30890758976011469080, 1904794982716556862400, 117756015163729064222400, 7296082202981986626900480, 452950299939910627966962135
Offset: 0

Views

Author

Ralf Stephan, Oct 24 2002

Keywords

Comments

The members of the sequence have exceptionally many small prime factors.

Examples

			G.f. = x + 55*x^2 + 3080*x^3 + 176855*x^4 + 10343256*x^5 + 613052440*x^6 + ...
		

References

  • D. Shanks, Solved and unsolved problems in number theory, Chelsea NY, 1985, pp. 256-257 (F. Beukers, Letter to D. Shanks, Mar. 13, 1984).

Crossrefs

Cf. A005148.

Programs

  • Magma
    [(Binomial(2*n, n)*(16^n-Binomial(2*n, n)^2))/24 : n in [0..20]]; // Vincenzo Librandi, May 17 2013
  • Mathematica
    a[n_] := (Binomial[2n, n]*(16^n-Binomial[2n, n]^2))/24
    Table[(Binomial[2 n, n] (16^n - Binomial[2 n, n]^2)) / 24, {n, 0, 20}] (* Vincenzo Librandi, May 17 2013 *)
  • PARI
    {a(n) = if( n<0, 0, (binomial(2*n, n) * (16^n - binomial(2*n, n)^2)) / 24)};
    

Formula

a(n) = (1/24) * binomial(2n, n)*(16^n-binomial(2n, n)^2) = Sum_{i=1..n} binomial(2n-2i, n-i)^3 * A005148(i) (Shanks and Beukers).

A071644 a(n) = A005148(2^n-1)/8^(n-1).

Original entry on oeis.org

1, 311, 433380445, 10478887384420274295559, 72383623935281195994580596438773770789899563140885, 39891231890836797259743675264050089835308134898303203181868683359843686746718703346865629969758112672725599
Offset: 1

Views

Author

Benoit Cloitre, Jun 22 2002

Keywords

Comments

Appears to always be an integer. General conjecture: the numbers k such that 8^a is the highest power of 2 dividing A005148(k) is the same sequence as numbers k such that k has exactly (a+1) 1's in its binary representation. Hence this sequence gives the smallest integer of the form A005148(k) /8^(n-1).

Programs

  • PARI
    for(s=1,8,n=2^s-1; print1(polcoeff(prod(k=1,(n+1)\2,1+x^(2*k-1),1+x*O(x^n))^(24*n),n)/24/8^(s-1),","))

A074774 a(n) = A005148(n)/8^(b(n)-1) where b(n) denotes the number of 1's in the binary representation of n.

Original entry on oeis.org

1, 47, 311, 138799, 997057, 58404025, 433380445, 1662803271215, 12555303421685, 762968405786159, 5823841814857247, 2856558096376330937, 21966969165793217071, 1355329065202645937843, 10478887384420274295559
Offset: 1

Views

Author

Benoit Cloitre, Sep 29 2002

Keywords

Comments

Appears to always be an integer. 8^(b(n)-1) seems also to be the highest power of 2 dividing A005148(n)

A018900 Sums of two distinct powers of 2.

Original entry on oeis.org

3, 5, 6, 9, 10, 12, 17, 18, 20, 24, 33, 34, 36, 40, 48, 65, 66, 68, 72, 80, 96, 129, 130, 132, 136, 144, 160, 192, 257, 258, 260, 264, 272, 288, 320, 384, 513, 514, 516, 520, 528, 544, 576, 640, 768, 1025, 1026, 1028, 1032, 1040, 1056, 1088, 1152, 1280, 1536, 2049, 2050, 2052, 2056, 2064, 2080, 2112, 2176, 2304, 2560, 3072
Offset: 1

Views

Author

Jonn Dalton (jdalton(AT)vnet.ibm.com), Dec 11 1996

Keywords

Comments

Appears to give all k such that 8 is the highest power of 2 dividing A005148(k). - Benoit Cloitre, Jun 22 2002
Seen as a triangle read by rows, T(n,k) = 2^(k-1) + 2^n, 1 <= k <= n, the sum of the n-th row equals A087323(n). - Reinhard Zumkeller, Jun 24 2009
Numbers whose base-2 sum of digits is 2. - Tom Edgar, Aug 31 2013
All odd terms are A000051. - Robert G. Wilson v, Jan 03 2014
A239708 holds the subsequence of terms m such that m - 1 is prime. - Hieronymus Fischer, Apr 20 2014

Examples

			From _Hieronymus Fischer_, Apr 27 2014: (Start)
a(1) = 3, since 3 = 2^1 + 2^0.
a(5) = 10, since 10 = 2^3 + 2^1.
a(10^2) = 16640
a(10^3) = 35184372089344
a(10^4) = 2788273714550169769618891533295908724670464 = 2.788273714550...*10^42
a(10^5) = 3.6341936214780344527466190...*10^134
a(10^6) = 4.5332938264998904048012398...*10^425
a(10^7) = 1.6074616084721302346802429...*10^1346
a(10^8) = 1.4662184497310967196301632...*10^4257
a(10^9) = 2.3037539289782230932863807...*10^13462
a(10^10) = 9.1836811272250798973464436...*10^42571
(End)
		

Crossrefs

Cf. A000079, A014311, A014312, A014313, A023688, A023689, A023690, A023691 (Hamming weight = 1, 3, 4, ..., 9).
Sum of base-b digits equal b: A226636 (b = 3), A226969 (b = 4), A227062 (b = 5), A227080 (b = 6), A227092 (b = 7), A227095 (b = 8), A227238 (b = 9), A052224 (b = 10). - M. F. Hasler, Dec 23 2016

Programs

  • C
    unsigned hakmem175(unsigned x) {
        unsigned s, o, r;
        s = x & -x; r = x + s;
        o = x ^ r;  o = (o >> 2) / s;
        return r | o;
    }
    unsigned A018900(int n) {
        if (n == 1) return 3;
        return hakmem175(A018900(n - 1));
    } // Peter Luschny, Jan 01 2014
    
  • Haskell
    a018900 n = a018900_list !! (n-1)
    a018900_list = elemIndices 2 a073267_list  -- Reinhard Zumkeller, Mar 07 2012
    
  • Maple
    a:= n-> (i-> 2^i+2^(n-1-i*(i-1)/2))(floor((sqrt(8*n-1)+1)/2)):
    seq(a(n), n=1..100);  # Alois P. Heinz, Feb 01 2022
  • Mathematica
    Select[ Range[ 1056 ], (Count[ IntegerDigits[ #, 2 ], 1 ]==2)& ]
    Union[Total/@Subsets[2^Range[0,10],{2}]] (* Harvey P. Dale, Mar 04 2012 *)
  • PARI
    for(m=1,9,for(n=0,m-1,print1(2^m+2^n", "))) \\ Charles R Greathouse IV, Sep 09 2011
    
  • PARI
    is(n)=hammingweight(n)==2 \\ Charles R Greathouse IV, Mar 03 2014
    
  • PARI
    for(n=0,10^5,if(hammingweight(n)==2,print1(n,", "))); \\ Joerg Arndt, Mar 04 2014
    
  • PARI
    a(n)= my(t=sqrtint(n*8)\/2); 2^t + 2^(n-1-t*(t-1)/2); \\ Ruud H.G. van Tol, Nov 30 2024
    
  • Python
    print([n for n in range(1, 3001) if bin(n)[2:].count("1")==2]) # Indranil Ghosh, Jun 03 2017
    
  • Python
    A018900_list = [2**a+2**b for a in range(1,10) for b in range(a)] # Chai Wah Wu, Jan 24 2021
    
  • Python
    from math import isqrt, comb
    def A018900(n): return (1<<(m:=isqrt(n<<3)+1>>1))+(1<<(n-1-comb(m,2))) # Chai Wah Wu, Oct 30 2024
  • Smalltalk
    distinctPowersOf: b
      "Version 1: Answers the n-th number of the form b^i + b^j, i>j>=0, where n is the receiver.
      b > 1 (b = 2, for this sequence).
      Usage: n distinctPowersOf: 2
      Answer: a(n)"
      | n i j |
      n := self.
      i := (8*n - 1) sqrtTruncated + 1 // 2.
      j := n - (i*(i - 1)/2) - 1.
      ^(b raisedToInteger: i) + (b raisedToInteger: j)
    [by Hieronymus Fischer, Apr 20 2014]
    ------------
    
  • Smalltalk
    distinctPowersOf: b
      "Version 2: Answers an array which holds the first n numbers of the form b^i + b^j, i>j>=0, where n is the receiver. b > 1 (b = 2, for this sequence).
      Usage: n distinctPowersOf: 2
      Answer: #(3 5 6 9 10 12 ...) [first n terms]"
      | k p q terms |
      terms := OrderedCollection new.
      k := 0.
      p := b.
      q := 1.
      [k < self] whileTrue:
             [[q < p and: [k < self]] whileTrue:
                       [k := k + 1.
                       terms add: p + q.
                       q := b * q].
             p := b * p.
             q := 1].
      ^terms as Array
    [by Hieronymus Fischer, Apr 20 2014]
    ------------
    
  • Smalltalk
    floorDistinctPowersOf: b
      "Answers an array which holds all the numbers b^i + b^j < n, i>j>=0, where n is the receiver.
      b > 1 (b = 2, for this sequence).
      Usage: n floorDistinctPowersOf: 2
      Answer: #(3 5 6 9 10 12 ...) [all terms < n]"
      | a n p q terms |
      terms := OrderedCollection new.
      n := self.
      p := b.
      q := 1.
      a := p + q.
      [a < n] whileTrue:
             [[q < p and: [a < n]] whileTrue:
                       [terms add: a.
                       q := b * q.
                       a := p + q].
             p := b * p.
             q := 1.
             a := p + q].
      ^terms as Array
    [by Hieronymus Fischer, Apr 20 2014]
    ------------
    
  • Smalltalk
    invertedDistinctPowersOf: b
      "Given a number m which is a distinct power of b, this method answers the index n such that there are uniquely defined i>j>=0 for which b^i + b^j = m, where m is the receiver;  b > 1 (b = 2, for this sequence).
      Usage: m invertedDistinctPowersOf: 2
      Answer: n such that a(n) = m, or, if no such n exists, min (k | a(k) >= m)"
      | n i j k m |
      m := self.
      i := m integerFloorLog: b.
      j := m - (b raisedToInteger: i) integerFloorLog: b.
      n := i * (i - 1) / 2 + 1 + j.
      ^n
    [by Hieronymus Fischer, Apr 20 2014]
    

Formula

a(n) = 2^trinv(n-1) + 2^((n-1)-((trinv(n-1)*(trinv(n-1)-1))/2)), i.e., 2^A002024(n)+2^A002262(n-1). - Antti Karttunen
a(n) = A059268(n-1) + A140513(n-1). A000120(a(n)) = 2. Complement of A161989. A151774(a(n)) = 1. - Reinhard Zumkeller, Jun 24 2009
A073267(a(n)) = 2. - Reinhard Zumkeller, Mar 07 2012
Start with A000051. If n is in sequence, then so is 2n. - Ralf Stephan, Aug 16 2013
a(n) = A057168(a(n-1)) for n>1 and a(1) = 3. - Marc LeBrun, Jan 01 2014
From Hieronymus Fischer, Apr 20 2014: (Start)
Formulas for a general parameter b according to a(n) = b^i + b^j, i>j>=0; b = 2 for this sequence.
a(n) = b^i + b^j, where i = floor((sqrt(8n - 1) + 1)/2), j = n - 1 - i*(i - 1)/2 [for a Smalltalk implementation see Prog section, method distinctPowersOf: b (2 versions)].
a(A000217(n)) = (b + 1)*b^(n-1) = b^n + b^(n-1).
a(A000217(n)+1) = 1 + b^(n+1).
a(n + 1 + floor((sqrt(8n - 1) + 1)/2)) = b*a(n).
a(n + 1 + floor(log_b(a(n)))) = b*a(n).
a(n + 1) = b^2/(b+1) * a(n) + 1, if n is a triangular number (s. A000217).
a(n + 1) = b*a(n) + (1-b)* b^floor((sqrt(8n - 1) + 1)/2), if n is not a triangular number.
The next term can also be calculated without using the index n. Let m be a term and i = floor(log_b(m)), then:
a(n + 1) = b*m + (1-b)* b^i, if floor(log_b(m/(b+1))) + 1 < i,
a(n + 1) = b^2/(b+1) * m + 1, if floor(log_b(m/(b+1))) + 1 = i.
Partial sum:
Sum_{k=1..n} a(k) = ((((b-1)*(j+1)+i-1)*b^(i-j) + b)*b^j - i)/(b-1), where i = floor((sqrt(8*n - 1) + 1)/2), j = n - 1 - i*(i - 1)/2.
Inverse:
For each sequence term m, the index n such that a(n) = m is determined by n := i*(i-1)/2 + j + 1, where i := floor(log_b(m)), j := floor(log_b(m - b^floor(log_b(m)))) [for a Smalltalk implementation see Prog section, method invertedDistinctPowersOf: b].
Inequalities:
a(n) <= (b+1)/b * b^floor(sqrt(2n)+1/2), equality holds for triangular numbers.
a(n) > b^floor(sqrt(2n)+1/2).
a(n) < b^sqrt(2n)*sqrt(b).
a(n) > b^sqrt(2n)/sqrt(b).
Asymptotic behavior:
lim sup a(n)/b^sqrt(2n) = sqrt(b).
lim inf a(n)/b^sqrt(2n) = 1/sqrt(b).
lim sup a(n)/b^(floor(sqrt(2n))) = b.
lim inf a(n)/b^(floor(sqrt(2n))) = 1.
lim sup a(n)/b^(floor(sqrt(2n)+1/2)) = (b+1)/b.
lim inf a(n)/b^(floor(sqrt(2n)+1/2)) = 1.
(End)
Sum_{n>=1} 1/a(n) = A179951. - Amiram Eldar, Oct 06 2020

Extensions

Edited by M. F. Hasler, Dec 23 2016

A014311 Numbers with exactly 3 ones in binary expansion.

Original entry on oeis.org

7, 11, 13, 14, 19, 21, 22, 25, 26, 28, 35, 37, 38, 41, 42, 44, 49, 50, 52, 56, 67, 69, 70, 73, 74, 76, 81, 82, 84, 88, 97, 98, 100, 104, 112, 131, 133, 134, 137, 138, 140, 145, 146, 148, 152, 161, 162, 164, 168, 176, 193, 194, 196, 200, 208, 224, 259, 261, 262, 265, 266, 268, 273, 274, 276, 280, 289, 290, 292, 296, 304
Offset: 1

Views

Author

Al Black (gblack(AT)nol.net)

Keywords

Comments

Equivalently, sums of three distinct powers of 2.
Appears to give all n such that 64 is the highest power of 2 dividing A005148(n). - Benoit Cloitre, Jun 22 2002
From Gus Wiseman, Oct 05 2020: (Start)
These are numbers k such that the k-th composition in standard order has length 3. The k-th composition in standard order (graded reverse-lexicographic, A066099) is obtained by taking the set of positions of 1's in the reversed binary expansion of k, prepending 0, taking first differences, and reversing again. This gives a bijective correspondence between nonnegative integers and integer compositions. The sequence together with the corresponding standard compositions begins:
7: (1,1,1) 44: (2,1,3) 97: (1,5,1)
11: (2,1,1) 49: (1,4,1) 98: (1,4,2)
13: (1,2,1) 50: (1,3,2) 100: (1,3,3)
14: (1,1,2) 52: (1,2,3) 104: (1,2,4)
19: (3,1,1) 56: (1,1,4) 112: (1,1,5)
21: (2,2,1) 67: (5,1,1) 131: (6,1,1)
22: (2,1,2) 69: (4,2,1) 133: (5,2,1)
25: (1,3,1) 70: (4,1,2) 134: (5,1,2)
26: (1,2,2) 73: (3,3,1) 137: (4,3,1)
28: (1,1,3) 74: (3,2,2) 138: (4,2,2)
35: (4,1,1) 76: (3,1,3) 140: (4,1,3)
37: (3,2,1) 81: (2,4,1) 145: (3,4,1)
38: (3,1,2) 82: (2,3,2) 146: (3,3,2)
41: (2,3,1) 84: (2,2,3) 148: (3,2,3)
42: (2,2,2) 88: (2,1,4) 152: (3,1,4)
(End)

Crossrefs

Cf. A038465 (base 3), A038471 (base 4), A038475 (base 5).
Cf. A081091 (primes), A212190 (squares), A212192 (triangular numbers), A173589 (Fibbinary).
Cf. A057168.
Cf. A000079, A018900, A014311, A014312, A014313, A023688, A023689, A023690, A023691 (Hammingweight = 1, 2, ..., 9).
A000217(n-2) counts compositions into three parts.
A001399(n-3) = A069905(n) = A211540(n+2) counts the unordered case.
A001399(n-6) = A069905(n-3) = A211540(n-1) counts the unordered strict case.
A001399(n-6)*6 = A069905(n-3)*6 = A211540(n-1)*6 counts the strict case.
A014612 is an unordered version, with strict case A007304.
A337453 is the strict case.
A337461 counts the coprime case.
A033992 lists numbers divisible by exactly three different primes.
A323024 lists numbers with exactly three different prime multiplicities.

Programs

  • C
    unsigned hakmem175(unsigned x) {
        unsigned s, o, r;
        s = x & -x;  r = x + s;
        o = r ^ x;  o = (o >> 2) / s;
        return r | o;
    }
    unsigned A014311(int n) {
        if (n == 1) return 7;
        return hakmem175(A014311(n - 1));
    }  // Peter Luschny, Jan 01 2014
    
  • Haskell
    a014311 n = a014311_list !! (n-1)
    a014311_list = [2^x + 2^y + 2^z |
                    x <- [2..], y <- [1..x-1], z <- [0..y-1]]
    -- Reinhard Zumkeller, May 03 2012
    
  • Mathematica
    Select[Range[200], (Count[IntegerDigits[#, 2], 1] == 3)&]
    nn = 8; Flatten[Table[2^i + 2^j + 2^k, {i, 2, nn}, {j, 1, i - 1}, {k, 0, j - 1}]] (* T. D. Noe, Nov 05 2013 *)
  • PARI
    for(n=0,10^3,if(hammingweight(n)==3,print1(n,", "))); \\ Joerg Arndt, Mar 04 2014
    
  • PARI
    print1(t=7);for(i=2,50,print1(","t=A057168(t))) \\ M. F. Hasler, Aug 27 2014
    
  • Python
    A014311_list = [2**a+2**b+2**c for a in range(2,6) for b in range(1,a) for c in range(b)] # Chai Wah Wu, Jan 24 2021
    
  • Python
    from itertools import islice
    def A014311_gen(): # generator of terms
        yield (n:=7)
        while True: yield (n:=n^((a:=-n&n+1)|(a>>1)) if n&1 else ((n&~(b:=n+(a:=n&-n)))>>a.bit_length())^b)
    A014311_list = list(islice(A014311_gen(),20)) # Chai Wah Wu, Mar 10 2025
    
  • Python
    from math import isqrt, comb
    from sympy import integer_nthroot
    def A014311(n): return (1<<(r:=n-1-comb((m:=integer_nthroot(6*n,3)[0])+(t:=(n>comb(m+2,3)))+1,3))-comb((k:=isqrt(b:=r+1<<1))+(b>k*(k+1)),2))+(1<<(a:=isqrt(s:=n-comb(m-(t^1)+2,3)<<1))+((s<<2)>(a<<2)*(a+1)+1))+(1<Chai Wah Wu, Mar 10 2025

Formula

A000120(a(n)) = 3. - Reinhard Zumkeller, May 03 2012
Start with A084468. If n is in sequence, then 2n is too. - Ralf Stephan, Aug 16 2013
a(n+1) = A057168(a(n)). - M. F. Hasler, Aug 27 2014
a(n) = 2^A056558(n-1) + 2^A194848(n-1) + 2^A194847(n-1). - Ridouane Oudra, Sep 06 2020
Sum_{n>=1} 1/a(n) = A367110 = 1.428591545852638123996854844400537952781688750906133068397189529775365950039... (calculated using Baillie's irwinSums.m, see Links). - Amiram Eldar, Feb 14 2022

Extensions

Extension and program by Olivier Gérard

A014313 Numbers with exactly 5 ones in binary expansion.

Original entry on oeis.org

31, 47, 55, 59, 61, 62, 79, 87, 91, 93, 94, 103, 107, 109, 110, 115, 117, 118, 121, 122, 124, 143, 151, 155, 157, 158, 167, 171, 173, 174, 179, 181, 182, 185, 186, 188, 199, 203, 205, 206, 211, 213, 214, 217, 218, 220, 227, 229, 230, 233, 234, 236, 241, 242
Offset: 1

Views

Author

Al Black (gblack(AT)nol.net)

Keywords

Comments

Appears to give all n such that 4096 is the highest power of 2 dividing A005148(n). - Benoit Cloitre, Jun 22 2002

Crossrefs

Cf. A000079, A018900, A014311, A014312, A023688, A023689, A023690, A023691 (Hamming weight = 1, 2, ..., 9).

Programs

  • Haskell
    a014313 = f . a038447 where
       f x = if x == 0 then 0 else 2 * f x' + b  where (x', b) = divMod x 10
    -- Reinhard Zumkeller, Jan 06 2015
    
  • Mathematica
    Select[ Range[31, 240], Total[IntegerDigits[#, 2]] == 5&]
  • PARI
    sum_of_bits(n) = if(n<1, 0, sum_of_bits(floor(n/2))+n%2)
    isA014313(n) = (sum_of_bits(n) == 5); \\ Michael B. Porter, Oct 21 2009
    
  • PARI
    is(n)=hammingweight(n)==5 \\ Charles R Greathouse IV, Nov 17 2013
    
  • PARI
    print1(t=2^5-1); for(i=2, 50, print1(", "t=A057168(t))) \\ M. F. Hasler, Aug 27 2014
    
  • Python
    from itertools import islice
    def A014313_gen(): # generator of terms
        yield (n:=31)
        while True: yield (n:=((n&~(b:=n+(a:=n&-n)))>>a.bit_length())^b)
    A014313_list = list(islice(A014313_gen(),30)) # Chai Wah Wu, Mar 06 2025

Formula

a(n+1) = A057168(a(n)). - M. F. Hasler, Aug 27 2014
A038447(n) = A007088(a(n)). - Reinhard Zumkeller, Jan 06 2015
Sum_{n>=1} 1/a(n) = 1.390704528210321982529622080740025763242354253694629591331835888395977392151... (calculated using Baillie's irwinSums.m, see Links). - Amiram Eldar, Feb 14 2022

Extensions

Extension and program by Olivier Gérard

A023688 Numbers with exactly 6 ones in binary expansion.

Original entry on oeis.org

63, 95, 111, 119, 123, 125, 126, 159, 175, 183, 187, 189, 190, 207, 215, 219, 221, 222, 231, 235, 237, 238, 243, 245, 246, 249, 250, 252, 287, 303, 311, 315, 317, 318, 335, 343, 347, 349, 350, 359, 363, 365, 366, 371, 373
Offset: 1

Views

Author

Keywords

Comments

Sequence appears to include all numbers m such that 8^5 is the highest power of 2 dividing A005148(m). General conjecture: numbers k such that 8^j is the highest power of 2 dividing A005148(k) is the same sequence as numbers having exactly (j+1) 1's in their binary representation. - Benoit Cloitre, Jun 22 2002

Crossrefs

Cf. A000079, A018900, A014311, A014312, A014313, A023689, A023690, A023691 (Hamming weight = 1..9).

Programs

  • Mathematica
    Select[ Range[ 63, 380 ], (Count[ IntegerDigits[ #, 2 ], 1 ]==6)& ]
  • PARI
    is_A023688(n)=hammingweight(n)==6 \\ M. F. Hasler, Aug 27 2014
    
  • PARI
    print1(t=2^6-1); for(i=2, 50, print1(", "t=A057168(t))) \\ M. F. Hasler, Aug 27 2014
    
  • Python
    from itertools import islice
    def A023688_gen(): # generator of terms
        yield (n:=63)
        while True: yield (n:=((n&~(b:=n+(a:=n&-n)))>>a.bit_length())^b)
    A023688_list = list(islice(A023688_gen(),30)) # Chai Wah Wu, Mar 06 2025

Formula

a(n+1) = A057168(a(n)). - M. F. Hasler, Aug 27 2014
Sum_{n>=1} 1/a(n) = 1.387753111935705074750004158584017188750706394077047633137401652680870607884... (calculated using Baillie's irwinSums.m, see Links). - Amiram Eldar, Feb 14 2022

A060236 If n mod 3 = 0 then a(n) = a(n/3), otherwise a(n) = n mod 3.

Original entry on oeis.org

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

Views

Author

Henry Bottomley, Mar 21 2001

Keywords

Comments

A cubefree word. Start with 1, apply the morphisms 1 -> 121, 2 -> 122, take limit. See A080846 for another version.
Ultimate modulo 3: n-th digit of terms in "Ana sequence" (see A060032 for definition).
Equals A005148(n) reduced mod 3. In "On a sequence Arising in Series for Pi" Morris Newman and Daniel Shanks conjectured that 3 never divides A005148(n) and D. Zagier proved it. - Benoit Cloitre, Jun 22 2002
Also equals A038502(n) mod 3.
Last nonzero digit in ternary representation of n. - Franklin T. Adams-Watters, Apr 01 2006
a(2*n) = length of n-th run of twos. - Reinhard Zumkeller, Mar 13 2015

Examples

			a(10)=1 since 10=3^0*10 and 10 mod 3=1;
a(72)=2 since 24=3^3*8 and 8 mod 3=2.
		

Crossrefs

Cf. A026225 (indices of 1's), A026179 (indices of 2's).
Cf. A060032 (concatenate 3^n terms).

Programs

  • Haskell
    following Franklin T. Adams-Watters's comment.
    a060236 = head . dropWhile (== 0) . a030341_row
    -- Reinhard Zumkeller, Mar 13 2015
    
  • Magma
    [(Floor(n/3^Valuation(n, 3)) mod 3): n in [1..120]]; // G. C. Greubel, Nov 05 2024
    
  • Mathematica
    Nest[ Flatten[ # /. {1 -> {1, 2, 1}, 2 -> {1, 2, 2}}] &, {1}, 5] (* Robert G. Wilson v, Mar 04 2005 *)
    Table[Mod[n/3^IntegerExponent[n, 3], 3], {n, 1, 120}] (* Clark Kimberling, Oct 19 2016 *)
    lnzd[m_]:=Module[{s=Split[m]},If[FreeQ[Last[s],0],s[[-1,1]],s[[-2,1]]]]; lnzd/@Table[IntegerDigits[n,3],{n,120}] (* Harvey P. Dale, Oct 19 2018 *)
  • PARI
    a(n)=if(n<1, 0, n/3^valuation(n,3)%3) /* Michael Somos, Nov 10 2005 */
    
  • SageMath
    [n/3^valuation(n, 3)%3 for n in range(1,121)] # G. C. Greubel, Nov 05 2024

Formula

a(3*n) = a(n), a(3*n + 1) = 1, a(3*n + 2) = 2. - Michael Somos, Jul 29 2009
a(n) = 1 + A080846(n). - Joerg Arndt, Jan 21 2013

A005149 Sequence of coefficients arising in connection with a rapidly converging series for Pi.

Original entry on oeis.org

1, -24, 852, -35744, 1645794, -80415216, 4094489992, -214888573248, 11542515402255, -631467591949480, 35063515239394764, -1971043639046131296, 111949770626330347638, -6414671157989386260432, 370360217892318010055832, -21525284426246779936288192
Offset: 1

Views

Author

Keywords

Examples

			x - 24*x^2 + 852*x^3 - 35744*x^4 + 1645794*x^5 - 80415216*x^6 + 4094489992*x^7 + ...
		

References

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

Crossrefs

Programs

  • Mathematica
    CoefficientList[InverseSeries[Series[x*Product[(1+x^k)^24, {k, 1, 16}], {x, 0, 16}], x], x] // Rest (* Jean-François Alcover, Mar 29 2011 *)
    a[ n_] := If[ n < 1, 0, SeriesCoefficient[ InverseSeries[ Series[ q Product[ 1 + q^k, {k, n}]^24, {q, 0, n}], x], {x, 0, n}]] (* Michael Somos, Sep 11 2011 *)
  • PARI
    {a(n) = if( n<1, 0, polcoeff( serreverse( x * prod( k=1, n, 1 + x^k, 1 + x * O(x^n))^24), n))}

Formula

REVERT(A014103). a(n) = -(-1)^n * A195130(n).

Extensions

Formula and more terms from Michael Somos, Nov 24 2001
Signs corrected, Dec 24 2001
Showing 1-9 of 9 results.