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 41-50 of 69 results. Next

A340068 a(n) is the number of integers in the set {n+1,n+2, . . . ,2n} whose representation in base 2 contain exactly three digits 1’s.

Original entry on oeis.org

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

Views

Author

Bernard Schott, Dec 28 2020

Keywords

Comments

This sequence is inspired by the 3rd problem, proposed by Romania, during the 35th International Mathematical Olympiad in 1994 at Hong Kong (see the link IMO).
This sequence is increasing because there are only these two possibilities:
-> a(n+1) - a(n) = 1 if n has exactly two 1's in its binary representation (A018900);
-> a(n+1) - a(n) = 0 otherwise.
Consequence, for any positive integer m, a(x) = m has at least one solution (answer to the 1st Olympiad question).
Only when m = k*(k-1)/2 + 1 with k >= 2 (A000124 \ {1}), there exists only one n such that a(n) = m, and then n = 2^k+2 where k >= 2 (A052548 \ {3, 4}) (answer to the 2nd Olympiad question).

Examples

			a(2) = 0 because in {3, 4}, 3 = 11_2 and 4 = 100_2.
a(4) = 1 because in {5, 6, 7, 8, 9, 10} only 7 = 111_2 has 3 digits in its binary representation.
a(6) = 2 because in {7, 8, 9, 10, 11, 12}, there are 7 = 111_2 and 11 = 1011_2 that have 3 digits in their binary representation.
		

References

  • Marcin E. Kuczma, International Mathematical Olympiads, 1986-1999, The Mathematical Association of America, 2003, pages 10 and 92-93.

Crossrefs

Cf. A000120, A014311, A018900, A057168, A151774 (first differences).

Programs

Formula

a(2^k+2) = k*(k-1)/2 + 1 for k >= 2.

Extensions

More terms from David A. Corneth, Dec 28 2020

A363788 Even primitive binary Niven numbers: even terms of A363787.

Original entry on oeis.org

6, 10, 18, 34, 60, 66, 92, 108, 116, 126, 130, 156, 172, 180, 204, 212, 222, 228, 246, 258, 284, 300, 308, 318, 332, 340, 356, 366, 378, 396, 404, 414, 420, 438, 452, 462, 474, 486, 498, 514, 540, 556, 564, 588, 596, 606, 612, 630, 652, 660, 676, 708, 726, 780
Offset: 1

Views

Author

Amiram Eldar, Jun 22 2023

Keywords

Comments

The odd terms of A363787 are all the odd binary Niven numbers (A144302).
This sequence is infinite. E.g., A052548(k) = 2^k + 2 is a term for all k >= 2.

Crossrefs

Subsequence of A049445 and A363787.
Equals A363787 \ A144302.
Cf. A052548, A358255 (decimal analog).

Programs

  • Mathematica
    binNivQ[n_] := Divisible[n, DigitCount[n, 2, 1]]; q[n_] := binNivQ[n] && ! (EvenQ[n] && binNivQ[n/2]); Select[Range[2, 1000, 2], q]
  • PARI
    isbinniv(n) = !(n % hammingweight(n));
    is(n) = !(n%2) && isbinniv(n) && !isbinniv(n/2);

A370825 a(n) is the numerator of the ratio of winning probabilities in a game similar to A370823, but with a draw and single round odds A:B:draw of 3:2:1.

Original entry on oeis.org

3, 2, 39, 4, 363, 26, 3279, 328, 29523, 1342, 11553, 292, 2391483, 1195742, 21523359, 126608, 193710243, 728234, 1743392199, 3169804, 15690529803, 341098474, 3004569537, 155181064, 1270932914163, 635466457082, 11438396227479, 39442745612, 102945566047323, 21563796826
Offset: 1

Views

Author

Hugo Pfoertner, Mar 08 2024

Keywords

Comments

Such a game can be implemented, for instance, by rolling a single die per round, with A winning the round on numbers 1, 2, 3, B winning on 4, 5 and a draw on 6. To win the game it is necessary to win n rounds in a row. The draw also terminates winning streaks of A or B.

Examples

			a(n)/A370826(n) for n=1..14: 3/2, 2, 39/14, 4, 363/62, 26/3, 3279/254, 328/17, 29523/1022, 1342/31, 11553/178, 292/3, 2391483/16382, 1195742/5461.
		

Crossrefs

A370826 are the corresponding denominators.
A052548(n+1)/3 is the ratio of winning probabilities when the odds are 2:1:1.
Cf. A370823, A370824 for odds 2:1:0.

Programs

  • Mathematica
    Array[Numerator[3/4*(3^#-1)/(2^#-1)] &, 50] (* Paolo Xausa, Mar 11 2024 *)
  • PARI
    a370825(n) = numerator((3/4) * (3^n - 1) / (2^n - 1));
    
  • Python
    from math import gcd
    def A370825(n): return (a:=3**(n+1)-3>>1)//gcd(a,(1<Chai Wah Wu, Mar 10 2024

Formula

a(n)/A370826(n) = (3/4) * (3^n - 1) / (2^n - 1).

A134250 Expansion of x*(4+9*x-7*x^2) / ((1-x)*(1+3*x-x^2)).

Original entry on oeis.org

4, 1, 7, -14, 55, -173, 580, -1907, 6307, -20822, 68779, -227153, 750244, -2477879, 8183887, -27029534, 89272495, -294847013, 973813540, -3216287627, 10622676427, -35084316902, 115875627139, -382711198313, 1264009222084, -4174738864559, 13788225815767
Offset: 1

Views

Author

Roger L. Bagula, Jan 14 2008

Keywords

Crossrefs

Programs

  • Maple
    A134250 := proc(n)
            2-17*(-1)^n*A006190(n)+5*(-1)^n*A006190(n+1) ;
    end proc:
    seq(A134250(n),n=1..10) ; # R. J. Mathar, Dec 06 2011
  • Mathematica
    LinearRecurrence[{-2,4,-1},{4,1,7},30] (* Harvey P. Dale, Aug 15 2015 *)
    Rest@ CoefficientList[Series[x (4 + 9 x - 7 x^2)/((1 - x) (1 + 3 x - x^2)), {x, 0, 27}], x] (* Michael De Vlieger, May 16 2017 *)
  • PARI
    Vec(x*(4+9*x-7*x^2)/((1-x)*(1+3*x-x^2)) + O(x^30)) \\ Colin Barker, May 16 2017

Formula

a(n) = 2-17*(-1)^n*A006190(n) +5*(-1)^n*A006190(n+1). - R. J. Mathar, Dec 06 2011
From Colin Barker, May 16 2017: (Start)
a(n) = 2 + (2^(-1-n)*((-3-sqrt(13))^n*(-19+5*sqrt(13)) + (-3+sqrt(13))^n*(19+5*sqrt(13)))) / sqrt(13).
a(n) = -2*a(n-1) + 4*a(n-2) - a(n-3) for n>3.
(End)

A178675 a(n) = 4^n + 4.

Original entry on oeis.org

5, 8, 20, 68, 260, 1028, 4100, 16388, 65540, 262148, 1048580, 4194308, 16777220, 67108868, 268435460, 1073741828, 4294967300, 17179869188, 68719476740, 274877906948, 1099511627780, 4398046511108, 17592186044420, 70368744177668, 281474976710660, 1125899906842628
Offset: 0

Views

Author

Vincenzo Librandi, Dec 25 2010

Keywords

Crossrefs

Programs

  • GAP
    List([0..30], n -> 4^n + 4); # G. C. Greubel, Jan 27 2019
  • Magma
    [4^n+4: n in [0..35]];
    
  • Magma
    I:=[5, 8]; [n le 2 select I[n] else 5*Self(n-1)-4*Self(n-2): n in [1..30]]; // Vincenzo Librandi, Jun 18 2013
    
  • Mathematica
    Table[4^n +4, {n, 0, 40}] (* or *) CoefficientList[Series[(5-17x)/((4x - 1)(x-1)), {x, 0, 30}], x] (* Vincenzo Librandi, Jun 18 2013 *)
    LinearRecurrence[{5,-4},{5,8},30] (* Harvey P. Dale, Sep 12 2023 *)
  • PARI
    vector(40, n, n--; 4^n+4) \\ G. C. Greubel, Jan 27 2019
    
  • Sage
    [4^n+4 for n in range(40)] # G. C. Greubel, Jan 27 2019
    

Formula

a(n) = 4*(a(n-1) - 3) with n > 0, a(0)=5.
G.f.: ( 5-17*x ) / ( (1-4*x)*(1-x) ). - R. J. Mathar, Jan 05 2011
a(n) = 5*a(n-1) - 4*a(n-2). - Vincenzo Librandi, Jun 18 2013
E.g.f.: exp(4*x) + 4*exp(x). - G. C. Greubel, Jan 27 2019

A254147 a(n) = 1*9^n + 2*8^n + 3*7^n + 4*6^n + 5*5^n + 6*4^n + 7*3^n + 8*2^n + 9*1^n.

Original entry on oeis.org

45, 165, 825, 4917, 32505, 229845, 1703625, 13072917, 103008345, 828707925, 6779099625, 56214660117, 471424600185, 3990804658005, 34053173154825, 292542431786517, 2527742384720025, 21950298188288085, 191434401453597225, 1675813243179972117
Offset: 0

Views

Author

Luciano Ancora, Jan 28 2015

Keywords

Comments

This is the sequence of ninth terms of "second partial sums of m-th powers".

Crossrefs

Programs

  • Maple
    seq(add(i*(10-i)^n, i = 1..9), n = 0..20); # Peter Bala, Jan 31 2017
  • PARI
    vector(30, n, n--; 8*2^n + 6*4^n + 2*8^n + 7*3^n + 4*6^n + 9^n + 5*5^n + 3*7^n + 9) \\ Colin Barker, Jan 28 2015

Formula

G.f.: -3*(2333280*x^8 - 5080464*x^7 + 4500500*x^6 - 2143640*x^5 + 605675*x^4 - 104636*x^3 + 10850*x^2 - 620*x + 15) / ((x - 1)*(2*x - 1)*(3*x - 1)*(4*x - 1)*(5*x - 1)*(6*x - 1)*(7*x - 1)*(8*x - 1)*(9*x - 1)). - Colin Barker, Jan 28 2015
From Peter Bala, Jan 31 2016: (Start)
a(n) = (x + 1)*( Bernoulli(n + 1, x + 1) - Bernoulli(n + 1, 1) )/(n + 1) - ( Bernoulli(n + 2, x + 1) - Bernoulli(n + 2, 1) )/(n + 2) at x = 9.
a(n) = (1/8!)*Sum_{k = 0..n} (-1)^(k+n)*(k + 10)!*Stirling2(n,k) /((k + 1)*(k + 2)). (End)

A261723 Interleave 2^n + 2 and 2^n + 1.

Original entry on oeis.org

4, 3, 6, 5, 10, 9, 18, 17, 34, 33, 66, 65, 130, 129, 258, 257, 514, 513, 1026, 1025, 2050, 2049, 4098, 4097, 8194, 8193, 16386, 16385, 32770, 32769, 65538, 65537, 131074, 131073, 262146, 262145, 524290, 524289, 1048578, 1048577, 2097154, 2097153, 4194306, 4194305, 8388610, 8388609
Offset: 1

Views

Author

Alonso del Arte, Aug 29 2015

Keywords

Comments

There is only one fundamental difference between the x + 1 problem and the 3x + 1 problem, that being one of definition: if x is odd, then the next value is x + 1 rather than 3x + 1. But there are also important differences between the two problems, such as that with the x + 1 problem it is easy to prove that every positive integer x reaches 1 after a finite number of iterations.
As with the 3x + 1 problem, the minimum necessary number of iterations is obvious: given an arbitrary positive n, it will take at least floor(log_2(n)) iterations to reach 1, especially if n is a power of 2 to begin with.
But with the x + 1 problem, it is almost as easy to determine the maximum number of iterations needed to reach 1: 2*ceiling(log_2(n)). This is the case when n is one of the odd numbers in this sequence, in which case there are no consecutive halving steps prior to reaching 4.
If an initial 1 and 2 are added to this sequence, the complete x + 1 trajectory of any number in this sequence can be obtained by reading backwards from that number.
A061313(n) = number of steps to reach 1 when starting with n. - Reinhard Zumkeller, Sep 05 2015

Crossrefs

Programs

  • Haskell
    a261723 n = a261723_list !! (n-1)
    a261723_list = concat $ transpose [tail a052548_list, tail a000051_list]
    -- Reinhard Zumkeller, Sep 05 2015
  • Magma
    &cat[[2^n+2, 2^n+1]: n in [1..30]]; // Vincenzo Librandi, Aug 31 2015
    
  • Maple
    A261723:=n->(2^((n+1)/2)+2)*(1-(-1)^n)/2+(2^(n/2)+1)*(1+(-1)^n)/2: seq(A261723(n), n=1..60); # Wesley Ivan Hurt, Sep 06 2015
  • Mathematica
    Flatten[Table[{2^n + 2, 2^n + 1}, {n, 25}]]
  • PARI
    Vec(-x*(4*x^3+6*x^2-3*x-4)/((x-1)*(x+1)*(2*x^2-1)) + O(x^100)) \\ Colin Barker, Aug 31 2015
    

Formula

a(2n - 1) = 2^n + 2, a(2n) = 2^n + 1.
a(1) = 4, a(2n) = 2a(n - 1), a(2n + 1) = a(n - 1) - 1.
a(1) = 4, a(n) = a(n - 1) - 1 if a(n - 1) is even, a(n) = 2a(n - 1) if a(n - 1) is odd.
a(n) = 3*a(n-2) - 2*a(n-4) for n > 4. - Colin Barker, Aug 31 2015
G.f.: -x*(4*x^3+6*x^2-3*x-4) / ((x-1)*(x+1)*(2*x^2-1)). - Colin Barker, Aug 31 2015
a(n) = (2^((n+1)/2)+2)*(1-(-1)^n)/2+(2^(n/2)+1)*(1+(-1)^n)/2. - Wesley Ivan Hurt, Sep 06 2015
E.g.f.: sqrt(2)*sinh(sqrt(2)*x) + cosh(sqrt(2)*x) + 2*sinh(x) + cosh(x) - 2. - Robert Israel, Sep 06 2015

Extensions

Two incorrect terms corrected by Colin Barker, Aug 31 2015

A281699 Sierpinski stellated octahedron numbers: a(n) = 2*(-3*2^(n+1) + 2^(2n+3) + 5).

Original entry on oeis.org

14, 50, 218, 938, 3914, 16010, 64778, 260618, 1045514, 4188170, 16764938, 67084298, 268386314, 1073643530, 4294770698, 17179475978, 68718690314, 274876334090, 1099508482058, 4398040219658, 17592173461514, 70368719011850, 281474926379018, 1125899806179338, 4503599426043914, 18014398106828810
Offset: 0

Views

Author

Steven Beard, Jan 27 2017

Keywords

Comments

Stella octangula with Sierpinski recursion.

Crossrefs

Programs

  • Mathematica
    Table[8 (2^(2 n + 1) + 2) - 6 (2^(n + 1) + 1), {n, 0, 25}] (* or *)
    LinearRecurrence[{7, -14, 8}, {14, 50, 218}, 26] (* or *)
    CoefficientList[Series[2 (7 - 24 x + 32 x^2)/((1 - x) (1 - 2 x) (1 - 4 x)), {x, 0, 25}], x] (* Michael De Vlieger, Jan 28 2017 *)
  • PARI
    Vec(2*(7 - 24*x + 32*x^2) / ((1 - x)*(1 - 2*x)*(1 - 4*x)) + O(x^30)) \\ Colin Barker, Jan 28 2017
    
  • PARI
    a(n) = 16*4^n - 12*2^n + 10 \\ Charles R Greathouse IV, Jan 29 2017

Formula

a(n) = 8*(2^(2*n+1)+2) - 6*(2^(n+1)+1).
From Colin Barker, Jan 28 2017: (Start)
a(n) = 7*a(n-1) - 14*a(n-2) + 8*a(n-3) for n>2.
G.f.: 2*(7 - 24*x + 32*x^2) / ((1 - x)*(1 - 2*x)*(1 - 4*x)).
(End)

A339378 Let n be a positive integer. For each prime divisor p of n, consider the highest power of p which does not exceed n. The sum a(n) of these powers is defined as the power-sum of n.

Original entry on oeis.org

0, 2, 3, 4, 5, 7, 7, 8, 9, 13, 11, 17, 13, 15, 14, 16, 17, 25, 19, 21, 16, 27, 23, 25, 25, 29, 27, 23, 29, 68, 31, 32, 38, 49, 32, 59, 37, 51, 40, 57, 41, 66, 43, 43, 52, 55, 47, 59, 49, 57, 44, 45, 53, 59, 36, 81, 46, 61, 59, 84, 61, 63, 76, 64, 38, 102, 67, 81
Offset: 1

Views

Author

Bernard Schott, Dec 06 2020

Keywords

Comments

The idea of this sequence comes from the 85th Eötvös-Kürschák Competition of 1985, Class 9 - 12, Category 1, Round 1, Problem 2. In the problem it was asked to prove that there exist infinitely many positive integers n such as n < a(n) (see link).
The Kürschák Mathematical Competition, founded in 1894 in Hungary, but known as Eötvös Mathematical Competition until 1938, is the oldest modern mathematical competition for students in the world.
For each prime divisor p of n, the highest power of p which does not exceed n is equal to p^(floor(log_p(n))) [for p=2, see A000523 and A053644].
There exist two infinite families of numbers (see De Koninck & Mercier reference) that satisfy n < a(n):
--> n = 2^k + 2, k>=2 or n is in A052548 \ {3,4}, and,
--> n = 2*p with odd prime p or n is in A100484 \ {4}.
Other integers like 12, 20, 30, 33, 36, 39, 42, 45, 48, 50 satisfy also n < a(n).

Examples

			12 = 2^2 * 3^1; the highest power of 2 which does not exceed 12 is 2^3 and the highest power of 3 which does not exceed 12 is 3^2, hence a(12) = 2^3 + 3^2 = 2^(floor(log_2(12))) + 3^(floor(log_3(12))) = 17.
		

References

  • J.-M. De Koninck & A. Mercier, 1001 Problèmes en Théorie Classique des Nombres, Ellipses, 2004, Problème 683, pp. 89 and 294.

Crossrefs

Programs

  • Maple
    pf := n -> NumberTheory:-PrimeFactors(n): a := n -> add(p^ilog[p](n), p in pf(n)):
    seq(a(n), n=1..68); # Peter Luschny, Dec 07 2020
  • Mathematica
    f[n_, p_] := p^Floor[Log[p, n]]; a[1] = 0; a[n_] := Plus @@ (f[n, #] & /@ FactorInteger[n][[;; , 1]]); Array[a, 100] (* Amiram Eldar, Dec 06 2020 *)
  • PARI
    a(n) = my(f=factor(n)); sum(k=1, #f~, my(p=f[k,1]); p^logint(n, p)); \\ Michel Marcus, Dec 06 2020

Formula

a(n) = Sum_{p | n} p^(floor(log_p(n))).
a(n) = n iff n = p^k , p prime, k >= 1 (A246655).

A348838 Number of 3-sided prudent polygons of area n.

Original entry on oeis.org

6, 10, 20, 42, 92, 204, 454, 1010, 2242, 4962, 10946, 24066, 52736, 115186, 250800, 544432, 1178432, 2543712, 5476352, 11760642, 25196566, 53861008, 114889430, 244571174, 519630462, 1102021562, 2333088968, 4931232086, 10406327848, 21927562520, 46138651012
Offset: 1

Views

Author

Vaclav Kotesovec, following a suggestion from Anthony Guttmann, Nov 02 2021

Keywords

Crossrefs

Programs

  • Mathematica
    nmax = 40; Rest[CoefficientList[Series[2*q*(3 - 10*q + 9*q^2 - q^3)/((1 - 2*q)^2*(1 - q)) - 2*q^3*(1 - q)^2/(1 - 2*q)^2 * Sum[(-1)^m * q^(2*m) / ((1 - 2*q)^m*(1 - q - q^(m + 1))) * Product[(1 - q - q^k + q^(k+1) - q^(k+2)) / (1 - q - q^(k+1)), {k, 1, m-1}], {m, 1, nmax}], {q, 0, nmax}], q]]

Formula

Reference gives generating function and asymptotics.
Previous Showing 41-50 of 69 results. Next