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.

A156589 a(n) = 4^n - 2^n - 1.

Original entry on oeis.org

-1, 1, 11, 55, 239, 991, 4031, 16255, 65279, 261631, 1047551, 4192255, 16773119, 67100671, 268419071, 1073709055, 4294901759, 17179738111, 68719214591, 274877382655, 1099510579199, 4398044413951, 17592181850111, 70368735789055
Offset: 0

Views

Author

M. F. Hasler, Feb 10 2009

Keywords

Comments

Sequence A098845 lists indices of primes, i.e., a(n) prime <=> n=A098845(k) for some k.
Starting with n=2, binary numbers of the form (n-1)0(n) where n is the index and the number of 1's. It can also be formed by appending a 1 to the right of each term of A129868.
1/a(n) = Sum_{m>0} A000045(m)*2^(-n(m+1)) for n > 0. E.g., 1/a(4) = 0.0000 0001 0001 0010 0011 0101 1000 ... in binary. - Lee A. Newberg, Apr 12 2018

Crossrefs

Programs

  • Magma
    [4^n-2^n-1: n in [0..30]]; // Vincenzo Librandi, Apr 13 2018
  • Mathematica
    Table[4^n - 2^n - 1, {n, 0, 25}] (* Vincenzo Librandi, Apr 13 2018 *)
  • PARI
    vector(99,n,4^n-2^n-1)
    

Formula

G.f.: ( 1-8*x+10*x^2 ) / ( (-1+x)*(2*x-1)*(4*x-1) ). - R. J. Mathar, Oct 21 2014

A170940 4^n-2^n-2.

Original entry on oeis.org

0, 10, 54, 238, 990, 4030, 16254, 65278, 261630, 1047550, 4192254, 16773118, 67100670, 268419070, 1073709054, 4294901758, 17179738110, 68719214590, 274877382654, 1099510579198, 4398044413950, 17592181850110, 70368735789054, 281474959933438, 1125899873288190
Offset: 1

Views

Author

N. J. A. Sloane, Feb 13 2010

Keywords

Comments

a(n) is also the number whose binary representation is the concatenation of n-1 1's, 0, n-1 1's and 0 (See example). [From Omar E. Pol, Mar 16 2010]

Examples

			Contribution from _Omar E. Pol_, Mar 16 2010: (Start)
n ...... a(n) written in base 2 ..... a(n)
1 ................ 0 ................ 0
2 ............... 1010 .............. 10
3 .............. 110110 ............. 54
4 ............. 11101110 ............ 238
5 ............ 1111011110 ........... 990
6 ........... 111110111110 .......... 4030
7 .......... 11111101111110 ......... 16254
8 ......... 1111111011111110 ........ 65278
9 ........ 111111110111111110 ....... 261630
10 ...... 11111111101111111110 ...... 1047550
(End)
		

Crossrefs

Cf. A170926.
Cf. A006516, A138148, A173521. [From Omar E. Pol, Mar 16 2010]

Formula

a(n)= 7*a(n-1) -14*a(n-2) +8*a(n-3) = 2*A129868(n-1). G.f.: 2*x^2*(-5+8*x)/((x-1) * (2*x-1) * (4*x-1)). [From R. J. Mathar, Feb 14 2010]
a(n) = 2*(A006516(n)-1) [From Omar E. Pol, Mar 16 2010]

A220236 Binary palindromic numbers with only two 0 bits, both in the middle.

Original entry on oeis.org

9, 51, 231, 975, 3999, 16191, 65151, 261375, 1047039, 4191231, 16771071, 67096575, 268410879, 1073692671, 4294868991, 17179672575, 68719083519, 274877120511, 1099510054911, 4398043365375, 17592179752959, 70368731594751, 281474951544831, 1125899856510975
Offset: 1

Views

Author

Alex Ratushnyak, Dec 08 2012

Keywords

Comments

Binary expansion is 1001, 110011, 11100111, 1111001111, ...
Last digit of the decimal representation follows the pattern 9, 1, 1, 5, 9, 1, 1, 5, 9, ...

Crossrefs

Cf. A129868.

Programs

  • Mathematica
    Table[2^(2n + 2) - 2^(n + 1) - 2^n - 1, {n, 25}] (* Alonso del Arte, Dec 08 2012 *)
    LinearRecurrence[{7,-14,8},{9,51,231},30] (* Harvey P. Dale, Jan 24 2019 *)
  • Python
    for n in range(1,77):
        print (2**(2*n+2)-2**n-2**(n+1)-1),

Formula

a(n) = 2^(2*n + 2) - 2^(n + 1) - 2^n - 1.
a(n) = 7*a(n-1)-14*a(n-2)+8*a(n-3). G.f.: 3*x*(4*x-3) / ((x-1)*(2*x-1)*(4*x-1)). - Colin Barker, May 31 2013

A357574 a(n) is the maximum number of pairs that sum to a power of 2 in a set of n consecutive odd numbers.

Original entry on oeis.org

0, 1, 2, 4, 5, 7, 9, 11, 13, 15, 17, 19, 21, 24, 26, 29, 31, 34, 36, 39, 41, 44, 46, 49, 51, 54, 56, 59, 62, 65, 68, 71, 74, 77, 80, 83, 86, 89, 92, 95, 98, 101, 104, 107, 110, 113, 116, 119, 122, 125, 128, 131, 134, 137, 140, 143, 146, 150, 153, 157, 160, 164, 167
Offset: 1

Views

Author

Thomas Scheuerle, Oct 04 2022

Keywords

Comments

An optimal set delivering a(n) pairs summing to powers of 2 can be formed by n-A357409(n) first negative odd numbers and A357409(n) first positive odd numbers, that is, by the odd numbers in the interval [-2*(n-A357409(n))+1, 2*A357409(n)-1].
a(n) is in many cases equal to A347301(n) but there are some deviations: a(3) = 2 but A347301(3) = 3, a(29) = 62 but A347301(29) = 61, a(31) = 68 but A347301(32) = 67, a(33) = 74 but A347301(33) = 73, ... . Hence it appears that a(n) may be used as an improved lower bound for A352178(n) in many cases.
Conjecture: a(n+1) - a(n) = k, if n is even then A129868(k-1) < n < A129868(k), if n is odd then A020515(k) <= n < A020515(k+1).

Examples

			a(5) = 5 because A357409(5) = 4, for which the corresponding set {-1, 1, 3, 5, 7} produces 5 powers of 2: 1+3, 1+7, 3+5, 3-1, 5-1.
		

Crossrefs

Programs

  • MATLAB
    function a = A357574( max_n )
        a(1) = 0; q = [];
        for n = 1:max_n
            c = 0;
            for k = 0:n
                s = (2*([0:n]-k))+1;
                r = countpowtwo(s);
                if c < r
                    c = r;
                    q = s;
                end
            end
            a(n+1) = c;
        end
    end
    function c = countpowtwo(s)
        M = repmat(s, [length(s), 1]);
        M = M+M';
        M(M<=0) = 7;
        M = bitand(M, M-1);
        M = M + eye(size(M));
        c = length(find(M == 0))/2;
    end

Formula

a(n) <= A352178(n).
a(n) >= n-1. This would be the maximum value that could be attained for a set of only positive odd numbers and size n.

Extensions

Edited by Max Alekseyev, Mar 09 2023

A187560 a(n) = 4^(n+1)-2^n-1.

Original entry on oeis.org

2, 13, 59, 247, 1007, 4063, 16319, 65407, 261887, 1048063, 4193279, 16775167, 67104767, 268427263, 1073725439, 4294934527, 17179803647, 68719345663, 274877644799, 1099511103487, 4398045462527, 17592183947263, 70368739983359, 281474968322047, 1125899890065407
Offset: 0

Views

Author

Brad Clardy, Mar 25 2011

Keywords

Comments

For n>0, binary numbers of the form (n+1)0 n, where n is the index value and the number of 1's. This can be formed by appending a leading 1 to the terms of A129868. It is also A156589 written in bit-reverse order.

Examples

			Binary values of the first 7 terms are 10, 1101, 111011, 11110111, 1111101111, 111111011111, 11111110111111.
		

Crossrefs

Cf. A171499.

Programs

  • Mathematica
    Table[4^(n+1)-2^n-1,{n,0,30}] (* or *) LinearRecurrence[{7,-14,8},{2,13,59},30] (* Harvey P. Dale, Feb 25 2013 *)
  • PARI
    a(n)=4^(n+1)-2^n-1 \\ Charles R Greathouse IV, Nov 01 2015

Formula

a(n) = 4^(n+1)-2^n-1 = A171499(n)-1.
G.f.: ( -2+x+4*x^2 ) / ( (x-1)*(2*x-1)*(4*x-1) ). - R. J. Mathar, Apr 09 2011
a(0)=2, a(1)=13, a(2)=59, a(n)=7*a(n-1)-14*a(n-2)+8*a(n-3). - Harvey P. Dale, Feb 25 2013
E.g.f.: exp(x)*(4*exp(3*x) - exp(x) - 1). - Stefano Spezia, Apr 11 2025

Extensions

Terms a(21) and beyond from Andrew Howroyd, Feb 25 2018

A267090 Triangle read by rows: Fill an n X n square with 1's, except for 0's on the two main diagonals. Then T(n,k) is decimal equivalent of the k-th row (0<=k<=n).

Original entry on oeis.org

0, 0, 0, 2, 5, 2, 6, 9, 9, 6, 14, 21, 27, 21, 14, 30, 45, 51, 51, 45, 30, 62, 93, 107, 119, 107, 93, 62, 126, 189, 219, 231, 231, 219, 189, 126, 254, 381, 443, 471, 495, 471, 443, 381, 254, 510, 765, 891, 951, 975, 975, 951, 891, 765, 510
Offset: 0

Views

Author

Kival Ngaokrajang, Jan 10 2016

Keywords

Comments

Inspired by A137932 and A042948.
Conjectures:
(i) The first column is A000225/2.
(ii) For even-n, T(n,n/2) = A129868.
(iii) For odd-n, T(n,(n-1)/2) = T(n,(n+1)/2) = A220236.

Examples

			Triangle begins:
n\k  0   1   2   3   4   5   6   7   8 ...
0    0
1    0   0
2    2   5   2
3    6   9   9   6
4   14  21  27  21  14
5   30  45  51  51  45  30
6   62  93 107 119 107  93  62
7  126 189 219 231 231 219 189 126
8  254 381 443 471 495 471 443 381 254
...
		

Crossrefs

A267812 Decimal representation of the n-th iteration of the "Rule 217" elementary cellular automaton starting with a single ON (black) cell.

Original entry on oeis.org

1, 1, 27, 119, 495, 2015, 8127, 32639, 130815, 523775, 2096127, 8386559, 33550335, 134209535, 536854527, 2147450879, 8589869055, 34359607295, 137438691327, 549755289599, 2199022206975, 8796090925055, 35184367894527, 140737479966719, 562949936644095
Offset: 0

Views

Author

Robert Price, Jan 20 2016

Keywords

References

  • S. Wolfram, A New Kind of Science, Wolfram Media, 2002; p. 55.

Crossrefs

Programs

  • Mathematica
    rule=217; rows=20; ca=CellularAutomaton[rule,{{1},0},rows-1,{All,All}]; (* Start with single black cell *) catri=Table[Take[ca[[k]],{rows-k+1,rows+k-1}],{k,1,rows}]; (* Truncated list of each row *) Table[FromDigits[catri[[k]],2],{k,1,rows}] (* Decimal Representation of Rows *)

Formula

Conjectures from Colin Barker, Jan 22 2016: (Start)
a(n) = 7*a(n-1)-14*a(n-2)+8*a(n-3) for n>4.
G.f.: (1-6*x+34*x^2-64*x^3+32*x^4) / ((1-x)*(1-2*x)*(1-4*x)).
(End)

A279260 Numbers which are cyclops palindromic in their binary reflected Gray code representation.

Original entry on oeis.org

0, 6, 18, 90, 330, 1386, 5418, 21930, 87210, 349866, 1397418, 5593770, 22366890, 89483946, 357903018, 1431677610, 5726579370, 22906579626, 91625794218, 366504225450, 1466014804650, 5864063412906, 23456245263018, 93824997829290, 375299957762730, 1501199898159786, 6004799458421418
Offset: 0

Views

Author

Indranil Ghosh, Jan 17 2017

Keywords

Comments

Cyclops palindromic numbers in base 2 are numbers with middle bit 0, having equal number of 1's on both side of the 0. There is a single 0 bit in the middle and the total number of bits is odd. The middle '0' represents the eye of a cyclops.
a(n) mod 6 = 0.

Examples

			90 is in the sequence because the binary reflected Gray code representation of 90 is '1110111' which is a cyclops palindromic binary number.
		

Crossrefs

Partial sums of A071930.

Programs

  • PARI
    a(n)=(-2*(1+((-2)^n)-(2^(2*n+1))))/3 \\ Charles R Greathouse IV, Jun 29 2018
  • Python
    def a(n):
        return (-2*(1+((-2)**n)-(2**(2*n+1))))/3
    

Formula

a(n) = (-2*(1+((-2)^n)-(2^(2*n+1))))/3.
Previous Showing 11-18 of 18 results.